[PATCH 2/2] nvme: Report model,sn,fw,pci device information during init

Keith Busch kbusch at kernel.org
Tue Jun 14 14:30:08 PDT 2022


On Tue, Jun 14, 2022 at 11:09:02PM +0200, Erwan Velu wrote:
> @@ -2982,6 +2982,14 @@ static int nvme_init_identify(struct nvme_ctrl *ctrl)
>  		return -EIO;
>  	}
>  
> +	/* Reporting model, serial, firmware and pci info */
> +	dev_info(ctrl->device, "MODEL:%s SN:%s FW:%s PCI_ID:%04x:%04x\n",
> +			id->mn,
> +			id->sn,
> +			id->fr,
> +			le16_to_cpu(id->vid),
> +			le16_to_cpu(id->ssvid));

We don't need to print this on every controller reset, so I think this needs to
be within the "if (!ctrl->identified)" block.

And since you can't just null terminate the these strings, you should use the
"%*s" format.

I'm unsure if the serial number should be logged. Firmware and model are
probably fine.



More information about the Linux-nvme mailing list