Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/gt: debugfs: Evaluate forcewake usage within locks
@ 2024-06-07 14:51 Andi Shyti
  2024-06-07 15:16 ` Rodrigo Vivi
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Andi Shyti @ 2024-06-07 14:51 UTC (permalink / raw)
  To: intel-gfx, dri-devel
  Cc: Nirmoy Das, Janusz Krzysztofik, Chris Wilson, Andi Shyti,
	Andi Shyti

The forcewake count and domains listing is multi process critical
and the uncore provides a spinlock for such cases.

Lock the forcewake evaluation section in the fw_domains_show()
debugfs interface.

Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com>
---
 drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c b/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c
index 4fcba42cfe34..0437fd8217e0 100644
--- a/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c
+++ b/drivers/gpu/drm/i915/gt/intel_gt_pm_debugfs.c
@@ -71,6 +71,8 @@ static int fw_domains_show(struct seq_file *m, void *data)
 	struct intel_uncore_forcewake_domain *fw_domain;
 	unsigned int tmp;
 
+	spin_lock_irq(&uncore->lock);
+
 	seq_printf(m, "user.bypass_count = %u\n",
 		   uncore->user_forcewake_count);
 
@@ -79,6 +81,8 @@ static int fw_domains_show(struct seq_file *m, void *data)
 			   intel_uncore_forcewake_domain_to_str(fw_domain->id),
 			   READ_ONCE(fw_domain->wake_count));
 
+	spin_unlock_irq(&uncore->lock);
+
 	return 0;
 }
 DEFINE_INTEL_GT_DEBUGFS_ATTRIBUTE(fw_domains);
-- 
2.45.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-06-11 14:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-07 14:51 [PATCH] drm/i915/gt: debugfs: Evaluate forcewake usage within locks Andi Shyti
2024-06-07 15:16 ` Rodrigo Vivi
2024-06-11 13:35   ` Andi Shyti
2024-06-07 17:17 ` ✓ Fi.CI.BAT: success for " Patchwork
2024-06-08  4:46 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-06-10  9:24 ` [PATCH] " Nirmoy Das
2024-06-11 13:58   ` Tvrtko Ursulin
2024-06-11 14:44     ` Nirmoy Das

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox