Skip to content

Enumerate midlevel and endpoint decoders

Ben Widawsky linux-cxl linux-pci 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 46 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13Documentation/cxl: Add bus internal docsDocumentation/driver-api/cxl/memory-devices.rst+3 -02 replies
2/13cxl/core/bus: Add kernel docs for decoder opsdrivers/cxl/core/bus.c+28 -03 replies
3/13cxl/core: Ignore interleave when adding decodersdrivers/cxl/core/bus.c+0 -33 replies
4/13cxl: Introduce endpoint decodersdrivers/cxl/core/bus.c+25 -47 replies
5/13cxl/pci: Disambiguate cxl_pci further from cxl_memdrivers/cxl/pci.c+35 -352 replies
6/13cxl/mem: Introduce cxl_mem driverDocumentation/driver-api/cxl/memory-devices.rst drivers/cxl/Makefile drivers/cxl/core/bus.c +4 more+59 -24 replies
7/13cxl/memdev: Determine CXL.mem capabilitydrivers/cxl/acpi.c drivers/cxl/core/bus.c drivers/cxl/core/memdev.c +5 more+141 -416 replies
8/13cxl/mem: Add memdev as a portdrivers/cxl/core/bus.c drivers/cxl/mem.c+13 -22 replies
9/13cxl/pci: Retain map information in cxl_mem_probedrivers/cxl/pci.c+6 -42 replies
10/13cxl/core: Map component registers for portsdrivers/cxl/core/bus.c drivers/cxl/core/memdev.c drivers/cxl/core/regs.c +4 more+73 -126 replies
11/13cxl/core: Convert decoder range to resourcedrivers/cxl/acpi.c drivers/cxl/core/bus.c drivers/cxl/cxl.h+8 -122 replies
12/13cxl/core/bus: Enumerate all HDM decodersdrivers/cxl/core/bus.c drivers/cxl/cxl.h+209 -63 replies
13/13cxl/mem: Enumerate switch decodersdrivers/cxl/mem.c drivers/cxl/pci.c drivers/cxl/pci.h+137 -93 replies

Reviews trailers per patch

6 of 13 patches have a Reviewed-by or Acked-by.

PatchJonathan Cameron
1/13A-b
2/13
3/13R-b
4/13
5/13R-b
6/13R-b
7/13
8/13R-b
9/13
10/13
11/13R-b
12/13
13/13

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

Read the v1 thread

Cover letter [PATCH 00/13] Enumerate midlevel and endpoint decoders

Every CXL component may implement component registers as defined by the CXL 2.0 specification. In preparation for creating and enumerating regions it's important to at least enumerate all HDM decoders which are a subset of the component registers. To do this, a new cxl_mem driver is introduced which is responsible for binding to a CXL.mem enabled device. In order to determine whether or not an endpoint is CXL enabled, the relevant subhierarchy must be enumerated.

This serves as the stepping stone toward enabling regions because regions must be able to determine if the devices selected for the region are CXL.mem capable and enabled.

There's two issues that need to be resolved but I'm going to propose we fix them next time we need to touch this code...
1. cxl_pci now relinquishes its component register mappings. This may be undesirable as cxl_pci may need to use those mappings.
2a. some amount of component register enumeration is duplicated in cxl_pci and
cxl_mem
2b. awkwardness in cxl_mem where memdevs get their component registers from
cxl_pci, and ports that enumerate their own component registers

The obvious fix for both of these is to move component register mapping to cxl_core, and let cxl_core arbitrate the mappings for the "client" drivers. Since the code needed to enable cxl_mem was small and subset of the existing code (and fairly error resistent vs creating a cxl_core API) I'm hoping to kick the can down the road.

NOTE: I do not have a way at present to test switches. For this reason and for patch readability, the switch enumeration is left as a separate patch.

NOTE2: Some of these patches were introduced in an RFC for region creation. Upon further inspection, it made a lot of sense to land these before region creation so long as it's understood upfront why the new driver is needed.

I've pushed this to my gitlab here:
https://gitlab.com/bwidawsk/linux/-/tree/decoders

Ben Widawsky (13):
Documentation/cxl: Add bus internal docs cxl/core/bus: Add kernel docs for decoder ops cxl/core: Ignore interleave when adding decoders
cxl: Introduce endpoint decoders
cxl/pci: Disambiguate cxl_pci further from cxl_mem cxl/mem: Introduce cxl_mem driver cxl/memdev: Determine CXL.mem capability cxl/mem: Add memdev as a port
cxl/pci: Retain map information in cxl_mem_probe cxl/core: Map component registers for ports cxl/core: Convert decoder range to resource cxl/core/bus: Enumerate all HDM decoders cxl/mem: Enumerate switch decoders

 .../driver-api/cxl/memory-devices.rst         |   6 +
 drivers/cxl/Makefile                          |   3 +-
 drivers/cxl/acpi.c                            |  39 +--
 drivers/cxl/core/bus.c                        | 326 +++++++++++++++++-
 drivers/cxl/core/core.h                       |   1 +
 drivers/cxl/core/memdev.c                     |  19 +-
 drivers/cxl/core/regs.c                       |   6 +-
 drivers/cxl/cxl.h                             |  65 +++-
 drivers/cxl/cxlmem.h                          |   6 +-
 drivers/cxl/mem.c                             | 237 +++++++++++++
 drivers/cxl/pci.c                             | 124 +++----
 drivers/cxl/pci.h                             |  15 +-
 12 files changed, 727 insertions(+), 120 deletions(-)
 create mode 100644 drivers/cxl/mem.c
Signature · 1 line
2.33.0