Page MenuHomeFreeBSD

thunderbolt: Fix tb_pcib device matching to check PCI class
ClosedPublic

Authored by guest-seuros on Wed, Feb 4, 5:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Feb 12, 9:40 PM
Unknown Object (File)
Thu, Feb 12, 2:24 AM
Unknown Object (File)
Wed, Feb 11, 9:27 PM
Unknown Object (File)
Sat, Feb 7, 10:08 PM
Subscribers

Details

Summary

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).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

guest-seuros held this revision as a draft.
guest-seuros edited the summary of this revision. (Show Details)
guest-seuros added a reviewer: obiwac.

This makes sense, but do note that light ridge is not currently in tb_pcib_identifiers and probably won't be supported any time soon (if ever) due to it I'd assume using an internal connection manager

I will test this once I get back to USB4 work

sys/dev/thunderbolt/tb_pcib.c
122

maybe this comment could be more explicit and mention that some controllers have the same ID for the bridge and NHI

This revision is now accepted and ready to land.Wed, Feb 4, 11:53 PM

I have the full thunderbolt 1/2/3/4 work lined up... I'm trying to split them into smaller chuncks .

I still need to handle the detach and suspend (they crash) in TB1 then i will measure the speeds.

guest-seuros: Could you test D54158 if you have an easy way to do so?