Skip to content

Commit c917dd9

Browse files
committed
nvme: skip optional id ctrl csi if it failed
A frequently recieved report is the driver requests the optional Command Set Specific Identify Controller structure. Some controllers report this in their error log, which tiggers other warnings to user space monitoring the devices. These error entries are harmless and of questionable value to save in the log, but let's reduce their occurance by not resending the command if it previously failed. This will not prevent the errors on the initial module load, but will greatly reduce their occurance on any rescans and resumes from suspend. Link: https://bugzilla.kernel.org/show_bug.cgi?id=217445 Reviewed-by: Sagi Grimberg <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Keith Busch <[email protected]>
1 parent 35e797b commit c917dd9

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

drivers/nvme/host/core.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2995,7 +2995,8 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
29952995
ctrl->max_zeroes_sectors = 0;
29962996

29972997
if (ctrl->subsys->subtype != NVME_NQN_NVME ||
2998-
nvme_ctrl_limited_cns(ctrl))
2998+
nvme_ctrl_limited_cns(ctrl) ||
2999+
test_bit(NVME_CTRL_SKIP_ID_CNS_CS, &ctrl->flags))
29993000
return 0;
30003001

30013002
id = kzalloc(sizeof(*id), GFP_KERNEL);
@@ -3017,6 +3018,8 @@ static int nvme_init_non_mdts_limits(struct nvme_ctrl *ctrl)
30173018
ctrl->max_zeroes_sectors = nvme_mps_to_sectors(ctrl, id->wzsl);
30183019

30193020
free_data:
3021+
if (ret > 0)
3022+
set_bit(NVME_CTRL_SKIP_ID_CNS_CS, &ctrl->flags);
30203023
kfree(id);
30213024
return ret;
30223025
}

drivers/nvme/host/nvme.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,7 @@ enum nvme_ctrl_flags {
242242
NVME_CTRL_ADMIN_Q_STOPPED = 1,
243243
NVME_CTRL_STARTED_ONCE = 2,
244244
NVME_CTRL_STOPPED = 3,
245+
NVME_CTRL_SKIP_ID_CNS_CS = 4,
245246
};
246247

247248
struct nvme_ctrl {

0 commit comments

Comments
 (0)