mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-26 16:41:25 +00:00
drm/amd/powerplay: enable thermal throttling logging support V2
Currently this feature is supported on Arcturus only. PMFW will interrupt driver the first time when thermal throttling happened and every one second afterwards if the throttling continuing. On receiving the 1st interrupt, driver logs it the first time. However, if the throttling continues, the logging will be performed every minute to avoid log flooding. V2: simplify the implemention by ratelimited printk Signed-off-by: Evan Quan <evan.quan@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
8c0bba6479
commit
bcdc7c05bd
1 changed files with 11 additions and 0 deletions
|
@ -1524,6 +1524,7 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev,
|
||||||
struct amdgpu_irq_src *source,
|
struct amdgpu_irq_src *source,
|
||||||
struct amdgpu_iv_entry *entry)
|
struct amdgpu_iv_entry *entry)
|
||||||
{
|
{
|
||||||
|
struct smu_context *smu = &adev->smu;
|
||||||
uint32_t client_id = entry->client_id;
|
uint32_t client_id = entry->client_id;
|
||||||
uint32_t src_id = entry->src_id;
|
uint32_t src_id = entry->src_id;
|
||||||
/*
|
/*
|
||||||
|
@ -1532,6 +1533,11 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev,
|
||||||
*/
|
*/
|
||||||
uint32_t ctxid = entry->src_data[0];
|
uint32_t ctxid = entry->src_data[0];
|
||||||
uint32_t data;
|
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) {
|
if (client_id == SOC15_IH_CLIENTID_THM) {
|
||||||
switch (src_id) {
|
switch (src_id) {
|
||||||
|
@ -1575,6 +1581,11 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev,
|
||||||
dev_dbg(adev->dev, "Switched to DC mode!\n");
|
dev_dbg(adev->dev, "Switched to DC mode!\n");
|
||||||
smu_v11_0_ack_ac_dc_interrupt(&adev->smu);
|
smu_v11_0_ack_ac_dc_interrupt(&adev->smu);
|
||||||
break;
|
break;
|
||||||
|
case 0x7:
|
||||||
|
if (__ratelimit(&ratelimit_state))
|
||||||
|
smu_log_thermal_throttling(smu);
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue