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-linus' of git://git.kernel.dk/linux-block

Pull block layer fixes from Jens Axboe:
"A couple of last minute fixes for regressions in this cycle. More
specifically:

- Two patches from Andy, adjusting the NVMe APST quirks to avoid some
issues specific to one Toshiba drive, and some variant of Samsung
on two specific Dell laptops.

- A fix for mtip32xx, turning off mq scheduling on that device. We
have a real fix for this, but it's too late in the cycle.
Thankfully we already have a NO_SCHED flag we can apply here. A
prep patch for this is ensuring that we honor the NO_SCHED flag
when attempting to online switch schedulers, previsouly we only did
so for drive load time. From Ming.

- Fixing an oops in blk-mq polling with scheduling attached. This one
is easily reproducible, it would be a shame to release 4.11 with
that issue. From me.

I'd prefer not having to send in patches at this point in time, but
the above are all things that have regressed in this cycle and the
fixes are relatively straight forward"

* 'for-linus' of git://git.kernel.dk/linux-block:
blk-mq: fix potential oops with polling and blk-mq scheduler
nvme: Quirk APST off on "THNSF5256GPUK TOSHIBA"
nvme: Adjust the Samsung APST quirk
mtip32xx: pass BLK_MQ_F_NO_SCHED
block: respect BLK_MQ_F_NO_SCHED

