]> Gentwo Git Trees - linux/.git/commit
drm/xe/guc_pc: Use poll_timeout_us() for waiting
authorLucas De Marchi <lucas.demarchi@intel.com>
Mon, 22 Sep 2025 19:58:30 +0000 (12:58 -0700)
committerLucas De Marchi <lucas.demarchi@intel.com>
Thu, 25 Sep 2025 04:23:19 +0000 (21:23 -0700)
commitb0ac4ef074ace20714a3bf96d23ae2ba61cc4439
treea33e987da7c52d9f7c95d6e552a0dc9194755604
parent09ab20c41ace0cfc00e48338ab2e2c58896fa094
drm/xe/guc_pc: Use poll_timeout_us() for waiting

Convert wait_for_pc_state() and wait_for_act_freq_limit() to
poll_timeout_us(). This brings 2 changes in behavior: Drop the
exponential wait and fix a potential much longer sleep.

usleep_range() will wait anywhere between `wait` and `wait << 1`, so
it's not correct to assume `slept += wait`.  This code is not really
accurate. Pairing this with the exponential wait increase, it could be
waiting much longer than intended.

Reviewed-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Link: https://lore.kernel.org/r/20250922-xe-iopoll-v4-2-06438311a63f@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_guc_pc.c