drm/i915/gt: debugfs: Evaluate forcewake usage within locks
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> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Nirmoy Das <nirmoy.das@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20240607145131.217251-1-andi.shyti@linux.intel.com
This commit is contained in:
parent
79655e867a
commit
c677f31c85
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user