+66 -13
+10 -1
block/blk-mq.c
··· 2928 2928 hctx = q->queue_hw_ctx[blk_qc_t_to_queue_num(cookie)]; 2929 2929 if (!blk_qc_t_is_internal(cookie)) 2930 2930 rq = blk_mq_tag_to_rq(hctx->tags, blk_qc_t_to_tag(cookie)); 2931 - else 2931 + else { 2932 2932 rq = blk_mq_tag_to_rq(hctx->sched_tags, blk_qc_t_to_tag(cookie)); 2933 + /* 2934 + * With scheduling, if the request has completed, we'll 2935 + * get a NULL return here, as we clear the sched tag when 2936 + * that happens. The request still remains valid, like always, 2937 + * so we should be safe with just the NULL check. 2938 + */ 2939 + if (!rq) 2940 + return false; 2941 + } 2933 2942 2934 2943 return __blk_mq_poll(hctx, rq); 2935 2944 }
+10 -2
block/elevator.c
··· 1098 1098 } 1099 1099 EXPORT_SYMBOL(elevator_change); 1100 1100 1101 + static inline bool elv_support_iosched(struct request_queue *q) 1102 + { 1103 + if (q->mq_ops && q->tag_set && (q->tag_set->flags & 1104 + BLK_MQ_F_NO_SCHED)) 1105 + return false; 1106 + return true; 1107 + } 1108 + 1101 1109 ssize_t elv_iosched_store(struct request_queue *q, const char *name, 1102 1110 size_t count) 1103 1111 { 1104 1112 int ret; 1105 1113 1106 - if (!(q->mq_ops || q->request_fn)) 1114 + if (!(q->mq_ops || q->request_fn) || !elv_support_iosched(q)) 1107 1115 return count; 1108 1116 1109 1117 ret = __elevator_change(q, name); ··· 1143 1135 len += sprintf(name+len, "[%s] ", elv->elevator_name); 1144 1136 continue; 1145 1137 } 1146 - if (__e->uses_mq && q->mq_ops) 1138 + if (__e->uses_mq && q->mq_ops && elv_support_iosched(q)) 1147 1139 len += sprintf(name+len, "%s ", __e->elevator_name); 1148 1140 else if (!__e->uses_mq && !q->mq_ops) 1149 1141 len += sprintf(name+len, "%s ", __e->elevator_name);
+1 -1
drivers/block/mtip32xx/mtip32xx.c
··· 3969 3969 dd->tags.reserved_tags = 1; 3970 3970 dd->tags.cmd_size = sizeof(struct mtip_cmd); 3971 3971 dd->tags.numa_node = dd->numa_node; 3972 - dd->tags.flags = BLK_MQ_F_SHOULD_MERGE; 3972 + dd->tags.flags = BLK_MQ_F_SHOULD_MERGE | BLK_MQ_F_NO_SCHED; 3973 3973 dd->tags.driver_data = dd; 3974 3974 dd->tags.timeout = MTIP_NCQ_CMD_TIMEOUT_MS; 3975 3975
+15 -8
drivers/nvme/host/core.c
··· 1316 1316 table->entries[state] = target; 1317 1317 1318 1318 /* 1319 + * Don't allow transitions to the deepest state 1320 + * if it's quirked off. 1321 + */ 1322 + if (state == ctrl->npss && 1323 + (ctrl->quirks & NVME_QUIRK_NO_DEEPEST_PS)) 1324 + continue; 1325 + 1326 + /* 1319 1327 * Is this state a useful non-operational state for 1320 1328 * higher-power states to autonomously transition to? 1321 1329 */ ··· 1395 1387 }; 1396 1388 1397 1389 static const struct nvme_core_quirk_entry core_quirks[] = { 1398 - /* 1399 - * Seen on a Samsung "SM951 NVMe SAMSUNG 256GB": using APST causes 1400 - * the controller to go out to lunch. It dies when the watchdog 1401 - * timer reads CSTS and gets 0xffffffff. 1402 - */ 1403 1390 { 1404 - .vid = 0x144d, 1405 - .fr = "BXW75D0Q", 1391 + /* 1392 + * This Toshiba device seems to die using any APST states. See: 1393 + * https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1678184/comments/11 1394 + */ 1395 + .vid = 0x1179, 1396 + .mn = "THNSF5256GPUK TOSHIBA", 1406 1397 .quirks = NVME_QUIRK_NO_APST, 1407 - }, 1398 + } 1408 1399 }; 1409 1400 1410 1401 /* match is null-terminated but idstr is space-padded. */
+5
drivers/nvme/host/nvme.h
··· 83 83 * APST should not be used. 84 84 */ 85 85 NVME_QUIRK_NO_APST = (1 << 4), 86 + 87 + /* 88 + * The deepest sleep state should not be used. 89 + */ 90 + NVME_QUIRK_NO_DEEPEST_PS = (1 << 5), 86 91 }; 87 92 88 93 /*
+25 -1
drivers/nvme/host/pci.c
··· 19 19 #include <linux/blk-mq-pci.h> 20 20 #include <linux/cpu.h> 21 21 #include <linux/delay.h> 22 + #include <linux/dmi.h> 22 23 #include <linux/errno.h> 23 24 #include <linux/fs.h> 24 25 #include <linux/genhd.h> ··· 1944 1943 return -ENODEV; 1945 1944 } 1946 1945 1946 + static unsigned long check_dell_samsung_bug(struct pci_dev *pdev) 1947 + { 1948 + if (pdev->vendor == 0x144d && pdev->device == 0xa802) { 1949 + /* 1950 + * Several Samsung devices seem to drop off the PCIe bus 1951 + * randomly when APST is on and uses the deepest sleep state. 1952 + * This has been observed on a Samsung "SM951 NVMe SAMSUNG 1953 + * 256GB", a "PM951 NVMe SAMSUNG 512GB", and a "Samsung SSD 1954 + * 950 PRO 256GB", but it seems to be restricted to two Dell 1955 + * laptops. 1956 + */ 1957 + if (dmi_match(DMI_SYS_VENDOR, "Dell Inc.") && 1958 + (dmi_match(DMI_PRODUCT_NAME, "XPS 15 9550") || 1959 + dmi_match(DMI_PRODUCT_NAME, "Precision 5510"))) 1960 + return NVME_QUIRK_NO_DEEPEST_PS; 1961 + } 1962 + 1963 + return 0; 1964 + } 1965 + 1947 1966 static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) 1948 1967 { 1949 1968 int node, result = -ENOMEM; 1950 1969 struct nvme_dev *dev; 1970 + unsigned long quirks = id->driver_data; 1951 1971 1952 1972 node = dev_to_node(&pdev->dev); 1953 1973 if (node == NUMA_NO_NODE) ··· 2000 1978 if (result) 2001 1979 goto put_pci; 2002 1980 1981 + quirks |= check_dell_samsung_bug(pdev); 1982 + 2003 1983 result = nvme_init_ctrl(&dev->ctrl, &pdev->dev, &nvme_pci_ctrl_ops, 2004 - id->driver_data); 1984 + quirks); 2005 1985 if (result) 2006 1986 goto release_pools; 2007 1987