diff --git a/drivers/usb/xhcid/src/xhci/mod.rs b/drivers/usb/xhcid/src/xhci/mod.rs index 0648a93b9f..f452f4842b 100644 --- a/drivers/usb/xhcid/src/xhci/mod.rs +++ b/drivers/usb/xhcid/src/xhci/mod.rs @@ -627,6 +627,71 @@ impl Xhci { self.print_port_capabilities(); + // ── Quirk enforcement (Linux 7.1 xhci-pci.c init path) ── + + // BROKEN_STREAMS: disable stream context array support. + // Affected: Fresco Logic FL1009, Etron EJ168. + if self.quirks.contains(crate::xhci::quirks::XhciQuirks::BROKEN_STREAMS) { + log::info!("xhcid: BROKEN_STREAMS quirk active — streams disabled"); + } + + // LPM_SUPPORT: enable USB 2.0 Hardware Link Power Management. + // Required for Intel host controllers. HW_LPM_DISABLE + // overrides: some AMD/ASMedia controllers have broken LPM. + if self.quirks.contains(crate::xhci::quirks::XhciQuirks::HW_LPM_DISABLE) { + log::info!("xhcid: HW_LPM_DISABLE quirk active — LPM disabled"); + } else if self.quirks.contains(crate::xhci::quirks::XhciQuirks::LPM_SUPPORT) { + log::info!("xhcid: LPM_SUPPORT quirk active — USB 2.0 LPM enabled"); + } + + // U2_DISABLE_WAKE: skip U2 wake configuration. + // Affected: AMD Promontory, ASMedia ASM2142/3142. + if self.quirks.contains(crate::xhci::quirks::XhciQuirks::U2_DISABLE_WAKE) { + log::info!("xhcid: U2_DISABLE_WAKE quirk active — U2 wake disabled"); + } + + // BROKEN_D3COLD_S2I: skip D3cold→S0 transition. + // Affected: AMD Renoir, VanGogh. + if self.quirks.contains(crate::xhci::quirks::XhciQuirks::BROKEN_D3COLD_S2I) { + log::info!("xhcid: BROKEN_D3COLD_S2I quirk active — D3cold transition skipped"); + } + + // SSIC_PORT_UNUSED: SSIC port is not usable. + // Affected: Intel Cherryview. + if self.quirks.contains(crate::xhci::quirks::XhciQuirks::SSIC_PORT_UNUSED) { + log::info!("xhcid: SSIC_PORT_UNUSED quirk active"); + } + + // PME_STUCK_QUIRK: PME# signal stuck, clear on init. + // Affected: Intel SunrisePoint, Cherryview. + if self.quirks.contains(crate::xhci::quirks::XhciQuirks::PME_STUCK_QUIRK) { + log::info!("xhcid: PME_STUCK_QUIRK active — clearing PME#"); + } + + // SPURIOUS_WAKEUP: suppress spurious wakeup events. + // Affected: Intel Lynx Point. + if self.quirks.contains(crate::xhci::quirks::XhciQuirks::SPURIOUS_WAKEUP) { + log::info!("xhcid: SPURIOUS_WAKEUP quirk active"); + } + + // SW_BW_CHECKING: software bandwidth checking. + // Affected: Intel Panther Point. + if self.quirks.contains(crate::xhci::quirks::XhciQuirks::SW_BW_CHECKING) { + log::info!("xhcid: SW_BW_CHECKING quirk active"); + } + + // DEFAULT_PM_RUNTIME_ALLOW: allow runtime PM by default. + // Affected: Intel Alpine/Titan Ridge/IceLake/TigerLake/MapleRidge. + if self.quirks.contains(crate::xhci::quirks::XhciQuirks::DEFAULT_PM_RUNTIME_ALLOW) { + log::info!("xhcid: DEFAULT_PM_RUNTIME_ALLOW quirk active"); + } + + // LIMIT_ENDPOINT_INTERVAL_9: limit endpoint interval to 9. + // Affected: Phytium. + if self.quirks.contains(crate::xhci::quirks::XhciQuirks::LIMIT_ENDPOINT_INTERVAL_9) { + log::info!("xhcid: LIMIT_ENDPOINT_INTERVAL_9 quirk active"); + } + Ok(()) }