[PATCH 2/3] nvme: Add a quirk mechanism that uses identify_ctrl

Keith Busch keith.busch at intel.com
Wed Jan 18 07:56:47 PST 2017


On Tue, Jan 17, 2017 at 05:54:19PM -0800, Andy Lutomirski wrote:
> @@ -1351,6 +1394,15 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
>  		return -EIO;
>  	}
>  
> +	if (!ctrl->identified) {

Part of the quirk is matching firmware revision. That potentially changes
after a reset, but you only check the quirks the first time we initialise
the controller. It's a little awkward to unmask the quirk out when it
previously set for this, though, so maybe it's just as well to have the
user reboot after a firmware upgrade fixes a quirk.

Otherwise, looks good to me.

> +		int i;
> +
> +		for (i = 0; i < ARRAY_SIZE(core_quirks); i++) {
> +			if (quirk_matches(id, &core_quirks[i]))
> +				ctrl->quirks |= core_quirks[i].quirks;
> +		}
> +	}



More information about the Linux-nvme mailing list