Re: [PATCH v3 0/3] cxl: Format the device serial number as unsigned

Dave Jiang <[email protected]> Wed, 5 Aug 2026 13:45:16 -0700
Newsgroups org.kernel.vger.linux-cxl
Message-ID <[email protected]>

On 7/24/26 1:37 PM, Alison Schofield wrote:
> 
> Changes in v3:
> - PATCH 1 commit messaged updated with link to work-around direction
> - No other changes.
> 
> 
> This series supersedes the previously posted standalone fix:
>   cxl/pmem: Format nvdimm serial number as decimal
> 
> That patch addressed the immediate auto-unlock failure caused by the
> kernel formatting the nvdimm security key description differently than
> the decimal 'id' sysfs attribute used by ndctl.
> 
> Further review uncovered a second formatting issue affecting the same
> serial number. The CXL device serial number is a u64 PCIe Device Serial
> Number, yet several kernel interfaces format it with signed "%lld".
> Devices whose vendor OUI sets bit 63 therefore appear with negative
> decimal serial numbers.
> 
> Serials with bit 64 set are expected. The most significant byte of the
> PCIe Device Serial Number contains the vendor OUI, so vendors such as
> Montage naturally produce serial numbers with bit 63 set.
> 
> Rather than merge the decimal-format fix and immediately follow it with
> another patch changing the same code to "%llu", fold both fixes into a
> single series that consistently formats CXL serial numbers as unsigned
> where appropriate and adds cxl_test coverage for the large serial case.
> 
> 
> Alison Schofield (3):
>   cxl/pmem: Format the nvdimm serial number as unsigned decimal
>   cxl/core: Format the memdev serial number as unsigned in TP_printk
>   cxl/test: Assign one mock memdev a full-width serial number
> 
>  Documentation/ABI/testing/sysfs-bus-nvdimm |  3 ++-
>  drivers/cxl/core/pmem.c                    | 10 ++++++----
>  drivers/cxl/core/trace.h                   | 10 +++++-----
>  drivers/cxl/cxl.h                          |  3 ++-
>  drivers/cxl/pmem.c                         |  2 +-
>  tools/testing/cxl/test/mem.c               | 15 ++++++++++++++-
>  6 files changed, 30 insertions(+), 13 deletions(-)
> 
> 
> base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482

Applied to cxl/next
94d84e3d8959
95a84b7cb4bb
8a80d3d65cd0