Skip to content

Conversation

dsg22
Copy link

@dsg22 dsg22 commented Aug 30, 2025

These are only needed because Qubes disabled PCI hotplugging in kernel config. If the user compiled a kernel with it enabled, the kernel does PM better.

These are only needed because Qubes disabled PCI hotplugging in kernel
config. If the user compiled a kernel with it enabled, the kernel does
PM better.
@dsg22 dsg22 force-pushed the feature-dont-use-pm-override-if-pci-hotplug-enabled branch from 017e5de to 454dd54 Compare August 30, 2025 22:06
@codecov
Copy link

codecov bot commented Aug 30, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 70.55%. Comparing base (a930d4e) to head (454dd54).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #727   +/-   ##
=======================================
  Coverage   70.55%   70.55%           
=======================================
  Files          61       61           
  Lines       13642    13642           
=======================================
  Hits         9625     9625           
  Misses       4017     4017           
Flag Coverage Δ
unittests 70.55% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DemiMarie
Copy link
Contributor

Would it be possible for the Linux kernel to handle power management even with PCI hotplug disabled?

@dsg22
Copy link
Author

dsg22 commented Aug 31, 2025

Would it be possible for the Linux kernel to handle power management even with PCI hotplug disabled?

I have no idea, sadly. I think @HW42 can probably explain it. My understanding is that the reason for his suspend PM patches is because of this inability to do power managment when virtualisation is in use and PCI hotplug disabled. I'm curious about the details myself.

@marmarek
Copy link
Member

See description of the patch adding this option: https://github.com/QubesOS/qubes-linux-kernel/blob/main/xen-pciback-pm-suspend.patch

@dsg22
Copy link
Author

dsg22 commented Aug 31, 2025

See description of the patch adding this option: https://github.com/QubesOS/qubes-linux-kernel/blob/main/xen-pciback-pm-suspend.patch

It doesn't really explain the problem that motivated the patch though, beyond that it doesn't work "for some, not yet fully clear, reasons". But I guess maybe we still don't know what's causing it. If so, it's not possible to answer @DemiMarie's question.

@RealityAnomaly
Copy link
Contributor

See description of the patch adding this option: https://github.com/QubesOS/qubes-linux-kernel/blob/main/xen-pciback-pm-suspend.patch

It doesn't really explain the problem that motivated the patch though, beyond that it doesn't work "for some, not yet fully clear, reasons". But I guess maybe we still don't know what's causing it. If so, it's not possible to answer @DemiMarie's question.

It's actually pretty simple what causes it. This line https://github.com/torvalds/linux/blob/c8bc81a52d5a2ac2e4b257ae123677cf94112755/drivers/pci/pci-acpi.c#L820 causes pciehp_is_native to return false for any Thunderbolt ports, which in turn causes pci_bridge_d3_possible to return false for those ports: https://github.com/torvalds/linux/blob/c8bc81a52d5a2ac2e4b257ae123677cf94112755/drivers/pci/pci.c#L3060 and hence the kernel completely blocks D3 for the ports.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants