Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-3.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata

Pull libata fixes from Tejun Heo:

- Bartlomiej will be co-maintaining PATA portion of libata. git
workflow will stay the same.

- sata_sil24 wasn't happy with tag ordered submission. An option to
restore the old tag allocation behavior is implemented for sil24.

- a very old race condition in PIO host state machine which can trigger
BUG fixed.

- other driver-specific changes

* 'for-3.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
libata: prevent HSM state change race between ISR and PIO
libata: allow sata_sil24 to opt-out of tag ordered submission
ata: pata_at91: depend on !ARCH_MULTIPLATFORM
ahci: Remove Device ID for Intel Sunrise Point PCH
ahci: Use dev_info() to inform about the lack of Device Sleep support
libata: Whitelist SSDs that are known to properly return zeroes after TRIM
sata_dwc_460ex: fix resource leak on error path
ata: add MAINTAINERS entry for libata PATA drivers
libata: clean up MAINTAINERS entries
libata: export ata_get_cmd_descript()
ahci_xgene: Fix the DMA state machine lockup for the ATA_CMD_PACKET PIO mode command.
ahci_xgene: Fix the endianess issue in APM X-Gene SoC AHCI SATA controller driver.

+118 -64
+43 -32
MAINTAINERS
··· 754 754 S: Maintained 755 755 F: drivers/media/i2c/aptina-pll.* 756 756 757 - ARASAN COMPACT FLASH PATA CONTROLLER 758 - M: Viresh Kumar <viresh.linux@gmail.com> 759 - L: linux-ide@vger.kernel.org 760 - S: Maintained 761 - F: include/linux/pata_arasan_cf_data.h 762 - F: drivers/ata/pata_arasan_cf.c 763 - 764 757 ARC FRAMEBUFFER DRIVER 765 758 M: Jaya Kumar <jayalk@intworks.biz> 766 759 S: Maintained ··· 5697 5704 F: include/linux/lguest*.h 5698 5705 F: tools/lguest/ 5699 5706 5707 + LIBATA SUBSYSTEM (Serial and Parallel ATA drivers) 5708 + M: Tejun Heo <tj@kernel.org> 5709 + L: linux-ide@vger.kernel.org 5710 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git 5711 + S: Maintained 5712 + F: drivers/ata/ 5713 + F: include/linux/ata.h 5714 + F: include/linux/libata.h 5715 + 5716 + LIBATA PATA ARASAN COMPACT FLASH CONTROLLER 5717 + M: Viresh Kumar <viresh.linux@gmail.com> 5718 + L: linux-ide@vger.kernel.org 5719 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git 5720 + S: Maintained 5721 + F: include/linux/pata_arasan_cf_data.h 5722 + F: drivers/ata/pata_arasan_cf.c 5723 + 5724 + LIBATA PATA DRIVERS 5725 + M: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com> 5726 + M: Tejun Heo <tj@kernel.org> 5727 + L: linux-ide@vger.kernel.org 5728 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git 5729 + S: Maintained 5730 + F: drivers/ata/pata_*.c 5731 + F: drivers/ata/ata_generic.c 5732 + 5733 + LIBATA SATA AHCI PLATFORM devices support 5734 + M: Hans de Goede <hdegoede@redhat.com> 5735 + M: Tejun Heo <tj@kernel.org> 5736 + L: linux-ide@vger.kernel.org 5737 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git 5738 + S: Maintained 5739 + F: drivers/ata/ahci_platform.c 5740 + F: drivers/ata/libahci_platform.c 5741 + F: include/linux/ahci_platform.h 5742 + 5743 + LIBATA SATA PROMISE TX2/TX4 CONTROLLER DRIVER 5744 + M: Mikael Pettersson <mikpelinux@gmail.com> 5745 + L: linux-ide@vger.kernel.org 5746 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git 5747 + S: Maintained 5748 + F: drivers/ata/sata_promise.* 5749 + 5700 5750 LIBLOCKDEP 5701 5751 M: Sasha Levin <sasha.levin@oracle.com> 5702 5752 S: Maintained ··· 7614 7578 S: Obsolete 7615 7579 F: drivers/net/wireless/prism54/ 7616 7580 7617 - PROMISE SATA TX2/TX4 CONTROLLER LIBATA DRIVER 7618 - M: Mikael Pettersson <mikpelinux@gmail.com> 7619 - L: linux-ide@vger.kernel.org 7620 - S: Maintained 7621 - F: drivers/ata/sata_promise.* 7622 - 7623 7581 PS3 NETWORK SUPPORT 7624 7582 M: Geoff Levand <geoff@infradead.org> 7625 7583 L: netdev@vger.kernel.org ··· 8586 8556 S: Maintained 8587 8557 F: drivers/misc/phantom.c 8588 8558 F: include/uapi/linux/phantom.h 8589 - 8590 - SERIAL ATA (SATA) SUBSYSTEM 8591 - M: Tejun Heo <tj@kernel.org> 8592 - L: linux-ide@vger.kernel.org 8593 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git 8594 - S: Supported 8595 - F: drivers/ata/ 8596 - F: include/linux/ata.h 8597 - F: include/linux/libata.h 8598 - 8599 - SERIAL ATA AHCI PLATFORM devices support 8600 - M: Hans de Goede <hdegoede@redhat.com> 8601 - M: Tejun Heo <tj@kernel.org> 8602 - L: linux-ide@vger.kernel.org 8603 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git 8604 - S: Supported 8605 - F: drivers/ata/ahci_platform.c 8606 - F: drivers/ata/libahci_platform.c 8607 - F: include/linux/ahci_platform.h 8608 8559 8609 8560 SERVER ENGINES 10Gbps iSCSI - BladeEngine 2 DRIVER 8610 8561 M: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
+1
drivers/ata/Kconfig
··· 835 835 config PATA_AT91 836 836 tristate "PATA support for AT91SAM9260" 837 837 depends on ARM && SOC_AT91SAM9 838 + depends on !ARCH_MULTIPLATFORM 838 839 help 839 840 This option enables support for IDE devices on the Atmel AT91SAM9260 SoC. 840 841
-1
drivers/ata/ahci.c
··· 325 325 { PCI_VDEVICE(INTEL, 0x9d05), board_ahci }, /* Sunrise Point-LP RAID */ 326 326 { PCI_VDEVICE(INTEL, 0x9d07), board_ahci }, /* Sunrise Point-LP RAID */ 327 327 { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H AHCI */ 328 - { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H RAID */ 329 328 { PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */ 330 329 { PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise Point-H RAID */ 331 330 { PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */
+8 -6
drivers/ata/ahci_xgene.c
··· 125 125 * xgene_ahci_qc_issue - Issue commands to the device 126 126 * @qc: Command to issue 127 127 * 128 - * Due to Hardware errata for IDENTIFY DEVICE command, the controller cannot 129 - * clear the BSY bit after receiving the PIO setup FIS. This results in the dma 130 - * state machine goes into the CMFatalErrorUpdate state and locks up. By 131 - * restarting the dma engine, it removes the controller out of lock up state. 128 + * Due to Hardware errata for IDENTIFY DEVICE command and PACKET 129 + * command of ATAPI protocol set, the controller cannot clear the BSY bit 130 + * after receiving the PIO setup FIS. This results in the DMA state machine 131 + * going into the CMFatalErrorUpdate state and locks up. By restarting the 132 + * DMA engine, it removes the controller out of lock up state. 132 133 */ 133 134 static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc) 134 135 { ··· 138 137 struct xgene_ahci_context *ctx = hpriv->plat_data; 139 138 int rc = 0; 140 139 141 - if (unlikely(ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA)) 140 + if (unlikely((ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA) || 141 + (ctx->last_cmd[ap->port_no] == ATA_CMD_PACKET))) 142 142 xgene_ahci_restart_engine(ap); 143 143 144 144 rc = ahci_qc_issue(qc); ··· 190 188 * 191 189 * Clear reserved bit 8 (DEVSLP bit) as we don't support DEVSLP 192 190 */ 193 - id[ATA_ID_FEATURE_SUPP] &= ~(1 << 8); 191 + id[ATA_ID_FEATURE_SUPP] &= cpu_to_le16(~(1 << 8)); 194 192 195 193 return 0; 196 194 }
+1 -1
drivers/ata/libahci.c
··· 2003 2003 2004 2004 devslp = readl(port_mmio + PORT_DEVSLP); 2005 2005 if (!(devslp & PORT_DEVSLP_DSP)) { 2006 - dev_err(ap->host->dev, "port does not support device sleep\n"); 2006 + dev_info(ap->host->dev, "port does not support device sleep\n"); 2007 2007 return; 2008 2008 } 2009 2009
+31 -5
drivers/ata/libata-core.c
··· 4233 4233 { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, 4234 4234 4235 4235 /* devices that don't properly handle queued TRIM commands */ 4236 - { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4237 - { "Crucial_CT???M500SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4238 - { "Micron_M550*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4239 - { "Crucial_CT*M550SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4236 + { "Micron_M[56]*", NULL, ATA_HORKAGE_NO_NCQ_TRIM | 4237 + ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4238 + { "Crucial_CT*SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4239 + 4240 + /* 4241 + * As defined, the DRAT (Deterministic Read After Trim) and RZAT 4242 + * (Return Zero After Trim) flags in the ATA Command Set are 4243 + * unreliable in the sense that they only define what happens if 4244 + * the device successfully executed the DSM TRIM command. TRIM 4245 + * is only advisory, however, and the device is free to silently 4246 + * ignore all or parts of the request. 4247 + * 4248 + * Whitelist drives that are known to reliably return zeroes 4249 + * after TRIM. 4250 + */ 4251 + 4252 + /* 4253 + * The intel 510 drive has buggy DRAT/RZAT. Explicitly exclude 4254 + * that model before whitelisting all other intel SSDs. 4255 + */ 4256 + { "INTEL*SSDSC2MH*", NULL, 0, }, 4257 + 4258 + { "INTEL*SSD*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4259 + { "SSD*INTEL*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4260 + { "Samsung*SSD*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4261 + { "SAMSUNG*SSD*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4262 + { "ST[1248][0248]0[FH]*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, }, 4240 4263 4241 4264 /* 4242 4265 * Some WD SATA-I drives spin up and down erratically when the link ··· 4771 4748 return NULL; 4772 4749 4773 4750 for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) { 4774 - tag = tag < max_queue ? tag : 0; 4751 + if (ap->flags & ATA_FLAG_LOWTAG) 4752 + tag = i; 4753 + else 4754 + tag = tag < max_queue ? tag : 0; 4775 4755 4776 4756 /* the last tag is reserved for internal command. */ 4777 4757 if (tag == ATA_TAG_INTERNAL)
+1
drivers/ata/libata-eh.c
··· 2389 2389 2390 2390 return NULL; 2391 2391 } 2392 + EXPORT_SYMBOL_GPL(ata_get_cmd_descript); 2392 2393 2393 2394 /** 2394 2395 * ata_eh_link_report - report error handling to user
+6 -4
drivers/ata/libata-scsi.c
··· 2532 2532 rbuf[15] = lowest_aligned; 2533 2533 2534 2534 if (ata_id_has_trim(args->id)) { 2535 - rbuf[14] |= 0x80; /* TPE */ 2535 + rbuf[14] |= 0x80; /* LBPME */ 2536 2536 2537 - if (ata_id_has_zero_after_trim(args->id)) 2538 - rbuf[14] |= 0x40; /* TPRZ */ 2537 + if (ata_id_has_zero_after_trim(args->id) && 2538 + dev->horkage & ATA_HORKAGE_ZERO_AFTER_TRIM) { 2539 + ata_dev_info(dev, "Enabling discard_zeroes_data\n"); 2540 + rbuf[14] |= 0x40; /* LBPRZ */ 2541 + } 2539 2542 } 2540 2543 } 2541 - 2542 2544 return 0; 2543 2545 } 2544 2546
+12
drivers/ata/libata-sff.c
··· 1333 1333 DPRINTK("ENTER\n"); 1334 1334 1335 1335 cancel_delayed_work_sync(&ap->sff_pio_task); 1336 + 1337 + /* 1338 + * We wanna reset the HSM state to IDLE. If we do so without 1339 + * grabbing the port lock, critical sections protected by it which 1340 + * expect the HSM state to stay stable may get surprised. For 1341 + * example, we may set IDLE in between the time 1342 + * __ata_sff_port_intr() checks for HSM_ST_IDLE and before it calls 1343 + * ata_sff_hsm_move() causing ata_sff_hsm_move() to BUG(). 1344 + */ 1345 + spin_lock_irq(ap->lock); 1336 1346 ap->hsm_task_state = HSM_ST_IDLE; 1347 + spin_unlock_irq(ap->lock); 1348 + 1337 1349 ap->sff_pio_task_link = NULL; 1338 1350 1339 1351 if (ata_msg_ctl(ap))
+12 -14
drivers/ata/sata_dwc_460ex.c
··· 797 797 if (err) { 798 798 dev_err(host_pvt.dwc_dev, "%s: dma_request_interrupts returns" 799 799 " %d\n", __func__, err); 800 - goto error_out; 800 + return err; 801 801 } 802 802 803 803 /* Enabe DMA */ ··· 808 808 sata_dma_regs); 809 809 810 810 return 0; 811 - 812 - error_out: 813 - dma_dwc_exit(hsdev); 814 - 815 - return err; 816 811 } 817 812 818 813 static int sata_dwc_scr_read(struct ata_link *link, unsigned int scr, u32 *val) ··· 1657 1662 char *ver = (char *)&versionr; 1658 1663 u8 *base = NULL; 1659 1664 int err = 0; 1660 - int irq, rc; 1665 + int irq; 1661 1666 struct ata_host *host; 1662 1667 struct ata_port_info pi = sata_dwc_port_info[0]; 1663 1668 const struct ata_port_info *ppi[] = { &pi, NULL }; ··· 1720 1725 if (irq == NO_IRQ) { 1721 1726 dev_err(&ofdev->dev, "no SATA DMA irq\n"); 1722 1727 err = -ENODEV; 1723 - goto error_out; 1728 + goto error_iomap; 1724 1729 } 1725 1730 1726 1731 /* Get physical SATA DMA register base address */ ··· 1729 1734 dev_err(&ofdev->dev, "ioremap failed for AHBDMA register" 1730 1735 " address\n"); 1731 1736 err = -ENODEV; 1732 - goto error_out; 1737 + goto error_iomap; 1733 1738 } 1734 1739 1735 1740 /* Save dev for later use in dev_xxx() routines */ 1736 1741 host_pvt.dwc_dev = &ofdev->dev; 1737 1742 1738 1743 /* Initialize AHB DMAC */ 1739 - dma_dwc_init(hsdev, irq); 1744 + err = dma_dwc_init(hsdev, irq); 1745 + if (err) 1746 + goto error_dma_iomap; 1740 1747 1741 1748 /* Enable SATA Interrupts */ 1742 1749 sata_dwc_enable_interrupts(hsdev); ··· 1756 1759 * device discovery process, invoking our port_start() handler & 1757 1760 * error_handler() to execute a dummy Softreset EH session 1758 1761 */ 1759 - rc = ata_host_activate(host, irq, sata_dwc_isr, 0, &sata_dwc_sht); 1760 - 1761 - if (rc != 0) 1762 + err = ata_host_activate(host, irq, sata_dwc_isr, 0, &sata_dwc_sht); 1763 + if (err) 1762 1764 dev_err(&ofdev->dev, "failed to activate host"); 1763 1765 1764 1766 dev_set_drvdata(&ofdev->dev, host); ··· 1766 1770 error_out: 1767 1771 /* Free SATA DMA resources */ 1768 1772 dma_dwc_exit(hsdev); 1769 - 1773 + error_dma_iomap: 1774 + iounmap((void __iomem *)host_pvt.sata_dma_regs); 1770 1775 error_iomap: 1771 1776 iounmap(base); 1772 1777 error_kmalloc: ··· 1788 1791 /* Free SATA DMA resources */ 1789 1792 dma_dwc_exit(hsdev); 1790 1793 1794 + iounmap((void __iomem *)host_pvt.sata_dma_regs); 1791 1795 iounmap(hsdev->reg_base); 1792 1796 kfree(hsdev); 1793 1797 kfree(host);
+1 -1
drivers/ata/sata_sil24.c
··· 246 246 /* host flags */ 247 247 SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA | 248 248 ATA_FLAG_NCQ | ATA_FLAG_ACPI_SATA | 249 - ATA_FLAG_AN | ATA_FLAG_PMP, 249 + ATA_FLAG_AN | ATA_FLAG_PMP | ATA_FLAG_LOWTAG, 250 250 SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ 251 251 252 252 IRQ_STAT_4PORTS = 0xf,
+2
include/linux/libata.h
··· 231 231 ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity 232 232 * led */ 233 233 ATA_FLAG_NO_DIPM = (1 << 23), /* host not happy with DIPM */ 234 + ATA_FLAG_LOWTAG = (1 << 24), /* host wants lowest available tag */ 234 235 235 236 /* bits 24:31 of ap->flags are reserved for LLD specific flags */ 236 237 ··· 423 422 ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */ 424 423 ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */ 425 424 ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */ 425 + ATA_HORKAGE_ZERO_AFTER_TRIM = (1 << 22),/* guarantees zero after trim */ 426 426 427 427 /* DMA mask for user DMA control: User visible values; DO NOT 428 428 renumber */