Skip to content

cxl: Format the device serial number as unsigned

Alison Schofield linux-cxl stable 3 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest3 patches 1 replyIn review
  2. v23 patches 2 repliesSuperseded
  3. v11 patch 7 repliesApplied

Changes in v3 from the cover letter

- PATCH 1 commit messaged updated with link to work-around direction
- No other changes.

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3cxl/pmem: Format the nvdimm serial number as unsigned decimalDocumentation/ABI/testing/sysfs-bus-nvdimm drivers/cxl/core/pmem.c drivers/cxl/cxl.h +1 more+11 -70 replies
2/3cxl/core: Format the memdev serial number as unsigned in TP_printkdrivers/cxl/core/trace.h+5 -50 replies
3/3cxl/test: Assign one mock memdev a full-width serial numbertools/testing/cxl/test/mem.c+14 -10 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchDan Williams
1/3A-b
2/3
3/3

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

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

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

Signature · 1 line
2.37.3