linux-cxl.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/13] Enumerate midlevel and endpoint decoders
@ 2021-09-02 19:50 Ben Widawsky
  2021-09-02 19:50 ` [PATCH 01/13] Documentation/cxl: Add bus internal docs Ben Widawsky
                   ` (13 more replies)
  0 siblings, 14 replies; 60+ messages in thread
From: Ben Widawsky @ 2021-09-02 19:50 UTC (permalink / raw)
  To: linux-cxl
  Cc: Ben Widawsky, Alison Schofield, Dan Williams, Ira Weiny,
	Jonathan Cameron, Vishal Verma

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

-- 
2.33.0


^ permalink raw reply	[flat|nested] 60+ messages in thread

end of thread, other threads:[~2021-09-14 23:31 UTC | newest]

Thread overview: 60+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02 19:50 [PATCH 00/13] Enumerate midlevel and endpoint decoders Ben Widawsky
2021-09-02 19:50 ` [PATCH 01/13] Documentation/cxl: Add bus internal docs Ben Widawsky
2021-09-03 14:05   ` Jonathan Cameron
2021-09-10 18:20     ` Dan Williams
2021-09-02 19:50 ` [PATCH 02/13] cxl/core/bus: Add kernel docs for decoder ops Ben Widawsky
2021-09-03 14:17   ` Jonathan Cameron
2021-09-10 18:51   ` Dan Williams
2021-09-11 17:25     ` Ben Widawsky
2021-09-02 19:50 ` [PATCH 03/13] cxl/core: Ignore interleave when adding decoders Ben Widawsky
2021-09-03 14:25   ` Jonathan Cameron
2021-09-10 19:00     ` Dan Williams
2021-09-11 17:30       ` Ben Widawsky
2021-09-02 19:50 ` [PATCH 04/13] cxl: Introduce endpoint decoders Ben Widawsky
2021-09-03 14:35   ` Jonathan Cameron
2021-09-13 16:19     ` Ben Widawsky
2021-09-10 19:19   ` Dan Williams
2021-09-13 16:11     ` Ben Widawsky
2021-09-13 22:07       ` Dan Williams
2021-09-13 23:19         ` Ben Widawsky
2021-09-14 21:16           ` Dan Williams
2021-09-02 19:50 ` [PATCH 05/13] cxl/pci: Disambiguate cxl_pci further from cxl_mem Ben Widawsky
2021-09-03 14:45   ` Jonathan Cameron
2021-09-10 19:27   ` Dan Williams
2021-09-02 19:50 ` [PATCH 06/13] cxl/mem: Introduce cxl_mem driver Ben Widawsky
2021-09-03 14:52   ` Jonathan Cameron
2021-09-10 21:32   ` Dan Williams
2021-09-13 16:46     ` Ben Widawsky
2021-09-13 19:37       ` Dan Williams
2021-09-02 19:50 ` [PATCH 07/13] cxl/memdev: Determine CXL.mem capability Ben Widawsky
2021-09-03 15:21   ` Jonathan Cameron
2021-09-13 19:01     ` Ben Widawsky
2021-09-10 21:59   ` Dan Williams
2021-09-13 22:10     ` Ben Widawsky
2021-09-14 22:42       ` Dan Williams
2021-09-14 22:55         ` Ben Widawsky
2021-09-02 19:50 ` [PATCH 08/13] cxl/mem: Add memdev as a port Ben Widawsky
2021-09-03 15:31   ` Jonathan Cameron
2021-09-10 23:09   ` Dan Williams
2021-09-02 19:50 ` [PATCH 09/13] cxl/pci: Retain map information in cxl_mem_probe Ben Widawsky
2021-09-10 23:12   ` Dan Williams
2021-09-10 23:45     ` Dan Williams
2021-09-02 19:50 ` [PATCH 10/13] cxl/core: Map component registers for ports Ben Widawsky
2021-09-02 22:41   ` Ben Widawsky
2021-09-02 22:42     ` Ben Widawsky
2021-09-03 16:14   ` Jonathan Cameron
2021-09-10 23:52     ` Dan Williams
2021-09-13  8:29       ` Jonathan Cameron
2021-09-10 23:44   ` Dan Williams
2021-09-02 19:50 ` [PATCH 11/13] cxl/core: Convert decoder range to resource Ben Widawsky
2021-09-03 16:16   ` Jonathan Cameron
2021-09-11  0:59   ` Dan Williams
2021-09-02 19:50 ` [PATCH 12/13] cxl/core/bus: Enumerate all HDM decoders Ben Widawsky
2021-09-03 17:43   ` Jonathan Cameron
2021-09-11  1:37     ` Dan Williams
2021-09-11  1:13   ` Dan Williams
2021-09-02 19:50 ` [PATCH 13/13] cxl/mem: Enumerate switch decoders Ben Widawsky
2021-09-03 17:56   ` Jonathan Cameron
2021-09-13 22:12     ` Ben Widawsky
2021-09-14 23:31   ` Dan Williams
2021-09-10 18:15 ` [PATCH 00/13] Enumerate midlevel and endpoint decoders Dan Williams

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).