aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2015-01-27 19:59:56 -0500
committerDavid S. Miller <davem@davemloft.net>2015-01-27 19:59:56 -0500
commit95f873f2fff96c592c5d863e2a39825bd8bf0500 (patch)
tree0d2dd664964ba2c701aefea5b4d1e85b481045e1 /drivers/ata
parent8ea65f4a2dfaaf494ef42a16cbf2fea39b07450f (diff)
parent59343cd7c4809cf7598789e1cd14563780ae4239 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: arch/arm/boot/dts/imx6sx-sdb.dts net/sched/cls_bpf.c Two simple sets of overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/Kconfig1
-rw-r--r--drivers/ata/ahci.c1
-rw-r--r--drivers/ata/ahci_xgene.c14
-rw-r--r--drivers/ata/libahci.c2
-rw-r--r--drivers/ata/libata-core.c36
-rw-r--r--drivers/ata/libata-eh.c1
-rw-r--r--drivers/ata/libata-scsi.c10
-rw-r--r--drivers/ata/libata-sff.c12
-rw-r--r--drivers/ata/sata_dwc_460ex.c26
-rw-r--r--drivers/ata/sata_sil24.c2
10 files changed, 73 insertions, 32 deletions
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index a3a13605a9c4..5f601553b9b0 100644
--- a/drivers/ata/Kconfig
+++ b/drivers/ata/Kconfig
@@ -835,6 +835,7 @@ config PATA_AT32
835config PATA_AT91 835config PATA_AT91
836 tristate "PATA support for AT91SAM9260" 836 tristate "PATA support for AT91SAM9260"
837 depends on ARM && SOC_AT91SAM9 837 depends on ARM && SOC_AT91SAM9
838 depends on !ARCH_MULTIPLATFORM
838 help 839 help
839 This option enables support for IDE devices on the Atmel AT91SAM9260 SoC. 840 This option enables support for IDE devices on the Atmel AT91SAM9260 SoC.
840 841
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 49f1e6890587..33bb06e006c9 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -325,7 +325,6 @@ static const struct pci_device_id ahci_pci_tbl[] = {
325 { PCI_VDEVICE(INTEL, 0x9d05), board_ahci }, /* Sunrise Point-LP RAID */ 325 { PCI_VDEVICE(INTEL, 0x9d05), board_ahci }, /* Sunrise Point-LP RAID */
326 { PCI_VDEVICE(INTEL, 0x9d07), board_ahci }, /* Sunrise Point-LP RAID */ 326 { PCI_VDEVICE(INTEL, 0x9d07), board_ahci }, /* Sunrise Point-LP RAID */
327 { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H AHCI */ 327 { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H AHCI */
328 { PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H RAID */
329 { PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */ 328 { PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */
330 { PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise Point-H RAID */ 329 { PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise Point-H RAID */
331 { PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */ 330 { PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */
diff --git a/drivers/ata/ahci_xgene.c b/drivers/ata/ahci_xgene.c
index feeb8f1e2fe8..cbcd20810355 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -125,10 +125,11 @@ static int xgene_ahci_restart_engine(struct ata_port *ap)
125 * xgene_ahci_qc_issue - Issue commands to the device 125 * xgene_ahci_qc_issue - Issue commands to the device
126 * @qc: Command to issue 126 * @qc: Command to issue
127 * 127 *
128 * Due to Hardware errata for IDENTIFY DEVICE command, the controller cannot 128 * Due to Hardware errata for IDENTIFY DEVICE command and PACKET
129 * clear the BSY bit after receiving the PIO setup FIS. This results in the dma 129 * command of ATAPI protocol set, the controller cannot clear the BSY bit
130 * state machine goes into the CMFatalErrorUpdate state and locks up. By 130 * after receiving the PIO setup FIS. This results in the DMA state machine
131 * restarting the dma engine, it removes the controller out of lock up state. 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 */
133static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc) 134static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc)
134{ 135{
@@ -137,7 +138,8 @@ static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc)
137 struct xgene_ahci_context *ctx = hpriv->plat_data; 138 struct xgene_ahci_context *ctx = hpriv->plat_data;
138 int rc = 0; 139 int rc = 0;
139 140
140 if (unlikely(ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA)) 141 if (unlikely((ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA) ||
142 (ctx->last_cmd[ap->port_no] == ATA_CMD_PACKET)))
141 xgene_ahci_restart_engine(ap); 143 xgene_ahci_restart_engine(ap);
142 144
143 rc = ahci_qc_issue(qc); 145 rc = ahci_qc_issue(qc);
@@ -188,7 +190,7 @@ static unsigned int xgene_ahci_read_id(struct ata_device *dev,
188 * 190 *
189 * Clear reserved bit 8 (DEVSLP bit) as we don't support DEVSLP 191 * Clear reserved bit 8 (DEVSLP bit) as we don't support DEVSLP
190 */ 192 */
191 id[ATA_ID_FEATURE_SUPP] &= ~(1 << 8); 193 id[ATA_ID_FEATURE_SUPP] &= cpu_to_le16(~(1 << 8));
192 194
193 return 0; 195 return 0;
194} 196}
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index 97683e45ab04..61a9c07e0dff 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -2003,7 +2003,7 @@ static void ahci_set_aggressive_devslp(struct ata_port *ap, bool sleep)
2003 2003
2004 devslp = readl(port_mmio + PORT_DEVSLP); 2004 devslp = readl(port_mmio + PORT_DEVSLP);
2005 if (!(devslp & PORT_DEVSLP_DSP)) { 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 return; 2007 return;
2008 } 2008 }
2009 2009
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 5c84fb5c3372..d1a05f9bb91f 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4233,10 +4233,33 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
4233 { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, 4233 { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER },
4234 4234
4235 /* devices that don't properly handle queued TRIM commands */ 4235 /* devices that don't properly handle queued TRIM commands */
4236 { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4236 { "Micron_M[56]*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
4237 { "Crucial_CT???M500SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4237 ATA_HORKAGE_ZERO_AFTER_TRIM, },
4238 { "Micron_M550*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4238 { "Crucial_CT*SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
4239 { "Crucial_CT*M550SSD*", 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 * Some WD SATA-I drives spin up and down erratically when the link 4265 * Some WD SATA-I drives spin up and down erratically when the link
@@ -4748,7 +4771,10 @@ static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
4748 return NULL; 4771 return NULL;
4749 4772
4750 for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) { 4773 for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) {
4751 tag = tag < max_queue ? tag : 0; 4774 if (ap->flags & ATA_FLAG_LOWTAG)
4775 tag = i;
4776 else
4777 tag = tag < max_queue ? tag : 0;
4752 4778
4753 /* the last tag is reserved for internal command. */ 4779 /* the last tag is reserved for internal command. */
4754 if (tag == ATA_TAG_INTERNAL) 4780 if (tag == ATA_TAG_INTERNAL)
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 3dbec8954c86..8d00c2638bed 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -2389,6 +2389,7 @@ const char *ata_get_cmd_descript(u8 command)
2389 2389
2390 return NULL; 2390 return NULL;
2391} 2391}
2392EXPORT_SYMBOL_GPL(ata_get_cmd_descript);
2392 2393
2393/** 2394/**
2394 * ata_eh_link_report - report error handling to user 2395 * ata_eh_link_report - report error handling to user
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index e364e86e84d7..6abd17a85b13 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -2532,13 +2532,15 @@ static unsigned int ata_scsiop_read_cap(struct ata_scsi_args *args, u8 *rbuf)
2532 rbuf[15] = lowest_aligned; 2532 rbuf[15] = lowest_aligned;
2533 2533
2534 if (ata_id_has_trim(args->id)) { 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)) 2537 if (ata_id_has_zero_after_trim(args->id) &&
2538 rbuf[14] |= 0x40; /* TPRZ */ 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 return 0; 2544 return 0;
2543} 2545}
2544 2546
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c
index db90aa35cb71..2e86e3b85266 100644
--- a/drivers/ata/libata-sff.c
+++ b/drivers/ata/libata-sff.c
@@ -1333,7 +1333,19 @@ void ata_sff_flush_pio_task(struct ata_port *ap)
1333 DPRINTK("ENTER\n"); 1333 DPRINTK("ENTER\n");
1334 1334
1335 cancel_delayed_work_sync(&ap->sff_pio_task); 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 ap->hsm_task_state = HSM_ST_IDLE; 1346 ap->hsm_task_state = HSM_ST_IDLE;
1347 spin_unlock_irq(ap->lock);
1348
1337 ap->sff_pio_task_link = NULL; 1349 ap->sff_pio_task_link = NULL;
1338 1350
1339 if (ata_msg_ctl(ap)) 1351 if (ata_msg_ctl(ap))
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c
index c7ddef89e7b0..8e8248179d20 100644
--- a/drivers/ata/sata_dwc_460ex.c
+++ b/drivers/ata/sata_dwc_460ex.c
@@ -797,7 +797,7 @@ static int dma_dwc_init(struct sata_dwc_device *hsdev, int irq)
797 if (err) { 797 if (err) {
798 dev_err(host_pvt.dwc_dev, "%s: dma_request_interrupts returns" 798 dev_err(host_pvt.dwc_dev, "%s: dma_request_interrupts returns"
799 " %d\n", __func__, err); 799 " %d\n", __func__, err);
800 goto error_out; 800 return err;
801 } 801 }
802 802
803 /* Enabe DMA */ 803 /* Enabe DMA */
@@ -808,11 +808,6 @@ static int dma_dwc_init(struct sata_dwc_device *hsdev, int irq)
808 sata_dma_regs); 808 sata_dma_regs);
809 809
810 return 0; 810 return 0;
811
812error_out:
813 dma_dwc_exit(hsdev);
814
815 return err;
816} 811}
817 812
818static int sata_dwc_scr_read(struct ata_link *link, unsigned int scr, u32 *val) 813static int sata_dwc_scr_read(struct ata_link *link, unsigned int scr, u32 *val)
@@ -1662,7 +1657,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)
1662 char *ver = (char *)&versionr; 1657 char *ver = (char *)&versionr;
1663 u8 *base = NULL; 1658 u8 *base = NULL;
1664 int err = 0; 1659 int err = 0;
1665 int irq, rc; 1660 int irq;
1666 struct ata_host *host; 1661 struct ata_host *host;
1667 struct ata_port_info pi = sata_dwc_port_info[0]; 1662 struct ata_port_info pi = sata_dwc_port_info[0];
1668 const struct ata_port_info *ppi[] = { &pi, NULL }; 1663 const struct ata_port_info *ppi[] = { &pi, NULL };
@@ -1725,7 +1720,7 @@ static int sata_dwc_probe(struct platform_device *ofdev)
1725 if (irq == NO_IRQ) { 1720 if (irq == NO_IRQ) {
1726 dev_err(&ofdev->dev, "no SATA DMA irq\n"); 1721 dev_err(&ofdev->dev, "no SATA DMA irq\n");
1727 err = -ENODEV; 1722 err = -ENODEV;
1728 goto error_out; 1723 goto error_iomap;
1729 } 1724 }
1730 1725
1731 /* Get physical SATA DMA register base address */ 1726 /* Get physical SATA DMA register base address */
@@ -1734,14 +1729,16 @@ static int sata_dwc_probe(struct platform_device *ofdev)
1734 dev_err(&ofdev->dev, "ioremap failed for AHBDMA register" 1729 dev_err(&ofdev->dev, "ioremap failed for AHBDMA register"
1735 " address\n"); 1730 " address\n");
1736 err = -ENODEV; 1731 err = -ENODEV;
1737 goto error_out; 1732 goto error_iomap;
1738 } 1733 }
1739 1734
1740 /* Save dev for later use in dev_xxx() routines */ 1735 /* Save dev for later use in dev_xxx() routines */
1741 host_pvt.dwc_dev = &ofdev->dev; 1736 host_pvt.dwc_dev = &ofdev->dev;
1742 1737
1743 /* Initialize AHB DMAC */ 1738 /* Initialize AHB DMAC */
1744 dma_dwc_init(hsdev, irq); 1739 err = dma_dwc_init(hsdev, irq);
1740 if (err)
1741 goto error_dma_iomap;
1745 1742
1746 /* Enable SATA Interrupts */ 1743 /* Enable SATA Interrupts */
1747 sata_dwc_enable_interrupts(hsdev); 1744 sata_dwc_enable_interrupts(hsdev);
@@ -1759,9 +1756,8 @@ static int sata_dwc_probe(struct platform_device *ofdev)
1759 * device discovery process, invoking our port_start() handler & 1756 * device discovery process, invoking our port_start() handler &
1760 * error_handler() to execute a dummy Softreset EH session 1757 * error_handler() to execute a dummy Softreset EH session
1761 */ 1758 */
1762 rc = ata_host_activate(host, irq, sata_dwc_isr, 0, &sata_dwc_sht); 1759 err = ata_host_activate(host, irq, sata_dwc_isr, 0, &sata_dwc_sht);
1763 1760 if (err)
1764 if (rc != 0)
1765 dev_err(&ofdev->dev, "failed to activate host"); 1761 dev_err(&ofdev->dev, "failed to activate host");
1766 1762
1767 dev_set_drvdata(&ofdev->dev, host); 1763 dev_set_drvdata(&ofdev->dev, host);
@@ -1770,7 +1766,8 @@ static int sata_dwc_probe(struct platform_device *ofdev)
1770error_out: 1766error_out:
1771 /* Free SATA DMA resources */ 1767 /* Free SATA DMA resources */
1772 dma_dwc_exit(hsdev); 1768 dma_dwc_exit(hsdev);
1773 1769error_dma_iomap:
1770 iounmap((void __iomem *)host_pvt.sata_dma_regs);
1774error_iomap: 1771error_iomap:
1775 iounmap(base); 1772 iounmap(base);
1776error_kmalloc: 1773error_kmalloc:
@@ -1791,6 +1788,7 @@ static int sata_dwc_remove(struct platform_device *ofdev)
1791 /* Free SATA DMA resources */ 1788 /* Free SATA DMA resources */
1792 dma_dwc_exit(hsdev); 1789 dma_dwc_exit(hsdev);
1793 1790
1791 iounmap((void __iomem *)host_pvt.sata_dma_regs);
1794 iounmap(hsdev->reg_base); 1792 iounmap(hsdev->reg_base);
1795 kfree(hsdev); 1793 kfree(hsdev);
1796 kfree(host); 1794 kfree(host);
diff --git a/drivers/ata/sata_sil24.c b/drivers/ata/sata_sil24.c
index d81b20ddb527..ea655949023f 100644
--- a/drivers/ata/sata_sil24.c
+++ b/drivers/ata/sata_sil24.c
@@ -246,7 +246,7 @@ enum {
246 /* host flags */ 246 /* host flags */
247 SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA | 247 SIL24_COMMON_FLAGS = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA |
248 ATA_FLAG_NCQ | ATA_FLAG_ACPI_SATA | 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 SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */ 250 SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */
251 251
252 IRQ_STAT_4PORTS = 0xf, 252 IRQ_STAT_4PORTS = 0xf,