Skip to content

Commit 4ba032b

Browse files
committed
Merge tag 'nvme-6.11-2024-09-05' of git://git.infradead.org/nvme into block-6.11
Pull NVMe fixes from Keith: "nvme fixes for Linux 6.11 - Sparse fix on static symbol (Jinjie) - Misleading warning message fix (Keith) - TCP command allocation handling fix (Maurizio) - PCI tagset allocation handling fix (Keith) - Low-power quirk for Samsung (Georg) - Queue limits fix for zone devices (Christoph) - Target protocol behavior fix (Maurizio)" * tag 'nvme-6.11-2024-09-05' of git://git.infradead.org/nvme: nvmet: Identify-Active Namespace ID List command should reject invalid nsid nvme: set BLK_FEAT_ZONED for ZNS multipath disks nvme-pci: Add sleep quirk for Samsung 990 Evo nvme-pci: allocate tagset on reset if necessary nvmet-tcp: fix kernel crash if commands allocation fails nvme: use better description for async reset reason nvmet: Make nvmet_debugfs static
2 parents b858a36 + 899d2e5 commit 4ba032b

File tree

6 files changed

+36
-4
lines changed

6 files changed

+36
-4
lines changed

drivers/nvme/host/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4437,7 +4437,8 @@ static bool nvme_handle_aen_notice(struct nvme_ctrl *ctrl, u32 result)
44374437

44384438
static void nvme_handle_aer_persistent_error(struct nvme_ctrl *ctrl)
44394439
{
4440-
dev_warn(ctrl->device, "resetting controller due to AER\n");
4440+
dev_warn(ctrl->device,
4441+
"resetting controller due to persistent internal error\n");
44414442
nvme_reset_ctrl(ctrl);
44424443
}
44434444

drivers/nvme/host/multipath.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,9 @@ int nvme_mpath_alloc_disk(struct nvme_ctrl *ctrl, struct nvme_ns_head *head)
616616
blk_set_stacking_limits(&lim);
617617
lim.dma_alignment = 3;
618618
lim.features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT | BLK_FEAT_POLL;
619-
if (head->ids.csi != NVME_CSI_ZNS)
619+
if (head->ids.csi == NVME_CSI_ZNS)
620+
lim.features |= BLK_FEAT_ZONED;
621+
else
620622
lim.max_zone_append_sectors = 0;
621623

622624
head->disk = blk_alloc_disk(&lim, ctrl->numa_node);

drivers/nvme/host/pci.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2508,6 +2508,12 @@ static unsigned int nvme_pci_nr_maps(struct nvme_dev *dev)
25082508

25092509
static void nvme_pci_update_nr_queues(struct nvme_dev *dev)
25102510
{
2511+
if (!dev->ctrl.tagset) {
2512+
nvme_alloc_io_tag_set(&dev->ctrl, &dev->tagset, &nvme_mq_ops,
2513+
nvme_pci_nr_maps(dev), sizeof(struct nvme_iod));
2514+
return;
2515+
}
2516+
25112517
blk_mq_update_nr_hw_queues(&dev->tagset, dev->online_queues - 1);
25122518
/* free previously allocated queues that are no longer usable */
25132519
nvme_free_queues(dev, dev->online_queues);
@@ -2967,6 +2973,17 @@ static unsigned long check_vendor_combination_bug(struct pci_dev *pdev)
29672973
dmi_match(DMI_BOARD_NAME, "NS5x_7xPU") ||
29682974
dmi_match(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1"))
29692975
return NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND;
2976+
} else if (pdev->vendor == 0x144d && pdev->device == 0xa80d) {
2977+
/*
2978+
* Exclude Samsung 990 Evo from NVME_QUIRK_SIMPLE_SUSPEND
2979+
* because of high power consumption (> 2 Watt) in s2idle
2980+
* sleep. Only some boards with Intel CPU are affected.
2981+
*/
2982+
if (dmi_match(DMI_BOARD_NAME, "GMxPXxx") ||
2983+
dmi_match(DMI_BOARD_NAME, "PH4PG31") ||
2984+
dmi_match(DMI_BOARD_NAME, "PH4PRX1_PH6PRX1") ||
2985+
dmi_match(DMI_BOARD_NAME, "PH6PG01_PH6PG71"))
2986+
return NVME_QUIRK_FORCE_NO_SIMPLE_SUSPEND;
29702987
}
29712988

29722989
/*

drivers/nvme/target/admin-cmd.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,16 @@ static void nvmet_execute_identify_nslist(struct nvmet_req *req)
587587
u16 status = 0;
588588
int i = 0;
589589

590+
/*
591+
* NSID values 0xFFFFFFFE and NVME_NSID_ALL are invalid
592+
* See NVMe Base Specification, Active Namespace ID list (CNS 02h).
593+
*/
594+
if (min_nsid == 0xFFFFFFFE || min_nsid == NVME_NSID_ALL) {
595+
req->error_loc = offsetof(struct nvme_identify, nsid);
596+
status = NVME_SC_INVALID_NS | NVME_STATUS_DNR;
597+
goto out;
598+
}
599+
590600
list = kzalloc(buf_size, GFP_KERNEL);
591601
if (!list) {
592602
status = NVME_SC_INTERNAL;

drivers/nvme/target/debugfs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#include "nvmet.h"
1414
#include "debugfs.h"
1515

16-
struct dentry *nvmet_debugfs;
16+
static struct dentry *nvmet_debugfs;
1717

1818
#define NVMET_DEBUGFS_ATTR(field) \
1919
static int field##_open(struct inode *inode, struct file *file) \

drivers/nvme/target/tcp.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2146,8 +2146,10 @@ static u16 nvmet_tcp_install_queue(struct nvmet_sq *sq)
21462146
}
21472147

21482148
queue->nr_cmds = sq->size * 2;
2149-
if (nvmet_tcp_alloc_cmds(queue))
2149+
if (nvmet_tcp_alloc_cmds(queue)) {
2150+
queue->nr_cmds = 0;
21502151
return NVME_SC_INTERNAL;
2152+
}
21512153
return 0;
21522154
}
21532155

0 commit comments

Comments
 (0)