]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/xe/pm: Also avoid missing outer rpm warning on system suspend
authorRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 17 Dec 2024 23:05:47 +0000 (18:05 -0500)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Fri, 20 Dec 2024 19:17:02 +0000 (14:17 -0500)
Fix the false-positive "Missing outer runtime PM protection" warning
triggered by
release_async_domains() -> intel_runtime_pm_get_noresume() ->
xe_pm_runtime_get_noresume()
during system suspend.

xe_pm_runtime_get_noresume() is supposed to warn if the device is not in
the runtime resumed state, using xe_pm_runtime_get_if_in_use() for this.
However the latter function will fail if called during runtime or system
suspend/resume, regardless of whether the device is runtime resumed or
not.

Based on the above suppress the warning during system suspend/resume,
similarly to how this is done during runtime suspend/resume.

Suggested-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241217230547.1667561-1-rodrigo.vivi@intel.com
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_pm.c

index 80699dbeb2e9d5f2cf40aee199e89634dd2d5f93..85cfec5ec9affda14cb08597b67db22c2989544d 100644 (file)
@@ -7,6 +7,7 @@
 
 #include <linux/fault-inject.h>
 #include <linux/pm_runtime.h>
+#include <linux/suspend.h>
 
 #include <drm/drm_managed.h>
 #include <drm/ttm/ttm_placement.h>
@@ -607,7 +608,8 @@ static bool xe_pm_suspending_or_resuming(struct xe_device *xe)
        struct device *dev = xe->drm.dev;
 
        return dev->power.runtime_status == RPM_SUSPENDING ||
-               dev->power.runtime_status == RPM_RESUMING;
+               dev->power.runtime_status == RPM_RESUMING ||
+               pm_suspend_target_state != PM_SUSPEND_ON;
 #else
        return false;
 #endif