git: 067ad8b31bf6 - main - thunderbolt: Fix tb_pcib device matching to check PCI class
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 06 Feb 2026 16:15:34 UTC
The branch main has been updated by obiwac:
URL: https://cgit.FreeBSD.org/src/commit/?id=067ad8b31bf68b6dcf1ad571746349ed88d63d00
commit 067ad8b31bf68b6dcf1ad571746349ed88d63d00
Author: Abdelkader Boudih <guest-seuros@FreeBSD.org>
AuthorDate: 2026-02-06 16:12:56 +0000
Commit: Aymeric Wibo <obiwac@FreeBSD.org>
CommitDate: 2026-02-06 16:13:12 +0000
thunderbolt: Fix tb_pcib device matching to check PCI class
Light Ridge and earlier Thunderbolt controllers reuse the same device ID
(0x1513) for both the NHI (class 0x088000) and PCI bridges (class
0x060400).
Without checking the PCI class, tb_pcib would incorrectly match NHI
devices, causing a panic when trying to attach bridge code to non-bridge
hardware.
Add PCI class check to tb_pcib_find_ident() to only match actual PCI-PCI
bridges (PCIC_BRIDGE/PCIS_BRIDGE_PCI).
Reviewed by: obiwac, jhb
Approved by: obiwac, jhb
Fixes: 2ed9833791f2 (thunderbolt: Import USB4 code)
Differential Revision: https://reviews.freebsd.org/D55102
---
sys/dev/thunderbolt/tb_pcib.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/sys/dev/thunderbolt/tb_pcib.c b/sys/dev/thunderbolt/tb_pcib.c
index e6f0115364da..ffb85ebec9ae 100644
--- a/sys/dev/thunderbolt/tb_pcib.c
+++ b/sys/dev/thunderbolt/tb_pcib.c
@@ -119,6 +119,10 @@ tb_pcib_find_ident(device_t dev)
for (n = tb_pcib_identifiers; n->vendor != 0; n++) {
if ((n->vendor != v) || (n->device != d))
continue;
+ /* Only match actual PCI-PCI bridges to avoid conflict with NHI */
+ if (pci_get_class(dev) != PCIC_BRIDGE ||
+ pci_get_subclass(dev) != PCIS_BRIDGE_PCI)
+ continue;
if (((n->subvendor != 0xffff) && (n->subvendor != sv)) ||
((n->subdevice != 0xffff) && (n->subdevice != sd)))
continue;