linux-stable/drivers/cxl
Dan Williams 3528b1e101 cxl/region: Refactor attach_target() for autodiscovery
Region autodiscovery is the process of kernel creating 'struct
cxl_region' object to represent active CXL memory ranges it finds
already active in hardware when the driver loads. Typically this happens
when platform firmware establishes CXL memory regions and then publishes
them in the memory map. However, this can also happen in the case of
kexec-reboot after the kernel has created regions.

In the autodiscovery case the region creation process starts with a
known endpoint decoder. Refactor attach_target() into a helper that is
suitable to be called from either sysfs, for runtime region creation, or
from cxl_port_probe() after it has enumerated all endpoint decoders.

The cxl_port_probe() context is an async device-core probing context, so
it is not appropriate to allow SIGTERM to interrupt the assembly
process. Refactor attach_target() to take @cxled and @state as arguments
where @state indicates whether waiting from the region rwsem is
interruptible or not.

No behavior change is intended.

Reviewed-by: Vishal Verma <vishal.l.verma@intel.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Tested-by: Fan Ni <fan.ni@samsung.com>
Link: https://lore.kernel.org/r/167601996393.1924368.2202255054618600069.stgit@dwillia2-xfh.jf.intel.com
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2023-02-10 17:32:15 -08:00
..
core cxl/region: Refactor attach_target() for autodiscovery 2023-02-10 17:32:15 -08:00
acpi.c cxl: update names for interleave ways conversion macros 2022-12-05 18:17:16 -08:00
cxl.h cxl/region: Add a mode attribute for regions 2023-02-10 17:31:58 -08:00
cxlmem.h cxl/memdev: Fix endpoint port removal 2023-02-10 17:29:09 -08:00
cxlpci.h cxl/pci: Move tracepoint definitions to drivers/cxl/core/ 2023-01-04 17:11:11 -08:00
Kconfig cxl/region: Manage CPU caches relative to DPA invalidation events 2022-12-03 00:03:57 -08:00
Makefile cxl/pmem: Introduce nvdimm_security_ops with ->get_flags() operation 2022-11-30 16:30:47 -08:00
mem.c cxl/port: Add RCD endpoint port enumeration 2022-12-05 10:32:26 -08:00
pci.c cxl/pci: Show opcode in debug messages when sending a command 2023-01-24 17:52:54 -08:00
pmem.c cxl/mbox: Enable cxl_mbox_send_cmd() users to validate output size 2022-12-06 14:36:02 -08:00
port.c cxl/port: Read CDAT table 2022-07-19 15:38:05 -07:00
security.c cxl/mbox: Enable cxl_mbox_send_cmd() users to validate output size 2022-12-06 14:36:02 -08:00