diff options
| -rw-r--r-- | drivers/ata/Kconfig | 1 | ||||
| -rw-r--r-- | drivers/ata/ahci.c | 1 | ||||
| -rw-r--r-- | drivers/ata/ahci_xgene.c | 3 | ||||
| -rw-r--r-- | drivers/ata/libahci.c | 2 | ||||
| -rw-r--r-- | drivers/ata/libata-core.c | 36 | ||||
| -rw-r--r-- | drivers/ata/libata-scsi.c | 10 | ||||
| -rw-r--r-- | drivers/ata/libata-sff.c | 12 | ||||
| -rw-r--r-- | drivers/ata/sata_sil24.c | 2 | ||||
| -rw-r--r-- | include/linux/libata.h | 2 |
9 files changed, 56 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 | |||
| 835 | config PATA_AT91 | 835 | config 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, |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 11beb4196c32..61df823ac86a 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -231,6 +231,7 @@ enum { | |||
| 231 | ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity | 231 | ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity |
| 232 | * led */ | 232 | * led */ |
| 233 | ATA_FLAG_NO_DIPM = (1 << 23), /* host not happy with DIPM */ | 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 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ | 236 | /* bits 24:31 of ap->flags are reserved for LLD specific flags */ |
| 236 | 237 | ||
| @@ -422,6 +423,7 @@ enum { | |||
| 422 | ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */ | 423 | ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */ |
| 423 | ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */ | 424 | ATA_HORKAGE_NOLPM = (1 << 20), /* don't use LPM */ |
| 424 | ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */ | 425 | ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21), /* some WDs have broken LPM */ |
| 426 | ATA_HORKAGE_ZERO_AFTER_TRIM = (1 << 22),/* guarantees zero after trim */ | ||
| 425 | 427 | ||
| 426 | /* DMA mask for user DMA control: User visible values; DO NOT | 428 | /* DMA mask for user DMA control: User visible values; DO NOT |
| 427 | renumber */ | 429 | renumber */ |
