Linux CXL
 help / color / mirror / Atom feed
* [PATCH v8 00/11] cxl: Delay HB port and switch dport probing until endpoint dev probe
@ 2025-08-14 22:21 Dave Jiang
  2025-08-14 22:21 ` [PATCH v8 01/11] cxl: Add helper to detect top of CXL device topology Dave Jiang
                   ` (11 more replies)
  0 siblings, 12 replies; 40+ messages in thread
From: Dave Jiang @ 2025-08-14 22:21 UTC (permalink / raw)
  To: linux-cxl
  Cc: dave, jonathan.cameron, alison.schofield, vishal.l.verma,
	ira.weiny, dan.j.williams, rrichter, Gregory Price,
	Jonathan Cameron, Li Ming

v8:
- A bit of changes from Dan and Robert's comments. Main change is moving the port MMIO
  register probing to after the first dport shows up. This resulted with decoder allocation
  happens after the register probe.
- See specific commits for more detailed changes.

v7:
- Remove -EEXIST to simplify error flow. (Ming)
- Set dport to NULL during declare. (Jonathan)

v6:
- Return -EEXIST when a dport already exists. (Jonathan)
- Fix checking wrong port for NULL. (Ming)
- Check host_bridge and call devm_cxl_add_dport_by_uport() directly vs add_port_attach_ep(). (Ming)
- Set dport to NULL during declaration. (Jonathan)

v5:
- Return dport instead of errno with dport pointer as output param. (Jonathan)
- Consolidate common code in cxl_test. (Jonathan)
- Rename cxl_port_get_total_dports() to cxl_port_update_total_dports(). (Jonathan)

v4:
- Push dport allocation to when they are discovered. (Robert)
- Drop linux id for dport with above changes.

v3:
- Main changes revolve around improving naming of hostbridge uport and dport (Gregory)
- See specific patches for detailed change log

This series attempts to delay the allocation of dports until when the endpoint device
(memdev) are being probed. At this point, the CXL link is established and all the
devices along the CXL link path up to the Root Port (RP) should be active.

And hopefully this help a bit with Robert's issue raised in the "Inactive
downstream port handling" series [1]. Testing would be appreicated. Thank you!

[1]: https://lore.kernel.org/linux-cxl/67c8a0cc23ec_24b64294f6@dwillia2-xfh.jf.intel.com.notmuch/

Dave Jiang (11):
  cxl: Add helper to detect top of CXL device topology
  cxl: Add helper to reap dport
  cxl: Add a cached copy of target_map to cxl_decoder
  cxl: Move port register setup to first dport appear
  cxl: Defer dport allocation for switch ports
  cxl/test: Add cxl_test support for cxl_port_get_possible_dports()
  cxl/test: Add mock version of devm_cxl_add_dport_by_dev()
  cxl/test: Add support to cxl_test for decoder enumeration mock
    functions
  cxl/test: Setup target_map for cxl_test decoder initialization
  cxl: Change sslbis handler to only handle single dport
  tools/testing/cxl: Add decoder save/restore support

 drivers/cxl/acpi.c                   |   7 +-
 drivers/cxl/core/cdat.c              |  25 +-
 drivers/cxl/core/core.h              |   2 +
 drivers/cxl/core/hdm.c               |  51 ++--
 drivers/cxl/core/pci.c               |  82 ++++++
 drivers/cxl/core/port.c              | 358 ++++++++++++++++++------
 drivers/cxl/core/region.c            |   4 +-
 drivers/cxl/cxl.h                    |  44 ++-
 drivers/cxl/port.c                   |  29 +-
 tools/testing/cxl/Kbuild             |   5 +-
 tools/testing/cxl/cxl_core_exports.c |  42 +++
 tools/testing/cxl/exports.h          |  21 ++
 tools/testing/cxl/test/cxl.c         | 399 ++++++++++++++++++++++++++-
 tools/testing/cxl/test/mock.c        |  70 ++++-
 tools/testing/cxl/test/mock.h        |   3 +
 15 files changed, 963 insertions(+), 179 deletions(-)
 create mode 100644 tools/testing/cxl/exports.h


base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585
-- 
2.50.1


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

end of thread, other threads:[~2025-09-03 18:21 UTC | newest]

Thread overview: 40+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-14 22:21 [PATCH v8 00/11] cxl: Delay HB port and switch dport probing until endpoint dev probe Dave Jiang
2025-08-14 22:21 ` [PATCH v8 01/11] cxl: Add helper to detect top of CXL device topology Dave Jiang
2025-08-15 12:50   ` Jonathan Cameron
2025-08-20 13:51   ` Robert Richter
2025-08-14 22:21 ` [PATCH v8 02/11] cxl: Add helper to reap dport Dave Jiang
2025-08-20 14:10   ` Robert Richter
2025-08-20 20:54     ` Dave Jiang
2025-08-14 22:21 ` [PATCH v8 03/11] cxl: Add a cached copy of target_map to cxl_decoder Dave Jiang
2025-08-15 12:52   ` Jonathan Cameron
2025-08-20 14:17   ` Robert Richter
2025-08-14 22:21 ` [PATCH v8 04/11] cxl: Move port register setup to first dport appear Dave Jiang
2025-08-15 12:57   ` Jonathan Cameron
2025-08-21 11:57     ` Robert Richter
2025-08-22 10:37   ` Robert Richter
2025-08-14 22:21 ` [PATCH v8 05/11] cxl: Defer dport allocation for switch ports Dave Jiang
2025-08-20 12:41   ` Robert Richter
2025-08-20 15:20     ` Dave Jiang
2025-08-22  9:59       ` Robert Richter
2025-08-22 15:52         ` Dave Jiang
2025-08-26  7:51           ` Robert Richter
2025-08-27 17:05             ` Dave Jiang
2025-08-29 15:02               ` Robert Richter
2025-08-29 17:23                 ` Dave Jiang
2025-09-01 14:48                   ` Robert Richter
2025-09-02 15:58                     ` Dave Jiang
2025-08-27 21:15     ` Dave Jiang
2025-09-01 17:29       ` Robert Richter
2025-09-02 15:40         ` Dave Jiang
2025-09-03 18:21         ` Dave Jiang
2025-08-27 21:37     ` Dave Jiang
2025-08-14 22:21 ` [PATCH v8 06/11] cxl/test: Add cxl_test support for cxl_port_get_possible_dports() Dave Jiang
2025-08-14 22:21 ` [PATCH v8 07/11] cxl/test: Add mock version of devm_cxl_add_dport_by_dev() Dave Jiang
2025-08-14 22:21 ` [PATCH v8 08/11] cxl/test: Add support to cxl_test for decoder enumeration mock functions Dave Jiang
2025-08-14 22:21 ` [PATCH v8 09/11] cxl/test: Setup target_map for cxl_test decoder initialization Dave Jiang
2025-08-15 13:04   ` Jonathan Cameron
2025-08-14 22:21 ` [PATCH v8 10/11] cxl: Change sslbis handler to only handle single dport Dave Jiang
2025-08-14 22:21 ` [PATCH v8 11/11] tools/testing/cxl: Add decoder save/restore support Dave Jiang
2025-08-15 13:15   ` Jonathan Cameron
2025-08-19  9:39 ` [PATCH v8 00/11] cxl: Delay HB port and switch dport probing until endpoint dev probe Robert Richter
2025-08-19 15:41   ` Dave Jiang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox