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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull libata fixes from Tejun Heo:
"There's one interseting commit - "libata, freezer: avoid block device
removal while system is frozen". It's an ugly hack working around a
deadlock condition between driver core resume and block layer device
removal paths through freezer which was made more reproducible by
writeback being converted to workqueue some releases ago. The bug has
nothing to do with libata but it's just an workaround which is easy to
backport. After discussion, Rafael and I seem to agree that we don't
really need kernel freezables - both kthread and workqueue. There are
few specific workqueues which constitute PM operations and require
freezing, which will be converted to use workqueue_set_max_active()
instead. All other kernel freezer uses are planned to be removed,
followed by the removal of kthread and workqueue freezer support,
hopefully.

Others are device-specific fixes. The most notable is the addition of
NO_NCQ_TRIM which is used to disable queued TRIM commands to Micro
M500 SSDs which otherwise suffers data corruption"

* 'for-3.13-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
libata, freezer: avoid block device removal while system is frozen
libata: implement ATA_HORKAGE_NO_NCQ_TRIM and apply it to Micro M500 SSDs
libata: disable a disk via libata.force params
ahci: bail out on ICH6 before using AHCI BAR
ahci: imx: Explicitly clear IMX6Q_GPR13_SATA_MPLL_CLK_EN
libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8

