[PATCH v2] nvme: update firmware version after commit

Keith Busch kbusch at kernel.org
Fri Oct 13 09:43:48 PDT 2023


On Fri, Oct 13, 2023 at 06:34:20PM +0200, Daniel Wagner wrote:
>  	if (nvme_get_log(ctrl, NVME_NSID_ALL, NVME_LOG_FW_SLOT, 0, NVME_CSI_NVM,
> -			log, sizeof(*log), 0))
> +			 log, sizeof(*log), 0)) {
>  		dev_warn(ctrl->device, "Get FW SLOT INFO log error\n");
> +		goto out_free_log;
> +	}
> +
> +	afi = le64_to_cpu(log->afi);
> +	if (afi & 0x30) {

That should be 'afi & 0x70'.

> +		dev_info(ctrl->device,
> +			 "Firmware is activated after next Controller Level Reset\n");
> +		goto out_free_log;
> +	}
> +
> +	memcpy(ctrl->subsys->firmware_rev, &log->frs[afi & 0x3],

and 'afi & 0x7'.



More information about the Linux-nvme mailing list