Skip to content

cxl: Delay HB port and switch dport probing until endpoint dev probe

Dave Jiang linux-cxl 9 versions – Applied

Status from this message: Applied to cxl/next with minor fixes from comments:

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v9 Latest10 patches 13 repliesApplied
  2. v811 patches 28 repliesSuperseded
  3. v710 patches 29 repliesSuperseded
Earlier versions · 6
VersionPostedPatchesRepliesStatus
v610 patches8 repliesSuperseded
v510 patches9 repliesSuperseded
v49 patches11 repliesSuperseded
v39 patches16 repliesSuperseded
v210 patches43 repliesSuperseded
v11 patch4 repliesSuperseded

Changes in v9 from the cover letter

- Reworked the port enumeration iteration loop. (Robert)
All please re-review "cxl: Defer dport allocation for switch ports"
- Created helper functions for dealing with switch and endpoint decoder enumeration. Main goal is to reduce cxl_test interface burden. (Robert)
- Dropped cxl_test changes for decoder functions
- Dropped the cxl_test for region replay. It's not 100% ready and can be submitted later. (Alison)
- See specific commits for more detailed changes.

Patches in v9 Applied

#Subject and filesSizeRepliesApplied
1/10cxl: Add helper to detect top of CXL device topologydrivers/cxl/core/port.c+11 -60 replies
2/10cxl: Add helper to reap dportdrivers/cxl/core/port.c+14 -81 reply
3/10cxl: Add a cached copy of target_map to cxl_decoderdrivers/cxl/acpi.c drivers/cxl/core/hdm.c drivers/cxl/core/port.c +3 more+31 -382 replies
4/10cxl: Move port register setup to first dport appeardrivers/cxl/core/port.c drivers/cxl/cxl.h+15 -31 reply
5/10cxl/test: Refactor decoder setup to reduce cxl_test burdendrivers/cxl/core/core.h drivers/cxl/core/hdm.c drivers/cxl/core/pci.c +7 more+170 -1333 replies
6/10cxl: Defer dport allocation for switch portsdrivers/cxl/core/cdat.c drivers/cxl/core/core.h drivers/cxl/core/hdm.c +3 more+247 -602 replies
7/10cxl/test: Add mock version of devm_cxl_add_dport_by_dev()drivers/cxl/core/core.h drivers/cxl/core/pci.c drivers/cxl/cxl.h +6 more+123 -70 replies
8/10cxl/test: Adjust the mock version of devm_cxl_switch_port_decoders_setup()drivers/cxl/core/hdm.c drivers/cxl/cxl.h tools/testing/cxl/Kbuild +3 more+25 -72 replies
9/10cxl/test: Setup target_map for cxl_test decoder initializationtools/testing/cxl/test/cxl.c+9 -31 reply
10/10cxl: Change sslbis handler to only handle single dportdrivers/cxl/core/cdat.c drivers/cxl/core/port.c drivers/cxl/cxl.h+12 -150 replies

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by.

PatchJonathan CameronLi MingDan WilliamsAlison SchofieldRobert RichterGregory Price
1/10R-b R-b R-b R-b R-b T-b
2/10R-b R-b R-b R-b T-b
3/10R-b R-b R-b T-b
4/10R-b R-b T-b
5/10R-b R-b R-b
6/10R-b R-b
7/10R-b R-b T-b T-b
8/10R-b R-b
9/10R-b R-b T-b
10/10R-b R-b R-b R-b T-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 6 reviewers.

Read the v9 thread

Cover letter [PATCH v9 00/10] cxl: Delay HB port and switch dport probing until endpoint dev probe

v9:
- Reworked the port enumeration iteration loop. (Robert)
All please re-review "cxl: Defer dport allocation for switch ports"
- Created helper functions for dealing with switch and endpoint decoder enumeration. Main goal is to reduce cxl_test interface burden. (Robert)
- Dropped cxl_test changes for decoder functions
- Dropped the cxl_test for region replay. It's not 100% ready and can be submitted later. (Alison)
- See specific commits for more detailed changes.

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/[email protected]/

Dave Jiang (10):
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/test: Refactor decoder setup to reduce cxl_test burden
cxl: Defer dport allocation for switch ports cxl/test: Add mock version of devm_cxl_add_dport_by_dev() cxl/test: Adjust the mock version of
devm_cxl_switch_port_decoders_setup()
cxl/test: Setup target_map for cxl_test decoder initialization
cxl: Change sslbis handler to only handle single dport

 drivers/cxl/acpi.c                   |   7 +-
 drivers/cxl/core/cdat.c              |  25 +--
 drivers/cxl/core/core.h              |   5 +
 drivers/cxl/core/hdm.c               | 105 ++++++---
 drivers/cxl/core/pci.c               |  89 ++++++++
 drivers/cxl/core/port.c              | 317 ++++++++++++++++++++-------
 drivers/cxl/core/region.c            |   4 +-
 drivers/cxl/cxl.h                    |  44 +++-
 drivers/cxl/cxlpci.h                 |   2 -
 drivers/cxl/port.c                   |  47 +---
 tools/testing/cxl/Kbuild             |   7 +-
 tools/testing/cxl/cxl_core_exports.c |  22 ++
 tools/testing/cxl/exports.h          |  13 ++
 tools/testing/cxl/test/cxl.c         | 115 ++++++++--
 tools/testing/cxl/test/mock.c        |  96 +++-----
 tools/testing/cxl/test/mock.h        |   9 +-
 16 files changed, 642 insertions(+), 265 deletions(-)
 create mode 100644 tools/testing/cxl/exports.h

base-commit: 8f5ae30d69d7543eee0d70083daf4de8fe15d585

Signature · 1 line
2.50.1