aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2015-02-09 07:54:41 -0500
committerTejun Heo <tj@kernel.org>2015-02-09 07:54:41 -0500
commitb12aa1f25e1da7e23fa44f646ac46e41366cfc6c (patch)
tree465be1cfceaa37861f5629821e1be2559ba39cfb /drivers/ata
parentf627cfdeb7d07df7d7ad2e6ebe59f25d8af4212e (diff)
parent09c32aaa3683cbcb6c2787a42f87630dff37d2a5 (diff)
Merge branch 'for-3.19-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata into for-3.20
09c32aaa3683 ("ahci_xgene: Fix the dma state machine lockup for the ATA_CMD_SMART PIO mode command.") missed 3.19 release. Fold it into for-3.20. Signed-off-by: Tejun Heo <tj@kernel.org>
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.c3
-rw-r--r--drivers/ata/libahci.c2
-rw-r--r--drivers/ata/libata-core.c36
-rw-r--r--drivers/ata/libata-scsi.c10
-rw-r--r--drivers/ata/libata-sff.c12
-rw-r--r--drivers/ata/sata_sil24.c2
8 files changed, 54 insertions, 13 deletions
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
index 9f2ba27388b6..e7f338a3a3c2 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 e3b8750e8e9d..2e8bb603e447 100644
--- a/drivers/ata/ahci_xgene.c
+++ b/drivers/ata/ahci_xgene.c
@@ -213,7 +213,8 @@ static unsigned int xgene_ahci_qc_issue(struct ata_queued_cmd *qc)
213 } 213 }
214 214
215 if (unlikely((ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA) || 215 if (unlikely((ctx->last_cmd[ap->port_no] == ATA_CMD_ID_ATA) ||
216 (ctx->last_cmd[ap->port_no] == ATA_CMD_PACKET))) 216 (ctx->last_cmd[ap->port_no] == ATA_CMD_PACKET) ||
217 (ctx->last_cmd[ap->port_no] == ATA_CMD_SMART)))
217 xgene_ahci_restart_engine(ap); 218 xgene_ahci_restart_engine(ap);
218 219
219 rc = ahci_qc_issue(qc); 220 rc = ahci_qc_issue(qc);
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 7cbcafa30550..4b0d5e71858e 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4206,10 +4206,33 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
4206 { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, 4206 { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER },
4207 4207
4208 /* devices that don't properly handle queued TRIM commands */ 4208 /* devices that don't properly handle queued TRIM commands */
4209 { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4209 { "Micron_M[56]*", NULL, ATA_HORKAGE_NO_NCQ_TRIM |
4210 { "Crucial_CT???M500SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4210 ATA_HORKAGE_ZERO_AFTER_TRIM, },
4211 { "Micron_M550*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4211 { "Crucial_CT*SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
4212 { "Crucial_CT*M550SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4212
4213 /*
4214 * As defined, the DRAT (Deterministic Read After Trim) and RZAT
4215 * (Return Zero After Trim) flags in the ATA Command Set are
4216 * unreliable in the sense that they only define what happens if
4217 * the device successfully executed the DSM TRIM command. TRIM
4218 * is only advisory, however, and the device is free to silently
4219 * ignore all or parts of the request.
4220 *
4221 * Whitelist drives that are known to reliably return zeroes
4222 * after TRIM.
4223 */
4224
4225 /*
4226 * The intel 510 drive has buggy DRAT/RZAT. Explicitly exclude
4227 * that model before whitelisting all other intel SSDs.
4228 */
4229 { "INTEL*SSDSC2MH*", NULL, 0, },
4230
4231 { "INTEL*SSD*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, },
4232 { "SSD*INTEL*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, },
4233 { "Samsung*SSD*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, },
4234 { "SAMSUNG*SSD*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, },
4235 { "ST[1248][0248]0[FH]*", NULL, ATA_HORKAGE_ZERO_AFTER_TRIM, },
4213 4236
4214 /* 4237 /*
4215 * Some WD SATA-I drives spin up and down erratically when the link 4238 * Some WD SATA-I drives spin up and down erratically when the link
@@ -4721,7 +4744,10 @@ static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
4721 return NULL; 4744 return NULL;
4722 4745
4723 for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) { 4746 for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) {
4724 tag = tag < max_queue ? tag : 0; 4747 if (ap->flags & ATA_FLAG_LOWTAG)
4748 tag = i;
4749 else
4750 tag = tag < max_queue ? tag : 0;
4725 4751
4726 /* the last tag is reserved for internal command. */ 4752 /* the last tag is reserved for internal command. */
4727 if (tag == ATA_TAG_INTERNAL) 4753 if (tag == ATA_TAG_INTERNAL)
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 7659d6468303..280729325ebd 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_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,