]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cxl/port: Move dport probe operations to a driver event
authorDan Williams <dan.j.williams@intel.com>
Sat, 31 Jan 2026 00:03:59 +0000 (16:03 -0800)
committerDave Jiang <dave.jiang@intel.com>
Mon, 2 Feb 2026 15:41:29 +0000 (08:41 -0700)
commit3864cb60dad5a6c1bd9f444740cf541a1d8cda99
treec6038d1e6a981e6a568ebe916c3feba2cbfdc502
parent86e756715db22cd79a9726c22644415c46b6b149
cxl/port: Move dport probe operations to a driver event

In preparation for adding more register setup to the cxl_port_add_dport()
path (for RAS register mapping), move the dport creation event to a driver
callback. This achieves two goals, it puts driver operations logically
where they belong, in a driver, and it obviates the gymnastics of
DECLARE_TESTABLE() which just makes a mess of grepping for CXL symbols.

In other words, a driver callback is less of an ongoing maintenance burden
than this DECLARE_TESTABLE arrangement that does not scale and diminishes
the grep-ability of the codebase.

cxl_port_add_dport() moves mostly unmodified from drivers/cxl/core/port.c.
The only deliberate change is that it now assumes that the device_lock is
held on entry and the driver is attached (just like cxl_port_probe()).

Reviewed-by: Terry Bowman <terry.bowman@amd.com>
Tested-by: Terry Bowman <terry.bowman@amd.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Link: https://patch.msgid.link/20260131000403.2135324-6-dan.j.williams@intel.com
Signed-off-by: Dave Jiang <dave.jiang@intel.com>
drivers/cxl/core/hdm.c
drivers/cxl/core/pci.c
drivers/cxl/core/port.c
drivers/cxl/cxl.h
drivers/cxl/port.c
tools/testing/cxl/Kbuild
tools/testing/cxl/cxl_core_exports.c
tools/testing/cxl/exports.h [deleted file]
tools/testing/cxl/test/mock.c