All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] add support platform nhi driver
@ 2026-10-30  8:25 Chunfeng Yun
  2026-10-30  8:25 ` [PATCH 1/4] thunderbolt: add " Chunfeng Yun
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Chunfeng Yun @ 2026-10-30  8:25 UTC (permalink / raw)
  To: Mika Westerberg
  Cc: Andreas Noever, Yehezkel Bernat, Matthias Brugger,
	Greg Kroah-Hartman, AngeloGioacchino Del Regno, linux-kernel,
	linux-usb, linux-arm-kernel, linux-mediatek, Chunfeng Yun

This patch series introduces support for platform bus-based USB4/Thunderbolt
Host Interface (NHI) controllers on embedded SoCs, along with two fixes/
improvements in the Thunderbolt core connection manager.

Historically, the Thunderbolt NHI driver has assumed a PCI bus binding
(pci.c), with tb_domain_init()/exit() tightly coupled to the PCI module
lifecycle. Modern ARM64 SoCs integrate the USB4 NHI controller directly
onto the platform bus, described via Device Tree or ACPI.

This series decouples the core domain initialization from the PCI driver
and adds a dedicated platform driver (plat.c) supporting standard platform
probing, OF/ACPI device tables, runtime PM, and an optional dedicated
out-of-band wakeup IRQ.

Additionally, this series resolves two issues observed during runtime PM
and link training:
1. Premature link-up timeout when bringing up USB3 adapters on links with
   multiple retimers.
2. Kernel warnings when authorizing/de-authorizing PCIe tunnels on switches
   that have been marked unplugged or lost during suspend.

Patches in this series:
======================
Patch 1: thunderbolt: add platform nhi driver
  Decouples tb_domain_init()/exit() using subsys_initcall() and adds plat.c
  to support memory-mapped NHI host controllers on the platform bus with
  Device Tree (CONFIG_OF) and ACPI (CONFIG_ACPI) match tables.

Patch 2: thunderbolt: add support optional dedicated wakeup irq
  Adds support for an optional dedicated wakeup interrupt for platform NHI
  controllers using dev_pm_set_dedicated_wake_irq(), allowing out-of-band
  wake-up lines from SoC power management units during low-power states.

Patch 3: thunderbolt: improve usb3 adapter link up timeout value
  Increases tb_wait_for_port() timeout from 1.0s to 2.5s. In the USB4 spec,
  Phase 5 (Link Equalization) alone is permitted up to 1000 ms. When factoring
  in Phase 3/4 and retimer transaction delays across multiple retimers, link
  training can legitimately take 1.2s to 1.5s+. The previous 1.0s timeout
  caused premature aborts and disconnects upon wakeup.

Patch 4: thunderbolt: fix pcie tunnel create/destroy core dump
  Checks sw->is_unplugged in tb_switch_set_authorized(), tb_disconnect_pci(),
  and tb_tunnel_pci(). When de-authorizing an unplugged/lost switch via sysfs,
  this prevents redundant lookups and eliminates false-positive
  WARN_ON(!tunnel) stack traces when tunnels have already been destroyed.

Testing:
========
Tested on ARM64 platform hardware with USB4 hubs and downstream PCIe/USB3
devices across plug/unplug, system suspend/resume, and runtime PM transitions,
the kernel boots from UEFI/ACPI.

Chunfeng Yun (4):
  thunderbolt: add platform nhi driver
  thunderbolt: add support optional dedicated wakeup irq
  thunderbolt: improve usb3 adapter link up timeout value
  thunderbolt: prevent pcie tunnel activation/teardown warnings

 drivers/thunderbolt/Makefile |   2 +-
 drivers/thunderbolt/domain.c |  10 +-
 drivers/thunderbolt/nhi.c    |   2 +
 drivers/thunderbolt/nhi.h    |   1 -
 drivers/thunderbolt/pci.c    |  26 +-----
 drivers/thunderbolt/plat.c   | 171 +++++++++++++++++++++++++++++++++++
 drivers/thunderbolt/switch.c |   8 +-
 drivers/thunderbolt/tb.c     |   7 ++
 drivers/thunderbolt/tb.h     |   2 -
 include/linux/thunderbolt.h  |   2 +
 10 files changed, 200 insertions(+), 31 deletions(-)
 create mode 100644 drivers/thunderbolt/plat.c

-- 
2.43.0


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

end of thread, other threads:[~2026-10-30  9:01 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30  8:25 [PATCH 0/4] add support platform nhi driver Chunfeng Yun
2026-10-30  8:25 ` [PATCH 1/4] thunderbolt: add " Chunfeng Yun
2026-10-30  8:40   ` sashiko-bot
2026-10-30  8:47   ` Mika Westerberg
2026-10-30  8:25 ` [PATCH 2/4] thunderbolt: add support optional dedicated wakeup irq Chunfeng Yun
2026-10-30  8:48   ` Mika Westerberg
2026-10-30  8:50   ` sashiko-bot
2026-10-30  8:25 ` [PATCH 3/4] thunderbolt: improve usb3 adapter link up timeout value Chunfeng Yun
2026-10-30  8:50   ` Mika Westerberg
2026-10-30  8:54   ` sashiko-bot
2026-10-30  8:25 ` [PATCH 4/4] thunderbolt: prevent pcie tunnel activation/teardown warnings Chunfeng Yun
2026-10-30  8:56   ` Mika Westerberg
2026-10-30  9:01   ` sashiko-bot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.