@@ -416,7 +416,7 @@ int xe_pm_runtime_suspend(struct xe_device *xe)
416416 xe_display_pm_suspend_late (xe );
417417out :
418418 if (err )
419- xe_display_pm_resume (xe , true );
419+ xe_display_pm_runtime_resume (xe );
420420 xe_rpm_lockmap_release (xe );
421421 xe_pm_write_callback_task (xe , NULL );
422422 return err ;
@@ -595,6 +595,22 @@ bool xe_pm_runtime_get_if_in_use(struct xe_device *xe)
595595 return pm_runtime_get_if_in_use (xe -> drm .dev ) > 0 ;
596596}
597597
598+ /*
599+ * Very unreliable! Should only be used to suppress the false positive case
600+ * in the missing outer rpm protection warning.
601+ */
602+ static bool xe_pm_suspending_or_resuming (struct xe_device * xe )
603+ {
604+ #ifdef CONFIG_PM
605+ struct device * dev = xe -> drm .dev ;
606+
607+ return dev -> power .runtime_status == RPM_SUSPENDING ||
608+ dev -> power .runtime_status == RPM_RESUMING ;
609+ #else
610+ return false;
611+ #endif
612+ }
613+
598614/**
599615 * xe_pm_runtime_get_noresume - Bump runtime PM usage counter without resuming
600616 * @xe: xe device instance
@@ -611,8 +627,11 @@ void xe_pm_runtime_get_noresume(struct xe_device *xe)
611627
612628 ref = xe_pm_runtime_get_if_in_use (xe );
613629
614- if (drm_WARN ( & xe -> drm , !ref , "Missing outer runtime PM protection\n" ))
630+ if (!ref ) {
615631 pm_runtime_get_noresume (xe -> drm .dev );
632+ drm_WARN (& xe -> drm , !xe_pm_suspending_or_resuming (xe ),
633+ "Missing outer runtime PM protection\n" );
634+ }
616635}
617636
618637/**
0 commit comments