Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: <intel-gfx@lists.freedesktop.org>, <intel-xe@lists.freedesktop.org>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>, Imre Deak <imre.deak@intel.com>
Subject: [PATCH 2/2] drm/xe/display: Avoid encoder_suspend at runtime suspend
Date: Fri, 30 Aug 2024 14:35:07 -0400	[thread overview]
Message-ID: <20240830183507.298351-2-rodrigo.vivi@intel.com> (raw)
In-Reply-To: <20240830183507.298351-1-rodrigo.vivi@intel.com>

Fix circular locking dependency on runtime suspend.

<4> [74.952215] ======================================================
<4> [74.952217] WARNING: possible circular locking dependency detected
<4> [74.952219] 6.10.0-rc7-xe #1 Not tainted
<4> [74.952221] ------------------------------------------------------
<4> [74.952223] kworker/7:1/82 is trying to acquire lock:
<4> [74.952226] ffff888120548488 (&dev->mode_config.mutex){+.+.}-{3:3}, at: drm_modeset_lock_all+0x40/0x1e0 [drm]
<4> [74.952260]
but task is already holding lock:
<4> [74.952262] ffffffffa0ae59c0 (xe_pm_runtime_lockdep_map){+.+.}-{0:0}, at: xe_pm_runtime_suspend+0x2f/0x340 [xe]
<4> [74.952322]
which lock already depends on the new lock.

The commit b1d90a86 ("drm/xe: Use the encoder suspend helper also used
by the i915 driver") didn't do anything wrong. It actually fixed a
critical bug, because the encoder_suspend was never getting actually
called because it was returning if (has_display(xe)) instead of
if (!has_display(xe)). However, this ended up introducing the encoder
suspend calls in the runtime routines as well, causing the circular
locking dependency.

Closes: https://gitlab.freedesktop.org/drm/xe/kernel/-/issues/2304
Fixes: b1d90a862c89 ("drm/xe: Use the encoder suspend helper also used by the i915 driver")
Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 drivers/gpu/drm/xe/display/xe_display.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/xe/display/xe_display.c b/drivers/gpu/drm/xe/display/xe_display.c
index ae92012253f8..75736faf2a80 100644
--- a/drivers/gpu/drm/xe/display/xe_display.c
+++ b/drivers/gpu/drm/xe/display/xe_display.c
@@ -345,10 +345,10 @@ void xe_display_pm_suspend(struct xe_device *xe, bool runtime)
 
 	intel_hpd_cancel_work(xe);
 
-	if (!runtime && has_display(xe))
+	if (!runtime && has_display(xe)) {
 		intel_display_driver_suspend_access(xe);
-
-	intel_encoder_suspend_all(&xe->display);
+		intel_encoder_suspend_all(&xe->display);
+	}
 
 	intel_opregion_suspend(display, s2idle ? PCI_D1 : PCI_D3cold);
 
-- 
2.46.0


  reply	other threads:[~2024-08-30 18:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-30 18:35 [PATCH 1/2] drm/xe: Add missing runtime reference to wedged upon gt_reset Rodrigo Vivi
2024-08-30 18:35 ` Rodrigo Vivi [this message]
2024-08-30 19:22   ` [PATCH 2/2] drm/xe/display: Avoid encoder_suspend at runtime suspend Cavitt, Jonathan
2024-08-30 18:41 ` ✓ CI.Patch_applied: success for series starting with [1/2] drm/xe: Add missing runtime reference to wedged upon gt_reset Patchwork
2024-08-30 18:41 ` ✗ CI.checkpatch: warning " Patchwork
2024-08-30 18:42 ` ✓ CI.KUnit: success " Patchwork
2024-08-30 18:54 ` ✓ CI.Build: " Patchwork
2024-08-30 18:57 ` ✓ CI.Hooks: " Patchwork
2024-08-30 18:58 ` ✓ CI.checksparse: " Patchwork
2024-08-30 19:17 ` ✓ CI.BAT: " Patchwork
2024-08-30 19:20 ` [PATCH 1/2] " Cavitt, Jonathan
2024-08-31  8:44 ` ✗ CI.FULL: failure for series starting with [1/2] " Patchwork
2024-08-31 16:02 ` [PATCH 1/2] " Ghimiray, Himal Prasad

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=20240830183507.298351-2-rodrigo.vivi@intel.com \
    --to=rodrigo.vivi@intel.com \
    --cc=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    /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