From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: <intel-xe@lists.freedesktop.org>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>,
Paulo Zanoni <paulo.r.zanoni@intel.com>,
Anshuman Gupta <anshuman.gupta@intel.com>,
Francois Dugast <francois.dugast@intel.com>
Subject: [PATCH 1/2] drm/xe: Avoid fbdev suspend at runtime pm suspend
Date: Mon, 3 Jun 2024 17:52:17 -0400 [thread overview]
Message-ID: <20240603215218.14278-1-rodrigo.vivi@intel.com> (raw)
There's no need to suspend fbdev upon runtime_pm, and it is upseting
lockdep:
[ 313.150411] ======================================================
[ 313.150412] WARNING: possible circular locking dependency detected
[ 313.150413] 6.10.0-rc1pz+ #99 Tainted: G E
[ 313.150414] ------------------------------------------------------
[ 313.150414] kworker/2:0/33 is trying to acquire lock:
[ 313.150415] ffffffffb5f61340 (console_lock){+.+.}-{0:0}, at: intel_fbdev_set_suspend+0x115/0x1e0 [xe]
[ 313.150495]
but task is already holding lock:
[ 313.150495] ffffffffc0ce74a0 (xe_pm_runtime_lockdep_map){+.+.}-{0:0}, at: xe_pm_runtime_suspend+0x2a/0x2e0 [xe]
[ 313.150561]
which lock already depends on the new lock.
[snip]
-> #2 (xe_pm_runtime_lockdep_map){+.+.}-{0:0}:
[ 313.150563] xe_pm_runtime_resume_and_get+0x44/0xb0 [xe]
[ 313.150626] intelfb_create+0x150/0x360 [xe]
[snip]
[ 313.150932] xe_device_probe+0x439/0x4a0 [xe]
-> #1 (&helper->lock){+.+.}-{3:3}:
[snip]
[ 313.151097] intel_fbdev_set_par+0x16/0x60 [xe]
[snip]
[ 313.151402] xe_device_probe+0x439/0x4a0 [xe]
[snip]
-> #0 (console_lock){+.+.}-{0:0}:
[snip]
[ 313.151548] intel_fbdev_set_suspend+0x115/0x1e0 [xe]
[ 313.151607] xe_display_pm_suspend+0xd1/0x100 [xe]
[ 313.151679] xe_pm_runtime_suspend+0x2bf/0x2e0 [xe]
[snip]
[ 313.151817] Chain exists of:
console_lock --> &helper->lock --> xe_pm_runtime_lockdep_map
[ 313.151819] Possible unsafe locking scenario:
[ 313.151819] CPU0 CPU1
[ 313.151820] ---- ----
[ 313.151820] lock(xe_pm_runtime_lockdep_map);
[ 313.151821] lock(&helper->lock);
[ 313.151821] lock(xe_pm_runtime_lockdep_map);
[ 313.151822] lock(console_lock);
[ 313.151823]
*** DEADLOCK ***
Although we know that this scenario is a false positive because
runtime_pm suspend can never happen while the probe hasn't finished,
the best approach is to avoid the unnecessary calls.
Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
Cc: Anshuman Gupta <anshuman.gupta@intel.com>
Cc: Francois Dugast <francois.dugast@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
drivers/gpu/drm/xe/display/xe_display.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
index 2a9b4a4f2e71..cd97975344f1 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -333,7 +333,8 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
intel_opregion_suspend(xe, s2idle ? PCI_D1 : PCI_D3cold);
- intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
+ if (!runtime)
+ intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_SUSPENDED, true);
intel_dmc_suspend(xe);
}
@@ -383,7 +384,8 @@ void xe_display_pm_resume(struct xe_device *xe, bool runtime)
intel_opregion_resume(xe);
- intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_RUNNING, false);
+ if (!runtime)
+ intel_fbdev_set_suspend(&xe->drm, FBINFO_STATE_RUNNING, false);
intel_power_domains_enable(xe);
}
--
2.45.1
next reply other threads:[~2024-06-03 21:52 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-03 21:52 Rodrigo Vivi [this message]
2024-06-03 21:52 ` [PATCH 2/2] drm/xe: Ensure d3cold is only allowed in DGFX Rodrigo Vivi
2024-06-03 22:15 ` Zanoni, Paulo R
2024-06-04 15:03 ` Rodrigo Vivi
2024-06-04 22:46 ` ✓ CI.Patch_applied: success for series starting with [1/2] drm/xe: Avoid fbdev suspend at runtime pm suspend Patchwork
2024-06-04 22:47 ` ✓ CI.checkpatch: " Patchwork
2024-06-04 22:48 ` ✓ CI.KUnit: " Patchwork
2024-06-04 22:59 ` ✓ CI.Build: " Patchwork
2024-06-04 22:59 ` ✗ CI.Hooks: failure " Patchwork
2024-06-04 23:01 ` ✓ CI.checksparse: success " Patchwork
2024-06-04 23:29 ` ✓ CI.BAT: " Patchwork
2024-06-05 6:49 ` ✗ CI.FULL: failure " Patchwork
2024-06-07 8:59 ` [PATCH 1/2] " Francois Dugast
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240603215218.14278-1-rodrigo.vivi@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=anshuman.gupta@intel.com \
--cc=francois.dugast@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox