Re: [PATCH 1/1] cxl/pmem: debug invalid serial number data
From: Alison Schofield
Date: Thu Feb 13 2025 - 11:56:04 EST
On Thu, Feb 13, 2025 at 02:40:08PM +0800, Yuquan Wang wrote:
> In a nvdimm interleave-set each device with an invalid or zero
> serial number may cause pmem region initialization to fail, but in
> cxl case such device could still set cookies of nd_interleave_set
> and create a nvdimm pmem region.
>
> This adds the validation of serial number in cxl pmem region creation.
> The event of no serial number would cause to fail to set the cookie
> and pmem region.
This trips up cxl-test where a mock serial number is set from the
platform device id and 0 is a valid platform device id.
Take a look at doing this cxl_mock_mem_probe():
- cxlds->serial = pdev->id;
+ cxlds->serial = pdev->id + 1;
--snip