Runtime PM has been kind of unreliable with GSP for a while. It works well enough to shut the GPU off and turn it back on, but more often then not it ends up leaving the GPU in a broken state on resume - which makes it impossible to really do anything else with it.
Recently however, I discovered that it's been failing much harder on some ampere systems. This lead me down a rabbit hole that lead me to figure out one of our previous fixes for runtime PM wasn't correct. After fixing that and combining it with some fixes we had tried in the past without success, I finally managed to get nouveau to handle runtime PM with the GSP perfectly. These are those fixes. Patch-series wide changes since V2: * Drop the patch for switching oldLevel from LEVEL_3 to LEVEL_4. If I'm understanding OpenRM correctly, LEVEL_3 corresponds to PCI D3 power state and is intended for use on systems with ACPI. To be clear, I mean ACPI support generally - it doesn't appear to specifically refer to laptop-specific ACPI handles like _DSM or the like. In an unexpected twist, it appears LEVEL_4 actually corresponds to APM (as in "Advanced Power Management", e.g. pre-ACPI)! After re-testing my local setups I wasn't able to find any significant behavior difference between LEVEL_3 and LEVEL_4, so let's be conservative and leave this be for now. It still may be worth looking into the future why I've seen OpenRM specifically call-out APM suspend being requested in debug builds instead of S3. I wouldn't expect APM to actually work with modern Nvidia hardware, but it's always possible there's some other reason they still use this Tested on a Lenovo P16 G1 (100 runtime PM cycles!), and RTX4000. Previous version of the patch series: https://patchwork.freedesktop.org/series/169457/ Lyude Paul (3): Revert "nouveau/gsp: fix suspend/resume regression on r570 firmware" drm/nouveau/gsp/r570: Never enter Gcoff state drm/nouveau/gsp/r570: Add missing state flags to GSP resume arguments drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/fbsr.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r535/gsp.c | 2 +- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/fbsr.c | 8 ++++---- drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c | 3 ++- .../gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/nvrm/gsp.h | 8 ++++++++ drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h | 2 +- 6 files changed, 17 insertions(+), 8 deletions(-) base-commit: cff96362794a5c1f3adb013b4a46c7233149a629 -- 2.54.0
