Skip to content

Commit 6f2d715

Browse files
Panky-codesChristoph Hellwig
authored andcommitted
nvme initialize core quirks before calling nvme_init_subsystem
A device might have a core quirk for NVME_QUIRK_IGNORE_DEV_SUBNQN (such as Samsung X5) but it would still give a: "missing or invalid SUBNQN field" warning as core quirks are filled after calling nvme_init_subnqn. Fill ctrl->quirks from struct core_quirks before calling nvme_init_subsystem to fix this. Tested on a Samsung X5. Fixes: ab9e00c ("nvme: track subsystems") Signed-off-by: Pankaj Raghav <[email protected]> Signed-off-by: Christoph Hellwig <[email protected]>
1 parent 899d2a0 commit 6f2d715

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/nvme/host/core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3095,10 +3095,6 @@ static int nvme_init_identify(struct nvme_ctrl *ctrl)
30953095
if (!ctrl->identified) {
30963096
unsigned int i;
30973097

3098-
ret = nvme_init_subsystem(ctrl, id);
3099-
if (ret)
3100-
goto out_free;
3101-
31023098
/*
31033099
* Check for quirks. Quirk can depend on firmware version,
31043100
* so, in principle, the set of quirks present can change
@@ -3111,6 +3107,10 @@ static int nvme_init_identify(struct nvme_ctrl *ctrl)
31113107
if (quirk_matches(id, &core_quirks[i]))
31123108
ctrl->quirks |= core_quirks[i].quirks;
31133109
}
3110+
3111+
ret = nvme_init_subsystem(ctrl, id);
3112+
if (ret)
3113+
goto out_free;
31143114
}
31153115
memcpy(ctrl->subsys->firmware_rev, id->fr,
31163116
sizeof(ctrl->subsys->firmware_rev));

0 commit comments

Comments
 (0)