Commit 6f2d7152 authored by Pankaj Raghav's avatar Pankaj Raghav Committed by Christoph Hellwig
Browse files

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: ab9e00cc ("nvme: track subsystems")
Signed-off-by: default avatarPankaj Raghav <p.raghav@samsung.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 899d2a05
Loading
Loading
Loading
Loading
+4 −4
Original line number Diff line number Diff line
@@ -3095,10 +3095,6 @@ static int nvme_init_identify(struct nvme_ctrl *ctrl)
	if (!ctrl->identified) {
		unsigned int i;

		ret = nvme_init_subsystem(ctrl, id);
		if (ret)
			goto out_free;

		/*
		 * Check for quirks.  Quirk can depend on firmware version,
		 * so, in principle, the set of quirks present can change
@@ -3111,6 +3107,10 @@ static int nvme_init_identify(struct nvme_ctrl *ctrl)
			if (quirk_matches(id, &core_quirks[i]))
				ctrl->quirks |= core_quirks[i].quirks;
		}

		ret = nvme_init_subsystem(ctrl, id);
		if (ret)
			goto out_free;
	}
	memcpy(ctrl->subsys->firmware_rev, id->fr,
	       sizeof(ctrl->subsys->firmware_rev));