diff options
author | Evan Quan <evan.quan@amd.com> | 2020-05-22 18:57:11 +0800 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2020-05-29 13:55:07 -0400 |
commit | b265bdbd9f2811c2a674ea9d1161de821923897c (patch) | |
tree | 624303118365a4bba34f2e90fe2a0f3c67fa4e28 /drivers/gpu/drm/amd/powerplay | |
parent | bcdc7c05bd2dd8fa8afbd725110d5ec3075d4b42 (diff) |
drm/amdgpu: added a sysfs interface for thermal throttling related V4
User can check and set the enablement of throttling logging and
the interval between each logging.
V2: simplify the sysfs interface(no string parsing)
V3: add proper lock protection on updating throttling_logging_rs.interval
V4: documentation cosmetic per Luben's suggestion
Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Luben Tuikov <luben.tuikov@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay')
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c index 92cb7924524d..123a2af4be2e 100644 --- a/drivers/gpu/drm/amd/powerplay/smu_v11_0.c +++ b/drivers/gpu/drm/amd/powerplay/smu_v11_0.c @@ -1533,11 +1533,6 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev, */ uint32_t ctxid = entry->src_data[0]; uint32_t data; - /* - * if the throttling continues, the logging will be performed every - * minute to avoid log flooding. - */ - static DEFINE_RATELIMIT_STATE(ratelimit_state, 60 * HZ, 1); if (client_id == SOC15_IH_CLIENTID_THM) { switch (src_id) { @@ -1582,7 +1577,10 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev, smu_v11_0_ack_ac_dc_interrupt(&adev->smu); break; case 0x7: - if (__ratelimit(&ratelimit_state)) + if (!atomic_read(&adev->throttling_logging_enabled)) + return 0; + + if (__ratelimit(&adev->throttling_logging_rs)) smu_log_thermal_throttling(smu); break; |