All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC/RFT PATCH 0/3] Prepwork for non-PCIe NHI/TBT hosts
@ 2026-03-09 10:32 Konrad Dybcio
  2026-03-09 10:32 ` [PATCH RFC/RFT 1/3] thunderbolt: Move pci_device out of tb_nhi Konrad Dybcio
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Konrad Dybcio @ 2026-03-09 10:32 UTC (permalink / raw)
  To: Andreas Noever, Mika Westerberg, Yehezkel Bernat
  Cc: linux-kernel, linux-usb, usb4-upstream, Raghavendra Thoorpu,
	Konrad Dybcio

Currently, the NHI driver (and other parts of the TBT framework) make
multiple assumptions about the host router being a PCIe device. This
series tries to decouple them by moving the 'struct pci_device' out of
the NHI code and introduce NHI-on-PCIe-specific abstractions where
necessary (with no functional change).

The intended usage of the new nhi_probe_common() is pretty similar to
other bus frameworks (I2C, SPI, USB..), i.e.:

static int foo_bar_probe() {
	// get SoC-specifc resources (clks, regulators..)

	// power things on

	// set some implementation-specific registers

	// register NHI and all the sub-devices
	ret = nhi_probe_common(&my_usb4->nhi)
	...

	// cleanup boilerplate
}

Instead of the previously-suggested aux/fauxbus, the NHI device remains
the same 'struct dev' as the PCIe/platform/[...] device that provides
it. This is in line with some other buses and it makes things easier
from the PM perspective.

Compile-tested only for the PCIe case. The Qualcomm USB4 driver that
leverages this patchset is unfortunately still work in progress and
will be shared at a later time. Nonetheless, we need to get this
non-PCIe topic sorted.

Signed-off-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
---
Konrad Dybcio (3):
      thunderbolt: Move pci_device out of tb_nhi
      thunderbolt: Separate out common NHI bits
      thunderbolt: Add some more descriptive probe error messages

 drivers/thunderbolt/Makefile    |   2 +-
 drivers/thunderbolt/acpi.c      |  14 +-
 drivers/thunderbolt/ctl.c       |  14 +-
 drivers/thunderbolt/domain.c    |   2 +-
 drivers/thunderbolt/eeprom.c    |   2 +-
 drivers/thunderbolt/icm.c       |  25 +-
 drivers/thunderbolt/nhi.c       | 494 ++++++---------------------------------
 drivers/thunderbolt/nhi.h       |  32 +++
 drivers/thunderbolt/nhi_ops.c   |  31 ++-
 drivers/thunderbolt/nhi_pci.c   | 496 ++++++++++++++++++++++++++++++++++++++++
 drivers/thunderbolt/nhi_pci.h   |  22 ++
 drivers/thunderbolt/switch.c    |  41 +---
 drivers/thunderbolt/tb.c        |  76 +-----
 drivers/thunderbolt/tb.h        |  10 +-
 drivers/thunderbolt/usb4_port.c |   2 +-
 include/linux/thunderbolt.h     |   5 +-
 16 files changed, 699 insertions(+), 569 deletions(-)
---
base-commit: fc7b1a72c6cd5cbbd989c6c32a6486e3e4e3594d
change-id: 20260309-topic-usb4_nonpcie_prepwork-86881f769b8f

Best regards,
-- 
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>


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

end of thread, other threads:[~2026-03-10  5:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-09 10:32 [RFC/RFT PATCH 0/3] Prepwork for non-PCIe NHI/TBT hosts Konrad Dybcio
2026-03-09 10:32 ` [PATCH RFC/RFT 1/3] thunderbolt: Move pci_device out of tb_nhi Konrad Dybcio
2026-03-09 11:49   ` Mika Westerberg
2026-03-09 10:33 ` [PATCH RFC/RFT 2/3] thunderbolt: Separate out common NHI bits Konrad Dybcio
2026-03-09 11:51   ` Mika Westerberg
2026-03-09 10:33 ` [PATCH RFC/RFT 3/3] thunderbolt: Add some more descriptive probe error messages Konrad Dybcio
2026-03-09 11:53   ` Mika Westerberg
2026-03-10  5:40 ` [RFC/RFT PATCH 0/3] Prepwork for non-PCIe NHI/TBT hosts Mika Westerberg

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.