]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/xe/xe_guc_pc: Lock once to update stashed frequencies
authorLucas De Marchi <lucas.demarchi@intel.com>
Wed, 18 Jun 2025 18:49:59 +0000 (11:49 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Tue, 24 Jun 2025 16:58:03 +0000 (09:58 -0700)
commitd878c97daa603573e5af01fd8beec2fffdb42ad1
treec5b74b91761852cc1d34de2d938de8c176106ee2
parent1beae9aa2b88d3a02eb666e7b777eb2d7bc645f4
drm/xe/xe_guc_pc: Lock once to update stashed frequencies

pc_set_mert_freq_cap() currently lock()/unlock() the mutex multiple times
to stash the current frequencies. It's not a problem since
xe_guc_pc_restore_stashed_freq() is guaranteed to be called only later
in the init sequence. However, now that we have _locked() variants for
this functions, use them and avoid potential issues when called from
other places or using the same pattern.

While at it, prefer and early return for the WA check to reduce
indentation.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://lore.kernel.org/r/20250618-wa-22019338487-v5-2-b888388477f2@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_guc_pc.c