Skip to content

Commit a045553

Browse files
committed
Merge tag 'nvme-6.12-2024-09-25' of git://git.infradead.org/nvme into for-6.12/block
Pull NVMe fixes from Keith: "nvme fixes for Linux 6.12 - Multipath fixes (Hannes) - Sysfs attribute list NULL terminate fix (Shin'ichiro) - Remove problematic read-back (Keith)" * tag 'nvme-6.12-2024-09-25' of git://git.infradead.org/nvme: nvme: remove CC register read-back during enabling nvme: null terminate nvme_tls_attrs nvme-multipath: avoid hang on inaccessible namespaces nvme-multipath: system fails to create generic nvme device
2 parents 65f666c + 9064610 commit a045553

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

drivers/nvme/host/core.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,11 +2468,6 @@ int nvme_enable_ctrl(struct nvme_ctrl *ctrl)
24682468
if (ret)
24692469
return ret;
24702470

2471-
/* Flush write to device (required if transport is PCI) */
2472-
ret = ctrl->ops->reg_read32(ctrl, NVME_REG_CC, &ctrl->ctrl_config);
2473-
if (ret)
2474-
return ret;
2475-
24762471
/* CAP value may change after initial CC write */
24772472
ret = ctrl->ops->reg_read64(ctrl, NVME_REG_CAP, &ctrl->cap);
24782473
if (ret)

drivers/nvme/host/multipath.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,9 @@ static bool nvme_available_path(struct nvme_ns_head *head)
421421
{
422422
struct nvme_ns *ns;
423423

424+
if (!test_bit(NVME_NSHEAD_DISK_LIVE, &head->flags))
425+
return NULL;
426+
424427
list_for_each_entry_rcu(ns, &head->list, siblings) {
425428
if (test_bit(NVME_CTRL_FAILFAST_EXPIRED, &ns->ctrl->flags))
426429
continue;
@@ -648,7 +651,7 @@ static void nvme_mpath_set_live(struct nvme_ns *ns)
648651
rc = device_add_disk(&head->subsys->dev, head->disk,
649652
nvme_ns_attr_groups);
650653
if (rc) {
651-
clear_bit(NVME_NSHEAD_DISK_LIVE, &ns->flags);
654+
clear_bit(NVME_NSHEAD_DISK_LIVE, &head->flags);
652655
return;
653656
}
654657
nvme_add_ns_head_cdev(head);
@@ -969,11 +972,16 @@ void nvme_mpath_shutdown_disk(struct nvme_ns_head *head)
969972
{
970973
if (!head->disk)
971974
return;
972-
kblockd_schedule_work(&head->requeue_work);
973-
if (test_bit(NVME_NSHEAD_DISK_LIVE, &head->flags)) {
975+
if (test_and_clear_bit(NVME_NSHEAD_DISK_LIVE, &head->flags)) {
974976
nvme_cdev_del(&head->cdev, &head->cdev_device);
975977
del_gendisk(head->disk);
976978
}
979+
/*
980+
* requeue I/O after NVME_NSHEAD_DISK_LIVE has been cleared
981+
* to allow multipath to fail all I/O.
982+
*/
983+
synchronize_srcu(&head->srcu);
984+
kblockd_schedule_work(&head->requeue_work);
977985
}
978986

979987
void nvme_mpath_remove_disk(struct nvme_ns_head *head)

drivers/nvme/host/sysfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -767,6 +767,7 @@ static struct attribute *nvme_tls_attrs[] = {
767767
&dev_attr_tls_key.attr,
768768
&dev_attr_tls_configured_key.attr,
769769
&dev_attr_tls_keyring.attr,
770+
NULL,
770771
};
771772

772773
static umode_t nvme_tls_attrs_are_visible(struct kobject *kobj,

0 commit comments

Comments
 (0)