Skip to content

Commit

Permalink
Keep TBT active on bonw15-b
Browse files Browse the repository at this point in the history
Under normal operation, the control channel will be stopped after a
short time of no activity:

    thunderbolt 0000:05:00.0: control channel stopped

However, hot-plug detection of displays in USB-C ports do not work if
the device is not in D0; The USD HPD itself does not wake the TBT
controller.

Signed-off-by: Tim Crawford <[email protected]>
  • Loading branch information
crawfxrd committed Aug 13, 2024
1 parent f63c565 commit bb2627f
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/daemon/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -619,17 +619,20 @@ pub async fn daemon() -> anyhow::Result<()> {

fan_daemon.step();

// HACK: As of Linux 6.9.3, TBT5 controller must be active for HPD
// to work on USB-C ports.
match thunderbolt_hotplug_wakeup(&vendor, &model) {
Ok(()) => (),
Err(err) => {
log::warn!("Failed to wakeup thunderbolt on hotplug: {}", err);
}
}

let hpd = hpd();
for i in 0..hpd.len() {
if hpd[i] != last[i] && hpd[i] {
log::info!("HotPlugDetect {}", i);
let _res = System76Power::hot_plug_detect(&context, i as u64).await;
match thunderbolt_hotplug_wakeup(&vendor, &model) {
Ok(()) => (),
Err(err) => {
log::warn!("Failed to wakeup thunderbolt on hotplug: {}", err);
}
}
}
}

Expand Down

0 comments on commit bb2627f

Please sign in to comment.