mbox series

[RFCish,00/23] cxl_region and cxl_memdev drivers

Message ID 20210723210623.114073-1-ben.widawsky@intel.com
Headers show
Series cxl_region and cxl_memdev drivers | expand

Message

Ben Widawsky July 23, 2021, 9:06 p.m. UTC
I will be going on vacation for the next two weeks so I'm sending out everything
I have, even though it's not fully baked so that folks who might want to
continue it while I'm gone, can do so. Many of these patches have already been
sent as separate series, or RFC.

The ultimate goal of this series is to create two new driver types, cxl_region,
and cxl_memdev. The cxl_region driver is responsible for region creation and
configuration, and the cxl_memdev driver is responsible for handling the CXL
specific (non-PCI) parts of CXL endpoints. In order to establish that in a clean
way, the cxl_core driver needed quite a bit of rework. The next step is to
complete the HDM decoder programming.

What's specifically not fully baked is the cxl_pci driver claims part of the
component register space, but the cxl_memdev driver also wants this resource.
Better coordination here needs to happen, most likely the cxl_pci driver must
relinquish any resources it won't be needing. Some of the patches started to
enable making that easy, but it's not complete and as a result I believe these
patches will OOPS (there may be other issues as well).

If you feel like reviewing any of these patches, that'd be great, but I'm
equally happy to resubmit when I'm back and have things fully working.

Patch breakdown
1-11: cxl_core reorganization
12-18: cxl_region driver
19-23: cxl_memdev driver

These patches can be obtained from my gitlab as well:
https://gitlab.com/bwidawsk/linux/-/tree/cxl_memdrver2

Ben Widawsky (23):
  cxl: Move cxl_core to new directory
  cxl/core: Improve CXL core kernel docs
  cxl/core: Extract register and pmem functionality
  cxl/mem: Move character device region creation
  cxl: Pass fops and shutdown to memdev creation
  cxl/core: Move memdev management to core
  cxl/pci: Ignore unknown register block types
  cxl/pci: Simplify register setup
  cxl/pci: Retain map information in cxl_mem_probe
  cxl/decoder: Support parentless decoders
  cxl: Enable an endpoint decoder type
  cxl/region: Add region creation ABI
  cxl/region: Introduce concept of region configuration
  cxl: Convert driver id to an enum
  cxl/region: Introduce a cxl_region driver
  cxl/core: Convert decoder range to resource
  cxl/region: Handle region's address space allocation
  cxl/region: Only allow CXL capable targets
  cxl/mem: Introduce CXL mem driver
  cxl/memdev: Determine CXL.mem capability
  cxl/mem: Check that the device is CXL.mem capable
  cxl/mem: Add device as a port
  cxl/core: Map component registers for ports

 Documentation/ABI/testing/sysfs-bus-cxl       |  53 ++
 .../driver-api/cxl/memory-devices.rst         |  25 +-
 drivers/cxl/Makefile                          |   9 +-
 drivers/cxl/acpi.c                            |  44 +-
 drivers/cxl/core/Makefile                     |   5 +
 drivers/cxl/{core.c => core/bus.c}            | 711 +++++++-----------
 drivers/cxl/core/core.h                       |  22 +
 drivers/cxl/core/memdev.c                     | 230 ++++++
 drivers/cxl/core/pmem.c                       | 201 +++++
 drivers/cxl/core/region.c                     | 389 ++++++++++
 drivers/cxl/core/regs.c                       | 235 ++++++
 drivers/cxl/cxl.h                             |  67 +-
 drivers/cxl/mem.c                             |  94 +++
 drivers/cxl/mem.h                             |  19 +
 drivers/cxl/pci.c                             | 325 ++------
 drivers/cxl/pci.h                             |   8 +-
 drivers/cxl/region.c                          | 134 ++++
 drivers/cxl/region.h                          |  34 +
 drivers/cxl/trace.h                           |  33 +
 19 files changed, 1867 insertions(+), 771 deletions(-)
 create mode 100644 drivers/cxl/core/Makefile
 rename drivers/cxl/{core.c => core/bus.c} (55%)
 create mode 100644 drivers/cxl/core/core.h
 create mode 100644 drivers/cxl/core/memdev.c
 create mode 100644 drivers/cxl/core/pmem.c
 create mode 100644 drivers/cxl/core/region.c
 create mode 100644 drivers/cxl/core/regs.c
 create mode 100644 drivers/cxl/mem.c
 create mode 100644 drivers/cxl/region.c
 create mode 100644 drivers/cxl/region.h
 create mode 100644 drivers/cxl/trace.h