diff options
| author | Paul E. McKenney <[email protected]> | 2025-03-13 22:31:50 +0000 |
|---|---|---|
| committer | Paul E. McKenney <[email protected]> | 2025-05-08 23:13:26 +0000 |
| commit | 56a7b9f8b05981e929becb45a826558779bca6f6 (patch) | |
| tree | b5bd152e17ee6f257585ed8344bd6b874fd98b71 /drivers/gpu/drm/amd/pm/amdgpu_pm.c | |
| parent | Linux 6.15-rc1 (diff) | |
| download | kernel-56a7b9f8b05981e929becb45a826558779bca6f6.tar.gz kernel-56a7b9f8b05981e929becb45a826558779bca6f6.zip | |
ratelimit: Create functions to handle ratelimit_state internals
A number of ratelimit use cases do open-coded access to the
ratelimit_state structure's ->missed field. This works, but is a bit
messy and makes it more annoying to make changes to this field.
Therefore, provide a ratelimit_state_inc_miss() function that increments
the ->missed field, a ratelimit_state_get_miss() function that reads
out the ->missed field, and a ratelimit_state_reset_miss() function
that reads out that field, but that also resets its value to zero.
These functions will replace client-code open-coded uses of ->missed.
In addition, a new ratelimit_state_reset_interval() function encapsulates
what was previously open-coded lock acquisition and direct field updates.
[ paulmck: Apply kernel test robot feedback. ]
Link: https://lore.kernel.org/all/fbe93a52-365e-47fe-93a4-44a44547d601@paulmck-laptop/
Link: https://lore.kernel.org/all/[email protected]/
Signed-off-by: Paul E. McKenney <[email protected]>
Reviewed-by: Petr Mladek <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Kuniyuki Iwashima <[email protected]>
Cc: Mateusz Guzik <[email protected]>
Cc: Steven Rostedt <[email protected]>
Cc: John Ogness <[email protected]>
Cc: Sergey Senozhatsky <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/pm/amdgpu_pm.c')
0 files changed, 0 insertions, 0 deletions
