Skip to content

Commit

Permalink
hps: Replace explicit power-management with runtime PM
Browse files Browse the repository at this point in the history
Instead of manually trying to set the dGPU power and fighting the PCI/PM
core every step of the way, enable proper D3cold support for the dGPU
and let (runtime-)PM take care of it.

Manual power control, among other things, causes race-conditions with
the PCI/PM core and was only required because the core did not properly
(runtime-)suspend the dGPU, i.e. did not transition it into D3cold.
These race conditions have lead to device lock-ups during resume and
shutdown, requiring a forced power-off.

By addressing this issue more directly, i.e. fixing the issues
preventing D3cold, we can get the PCI/PM core to automatically shut down
the device when not in use by simply putting it into D3cold and turning
off all related ACPI power-regions. Note that this yields essentially
the same results as us turning it of manually via the hacks used before,
minus race conditions.

In combination with runtime suspend, which can be enabled from
user-space, the device will automatically be transitioned into D3cold
when not in use, even if the system itself has not been suspended, and
automatically brought out of D3cold if needed. This also seems to work
quite well with the nvidia driver loaded and

    NVreg_DynamicPowerManagement=0x02

set via the nvidia module options.

A dedicated surface_hotplug driver is still required, although only for
out-of-band hot-plug event signalling. This signalling is necessary if
the PCI device (i.e. dGPU) is in D3cold and can thus not send PCIe
hot-plug events itself. These events are received by the driver via GPIO
interrupts and then forwarded to ACPI, which will trigger the
appropriate device-check notifications. These notifications are then, in
turn, picked up and handled by the PCIe hot-plug driver.
  • Loading branch information
qzed committed Nov 2, 2020
1 parent 02f70f4 commit 4138dab
Showing 1 changed file with 154 additions and 1,170 deletions.
Loading

0 comments on commit 4138dab

Please sign in to comment.