Skip to content

PCI: pciehp / thunderbolt: Fix resume with a slow Thunderbolt host link

Cole Leavitt linux-pci linux-usb lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2PCI: pciehp: Defer device replacement handling until ->resume()drivers/pci/hotplug/pciehp_core.c+24 -20 replies
2/2thunderbolt: Don't resume the software CM if the host controller is gonedrivers/thunderbolt/tb.c+13 -04 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] PCI: pciehp / thunderbolt: Fix resume with a slow Thunderbolt host link

On a Lenovo ThinkPad P16 Gen 3 with a discrete Intel JHL9580 (Barlow Ridge) Thunderbolt 5 host controller below Root Port 0000:80:1b.4, resume from suspend-to-idle intermittently hangs with a black screen. The link to the controller is not up in time when the Root Port leaves D3cold, pciehp concludes that the device in the slot was replaced, and the resulting removal races with the thunderbolt driver's ->resume_noirq() callback, which dereferences tb->root_switch after tb_stop() cleared it.

Patch 1 defers acting on the synthesized Presence Detect Changed event in pciehp until the ->resume() phase, where the PM core serializes the removal against the drivers below the port.

Patch 2 stops the thunderbolt software connection manager from going through its resume sequence when nhi_resume_noirq() already found that the host controller is gone. Without it every control channel request fails with -ESHUTDOWN and triggers a WARN in tb_cfg_read() or tb_cfg_write().

The patches are independent and can be applied through the PCI and thunderbolt trees separately.

Cole Leavitt (2):
PCI: pciehp: Defer device replacement handling until ->resume()
thunderbolt: Don't resume the software CM if the host controller is
gone

 drivers/pci/hotplug/pciehp_core.c | 26 ++++++++++++++++++++++++--
 drivers/thunderbolt/tb.c          | 13 +++++++++++++
 2 files changed, 37 insertions(+), 2 deletions(-)

base-commit: 32c52ec87d6245ee2d12ed5dd509e40062939b50

Signature · 1 line
2.54.0