Skip to content

Commit ad92f52

Browse files
rodrigovivilucasdemarchi
authored andcommitted
drm/xe: Suppress missing outer rpm protection warning
Do not raise a WARN if we are likely within suspending or resuming path. This is likely this false positive: rpm_status: 0000:03:00.0 status=RPM_SUSPENDING console: xe_bo_evict_all (called from suspend) xe_sched_job_create: dev=0000:03:00.0, ... xe_sched_job_exec: dev=0000:03:00.0, ... xe_pm_runtime_put: dev=0000:03:00.0, ... xe_sched_job_run: dev=0000:03:00.0, ... rpm_usage: 0000:03:00.0 flags-0 cnt-2 ... rpm_usage: 0000:03:00.0 flags-0 cnt-2 ... rpm_usage: 0000:03:00.0 flags-0 cnt-2 ... console: xe 0000:03:00.0: [drm] Missing outer runtime PM protection console: xe_guc_ct_send+0x15/0x50 [xe] console: guc_exec_queue_run_job+0x1509/0x3950 [xe] [snip] console: drm_sched_run_job_work+0x649/0xc20 At this point, BOs are getting evicted from VRAM with rpm usage-counter = 2, but rpm status = SUSPENDING. The xe->pm_callback_task won't be equal 'current' because this call is coming from a work queue. So, pm_runtime_get_if_active() will be called and return 0 because rpm status != ACTIVE (but equal SUSPENDING or RESUMING). v2: Still get the reference even on non suspending/resuming path (Jonathan, Brost). Cc: Matthew Brost <[email protected]> Cc: Matthew Auld <[email protected]> Reviewed-by: Jonathan Cavitt <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Rodrigo Vivi <[email protected]> (cherry picked from commit cb85e39) Signed-off-by: Lucas De Marchi <[email protected]>
1 parent 83dcf23 commit ad92f52

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

drivers/gpu/drm/xe/xe_pm.c

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,6 +595,18 @@ 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+
struct device *dev = xe->drm.dev;
605+
606+
return dev->power.runtime_status == RPM_SUSPENDING ||
607+
dev->power.runtime_status == RPM_RESUMING;
608+
}
609+
598610
/**
599611
* xe_pm_runtime_get_noresume - Bump runtime PM usage counter without resuming
600612
* @xe: xe device instance
@@ -611,8 +623,11 @@ void xe_pm_runtime_get_noresume(struct xe_device *xe)
611623

612624
ref = xe_pm_runtime_get_if_in_use(xe);
613625

614-
if (drm_WARN(&xe->drm, !ref, "Missing outer runtime PM protection\n"))
626+
if (!ref) {
615627
pm_runtime_get_noresume(xe->drm.dev);
628+
drm_WARN(&xe->drm, !xe_pm_suspending_or_resuming(xe),
629+
"Missing outer runtime PM protection\n");
630+
}
616631
}
617632

618633
/**

0 commit comments

Comments
 (0)