aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2014-01-16 09:44:34 -0500
committerTejun Heo <tj@kernel.org>2014-01-16 09:44:34 -0500
commit6e1af69780a4df749d28a129596ed576a0d7996c (patch)
tree67f0dee7b39c006dc305d7273db8222633603abf /drivers/ata
parenta96cc303e42ad7830dde929aad0046e448a05505 (diff)
parent55c82a6c2a513de1d8a20c3b3a769129a1a14d50 (diff)
Merge branch 'for-3.13-fixes' into for-3.14
A scheduled horkage patch will conflict with HORKAGE changes in for-3.13-fixes. Pull in to avoid unnecessary merge conflicts. Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/ahci.c21
-rw-r--r--drivers/ata/libata-core.c16
-rw-r--r--drivers/ata/libata-scsi.c21
-rw-r--r--drivers/ata/sata_sis.c4
4 files changed, 51 insertions, 11 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index ea5b5a33a8b8..74911c2cb1dd 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -429,6 +429,9 @@ static const struct pci_device_id ahci_pci_tbl[] = {
429 .driver_data = board_ahci_yes_fbs }, /* 88se9128 */ 429 .driver_data = board_ahci_yes_fbs }, /* 88se9128 */
430 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9125), 430 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9125),
431 .driver_data = board_ahci_yes_fbs }, /* 88se9125 */ 431 .driver_data = board_ahci_yes_fbs }, /* 88se9125 */
432 { PCI_DEVICE_SUB(PCI_VENDOR_ID_MARVELL_EXT, 0x9178,
433 PCI_VENDOR_ID_MARVELL_EXT, 0x9170),
434 .driver_data = board_ahci_yes_fbs }, /* 88se9170 */
432 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x917a), 435 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x917a),
433 .driver_data = board_ahci_yes_fbs }, /* 88se9172 */ 436 .driver_data = board_ahci_yes_fbs }, /* 88se9172 */
434 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9172), 437 { PCI_DEVICE(PCI_VENDOR_ID_MARVELL_EXT, 0x9172),
@@ -1280,15 +1283,6 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1280 if (rc) 1283 if (rc)
1281 return rc; 1284 return rc;
1282 1285
1283 /* AHCI controllers often implement SFF compatible interface.
1284 * Grab all PCI BARs just in case.
1285 */
1286 rc = pcim_iomap_regions_request_all(pdev, 1 << ahci_pci_bar, DRV_NAME);
1287 if (rc == -EBUSY)
1288 pcim_pin_device(pdev);
1289 if (rc)
1290 return rc;
1291
1292 if (pdev->vendor == PCI_VENDOR_ID_INTEL && 1286 if (pdev->vendor == PCI_VENDOR_ID_INTEL &&
1293 (pdev->device == 0x2652 || pdev->device == 0x2653)) { 1287 (pdev->device == 0x2652 || pdev->device == 0x2653)) {
1294 u8 map; 1288 u8 map;
@@ -1305,6 +1299,15 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1305 } 1299 }
1306 } 1300 }
1307 1301
1302 /* AHCI controllers often implement SFF compatible interface.
1303 * Grab all PCI BARs just in case.
1304 */
1305 rc = pcim_iomap_regions_request_all(pdev, 1 << ahci_pci_bar, DRV_NAME);
1306 if (rc == -EBUSY)
1307 pcim_pin_device(pdev);
1308 if (rc)
1309 return rc;
1310
1308 hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL); 1311 hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
1309 if (!hpriv) 1312 if (!hpriv)
1310 return -ENOMEM; 1313 return -ENOMEM;
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index dae73efe5dbf..1393a5890ed5 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -2149,9 +2149,16 @@ static int ata_dev_config_ncq(struct ata_device *dev,
2149 "failed to get NCQ Send/Recv Log Emask 0x%x\n", 2149 "failed to get NCQ Send/Recv Log Emask 0x%x\n",
2150 err_mask); 2150 err_mask);
2151 } else { 2151 } else {
2152 u8 *cmds = dev->ncq_send_recv_cmds;
2153
2152 dev->flags |= ATA_DFLAG_NCQ_SEND_RECV; 2154 dev->flags |= ATA_DFLAG_NCQ_SEND_RECV;
2153 memcpy(dev->ncq_send_recv_cmds, ap->sector_buf, 2155 memcpy(cmds, ap->sector_buf, ATA_LOG_NCQ_SEND_RECV_SIZE);
2154 ATA_LOG_NCQ_SEND_RECV_SIZE); 2156
2157 if (dev->horkage & ATA_HORKAGE_NO_NCQ_TRIM) {
2158 ata_dev_dbg(dev, "disabling queued TRIM support\n");
2159 cmds[ATA_LOG_NCQ_SEND_RECV_DSM_OFFSET] &=
2160 ~ATA_LOG_NCQ_SEND_RECV_DSM_TRIM;
2161 }
2155 } 2162 }
2156 } 2163 }
2157 2164
@@ -4205,6 +4212,10 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
4205 { "PIONEER DVD-RW DVR-212D", NULL, ATA_HORKAGE_NOSETXFER }, 4212 { "PIONEER DVD-RW DVR-212D", NULL, ATA_HORKAGE_NOSETXFER },
4206 { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, 4213 { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER },
4207 4214
4215 /* devices that don't properly handle queued TRIM commands */
4216 { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
4217 { "Crucial_CT???M500SSD1", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
4218
4208 /* End Marker */ 4219 /* End Marker */
4209 { } 4220 { }
4210}; 4221};
@@ -6522,6 +6533,7 @@ static int __init ata_parse_force_one(char **cur,
6522 { "norst", .lflags = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST }, 6533 { "norst", .lflags = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST },
6523 { "rstonce", .lflags = ATA_LFLAG_RST_ONCE }, 6534 { "rstonce", .lflags = ATA_LFLAG_RST_ONCE },
6524 { "atapi_dmadir", .horkage_on = ATA_HORKAGE_ATAPI_DMADIR }, 6535 { "atapi_dmadir", .horkage_on = ATA_HORKAGE_ATAPI_DMADIR },
6536 { "disable", .horkage_on = ATA_HORKAGE_DISABLE },
6525 }; 6537 };
6526 char *start = *cur, *p = *cur; 6538 char *start = *cur, *p = *cur;
6527 char *id, *val, *endp; 6539 char *id, *val, *endp;
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index db6dfcfa3e2e..176f62950e3d 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -3871,6 +3871,27 @@ void ata_scsi_hotplug(struct work_struct *work)
3871 return; 3871 return;
3872 } 3872 }
3873 3873
3874 /*
3875 * XXX - UGLY HACK
3876 *
3877 * The block layer suspend/resume path is fundamentally broken due
3878 * to freezable kthreads and workqueue and may deadlock if a block
3879 * device gets removed while resume is in progress. I don't know
3880 * what the solution is short of removing freezable kthreads and
3881 * workqueues altogether.
3882 *
3883 * The following is an ugly hack to avoid kicking off device
3884 * removal while freezer is active. This is a joke but does avoid
3885 * this particular deadlock scenario.
3886 *
3887 * https://bugzilla.kernel.org/show_bug.cgi?id=62801
3888 * http://marc.info/?l=linux-kernel&m=138695698516487
3889 */
3890#ifdef CONFIG_FREEZER
3891 while (pm_freezing)
3892 msleep(10);
3893#endif
3894
3874 DPRINTK("ENTER\n"); 3895 DPRINTK("ENTER\n");
3875 mutex_lock(&ap->scsi_scan_mutex); 3896 mutex_lock(&ap->scsi_scan_mutex);
3876 3897
diff --git a/drivers/ata/sata_sis.c b/drivers/ata/sata_sis.c
index fe3ca0989b14..1ad2f62d34b9 100644
--- a/drivers/ata/sata_sis.c
+++ b/drivers/ata/sata_sis.c
@@ -83,6 +83,10 @@ static struct pci_driver sis_pci_driver = {
83 .id_table = sis_pci_tbl, 83 .id_table = sis_pci_tbl,
84 .probe = sis_init_one, 84 .probe = sis_init_one,
85 .remove = ata_pci_remove_one, 85 .remove = ata_pci_remove_one,
86#ifdef CONFIG_PM
87 .suspend = ata_pci_device_suspend,
88 .resume = ata_pci_device_resume,
89#endif
86}; 90};
87 91
88static struct scsi_host_template sis_sht = { 92static struct scsi_host_template sis_sht = {