From: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
Subject: [Intel-gfx] [PATCH] drm/i915/display: Fix warning callstack for imbalance wakeref
Date: Fri, 12 Aug 2022 10:17:24 +0530 [thread overview]
Message-ID: <20220812044724.12131-1-mitulkumar.ajitkumar.golani@intel.com> (raw)
While executing i915_selftest, wakeref imbalance warning is seen
with i915_selftest failure.
When device is already suspended, wakeref is acquired by
disable_rpm_wakeref_asserts and rpm ownership is transferred back
to core. During this case wakeref_count will not be zero.
Once driver is unregistered, this wakeref is released with
enable_rpm_wakeref_asserts and balancing wakeref_count acquired
by driver.
This patch will fix the warning callstack by adding check if device
is already suspended and rpm ownership transfer is going on.
Signed-off-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
---
drivers/gpu/drm/i915/i915_driver.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_driver.c b/drivers/gpu/drm/i915/i915_driver.c
index deb8a8b76965..6530a8680cfd 100644
--- a/drivers/gpu/drm/i915/i915_driver.c
+++ b/drivers/gpu/drm/i915/i915_driver.c
@@ -1670,7 +1670,13 @@ static int intel_runtime_resume(struct device *kdev)
drm_dbg(&dev_priv->drm, "Resuming device\n");
- drm_WARN_ON_ONCE(&dev_priv->drm, atomic_read(&rpm->wakeref_count));
+ /*
+ * When device is already suspended, Wakeref is acquired by disable_rpm_wakeref_asserts
+ * and rpm ownership is transferred back to core. During this case wakeref_count will
+ * not be zero. Once driver is unregistered, this wakeref is released with
+ * enable_rpm_wakeref_asserts and balancing wakeref_count acquired by driver.
+ */
+ drm_WARN_ON_ONCE(&dev_priv->drm, atomic_read(&rpm->wakeref_count) && !rpm->suspended);
disable_rpm_wakeref_asserts(rpm);
intel_opregion_notify_adapter(dev_priv, PCI_D0);
--
2.25.1
next reply other threads:[~2022-08-12 11:49 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-12 4:47 Mitul Golani [this message]
2022-08-12 12:45 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/display: Fix warning callstack for imbalance wakeref Patchwork
2022-08-12 19:32 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-08-16 20:03 ` Patchwork
2022-08-16 20:47 ` [Intel-gfx] ✓ Fi.CI.IGT: success " Patchwork
2022-08-17 7:15 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/display: Fix warning callstack for imbalance wakeref (rev2) Patchwork
2022-08-17 9:12 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/display: Fix warning callstack for imbalance wakeref (rev3) Patchwork
2022-08-17 12:12 ` [Intel-gfx] ✗ Fi.CI.IGT: failure for drm/i915/display: Fix warning callstack for imbalance wakeref (rev2) Patchwork
2022-08-17 12:49 ` [Intel-gfx] [PATCH] drm/i915/display: Fix warning callstack for imbalance wakeref Imre Deak
2022-08-23 12:39 ` Golani, Mitulkumar Ajitkumar
2022-08-23 12:56 ` Golani, Mitulkumar Ajitkumar
2022-08-25 10:51 ` Imre Deak
2022-08-29 6:45 ` Golani, Mitulkumar Ajitkumar
2022-08-29 14:46 ` Imre Deak
2022-08-29 16:59 ` Golani, Mitulkumar Ajitkumar
2022-08-17 13:24 ` [Intel-gfx] ✓ Fi.CI.IGT: success for drm/i915/display: Fix warning callstack for imbalance wakeref (rev3) Patchwork
-- strict thread matches above, loose matches on Subject: below --
2022-08-23 2:35 [Intel-gfx] [PATCH] drm/i915/display: Fix warning callstack for imbalance wakeref Mitul Golani
2022-08-23 11:00 ` Jani Nikula
2022-08-23 5:20 Mitul Golani
2022-08-23 14:31 ` Jani Nikula
2022-08-29 8:31 Mitul Golani
2022-08-30 8:51 Mitul Golani
2022-08-31 11:54 ` Imre Deak
2022-08-31 15:28 ` Andrzej Hajda
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=20220812044724.12131-1-mitulkumar.ajitkumar.golani@intel.com \
--to=mitulkumar.ajitkumar.golani@intel.com \
--cc=intel-gfx@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