+58 -12
+2
Documentation/kernel-parameters.txt
··· 1529 1529 1530 1530 * atapi_dmadir: Enable ATAPI DMADIR bridge support 1531 1531 1532 + * disable: Disable this device. 1533 + 1532 1534 If there are multiple matching configurations changing 1533 1535 the same attribute, the last one is used. 1534 1536
+9 -9
drivers/ata/ahci.c
··· 1238 1238 if (rc) 1239 1239 return rc; 1240 1240 1241 - /* AHCI controllers often implement SFF compatible interface. 1242 - * Grab all PCI BARs just in case. 1243 - */ 1244 - rc = pcim_iomap_regions_request_all(pdev, 1 << ahci_pci_bar, DRV_NAME); 1245 - if (rc == -EBUSY) 1246 - pcim_pin_device(pdev); 1247 - if (rc) 1248 - return rc; 1249 - 1250 1241 if (pdev->vendor == PCI_VENDOR_ID_INTEL && 1251 1242 (pdev->device == 0x2652 || pdev->device == 0x2653)) { 1252 1243 u8 map; ··· 1253 1262 return -ENODEV; 1254 1263 } 1255 1264 } 1265 + 1266 + /* AHCI controllers often implement SFF compatible interface. 1267 + * Grab all PCI BARs just in case. 1268 + */ 1269 + rc = pcim_iomap_regions_request_all(pdev, 1 << ahci_pci_bar, DRV_NAME); 1270 + if (rc == -EBUSY) 1271 + pcim_pin_device(pdev); 1272 + if (rc) 1273 + return rc; 1256 1274 1257 1275 hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL); 1258 1276 if (!hpriv)
+2 -1
drivers/ata/ahci_imx.c
··· 113 113 /* 114 114 * set PHY Paremeters, two steps to configure the GPR13, 115 115 * one write for rest of parameters, mask of first write 116 - * is 0x07fffffd, and the other one write for setting 116 + * is 0x07ffffff, and the other one write for setting 117 117 * the mpll_clk_en. 118 118 */ 119 119 regmap_update_bits(imxpriv->gpr, 0x34, IMX6Q_GPR13_SATA_RX_EQ_VAL_MASK ··· 124 124 | IMX6Q_GPR13_SATA_TX_ATTEN_MASK 125 125 | IMX6Q_GPR13_SATA_TX_BOOST_MASK 126 126 | IMX6Q_GPR13_SATA_TX_LVL_MASK 127 + | IMX6Q_GPR13_SATA_MPLL_CLK_EN 127 128 | IMX6Q_GPR13_SATA_TX_EDGE_RATE 128 129 , IMX6Q_GPR13_SATA_RX_EQ_VAL_3_0_DB 129 130 | IMX6Q_GPR13_SATA_RX_LOS_LVL_SATA2M
+17 -2
drivers/ata/libata-core.c
··· 2149 2149 "failed to get NCQ Send/Recv Log Emask 0x%x\n", 2150 2150 err_mask); 2151 2151 } else { 2152 + u8 *cmds = dev->ncq_send_recv_cmds; 2153 + 2152 2154 dev->flags |= ATA_DFLAG_NCQ_SEND_RECV; 2153 - memcpy(dev->ncq_send_recv_cmds, ap->sector_buf, 2154 - ATA_LOG_NCQ_SEND_RECV_SIZE); 2155 + memcpy(cmds, ap->sector_buf, 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 ··· 4163 4156 { "ST3320[68]13AS", "SD1[5-9]", ATA_HORKAGE_NONCQ | 4164 4157 ATA_HORKAGE_FIRMWARE_WARN }, 4165 4158 4159 + /* Seagate Momentus SpinPoint M8 seem to have FPMDA_AA issues */ 4160 + { "ST1000LM024 HN-M101MBB", "2AR10001", ATA_HORKAGE_BROKEN_FPDMA_AA }, 4161 + 4166 4162 /* Blacklist entries taken from Silicon Image 3124/3132 4167 4163 Windows driver .inf file - also several Linux problem reports */ 4168 4164 { "HTS541060G9SA00", "MB3OC60D", ATA_HORKAGE_NONCQ, }, ··· 4211 4201 { "PIONEER DVD-RW DVR-215", NULL, ATA_HORKAGE_NOSETXFER }, 4212 4202 { "PIONEER DVD-RW DVR-212D", NULL, ATA_HORKAGE_NOSETXFER }, 4213 4203 { "PIONEER DVD-RW DVR-216D", NULL, ATA_HORKAGE_NOSETXFER }, 4204 + 4205 + /* devices that don't properly handle queued TRIM commands */ 4206 + { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4207 + { "Crucial_CT???M500SSD1", NULL, ATA_HORKAGE_NO_NCQ_TRIM, }, 4214 4208 4215 4209 /* End Marker */ 4216 4210 { } ··· 6533 6519 { "norst", .lflags = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST }, 6534 6520 { "rstonce", .lflags = ATA_LFLAG_RST_ONCE }, 6535 6521 { "atapi_dmadir", .horkage_on = ATA_HORKAGE_ATAPI_DMADIR }, 6522 + { "disable", .horkage_on = ATA_HORKAGE_DISABLE }, 6536 6523 }; 6537 6524 char *start = *cur, *p = *cur; 6538 6525 char *id, *val, *endp;
+21
drivers/ata/libata-scsi.c
··· 3872 3872 return; 3873 3873 } 3874 3874 3875 + /* 3876 + * XXX - UGLY HACK 3877 + * 3878 + * The block layer suspend/resume path is fundamentally broken due 3879 + * to freezable kthreads and workqueue and may deadlock if a block 3880 + * device gets removed while resume is in progress. I don't know 3881 + * what the solution is short of removing freezable kthreads and 3882 + * workqueues altogether. 3883 + * 3884 + * The following is an ugly hack to avoid kicking off device 3885 + * removal while freezer is active. This is a joke but does avoid 3886 + * this particular deadlock scenario. 3887 + * 3888 + * https://bugzilla.kernel.org/show_bug.cgi?id=62801 3889 + * http://marc.info/?l=linux-kernel&m=138695698516487 3890 + */ 3891 + #ifdef CONFIG_FREEZER 3892 + while (pm_freezing) 3893 + msleep(10); 3894 + #endif 3895 + 3875 3896 DPRINTK("ENTER\n"); 3876 3897 mutex_lock(&ap->scsi_scan_mutex); 3877 3898
+1
include/linux/libata.h
··· 418 418 ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */ 419 419 ATA_HORKAGE_MAX_SEC_LBA48 = (1 << 17), /* Set max sects to 65535 */ 420 420 ATA_HORKAGE_ATAPI_DMADIR = (1 << 18), /* device requires dmadir */ 421 + ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19), /* don't use queued TRIM */ 421 422 422 423 /* DMA mask for user DMA control: User visible values; DO NOT 423 424 renumber */
+6
kernel/freezer.c
··· 19 19 bool pm_freezing; 20 20 bool pm_nosig_freezing; 21 21 22 + /* 23 + * Temporary export for the deadlock workaround in ata_scsi_hotplug(). 24 + * Remove once the hack becomes unnecessary. 25 + */ 26 + EXPORT_SYMBOL_GPL(pm_freezing); 27 + 22 28 /* protects freezing and frozen transitions */ 23 29 static DEFINE_SPINLOCK(freezer_lock); 24 30