Commit cd598d6c authored by Evan Quan's avatar Evan Quan Committed by Alex Deucher

drm/amd/powerplay: report correct AC/DC event based on ctxid V2

'ctxid' is used to distinguish different events raised from SMC.
0x3 and 0x4 are for AC and DC power mode.

V2: update the way to retrieve the ctxid and change the log level
    to debug
Signed-off-by: default avatarEvan Quan <evan.quan@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent e528ccf9
...@@ -1556,6 +1556,11 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev, ...@@ -1556,6 +1556,11 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev,
{ {
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;
/*
* ctxid is used to distinguish different
* events for SMCToHost interrupt.
*/
uint32_t ctxid = entry->src_data[0];
if (client_id == SOC15_IH_CLIENTID_THM) { if (client_id == SOC15_IH_CLIENTID_THM) {
switch (src_id) { switch (src_id) {
...@@ -1596,8 +1601,18 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev, ...@@ -1596,8 +1601,18 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev,
dev_emerg(adev->dev, "System is going to shutdown due to HW CTF!\n"); dev_emerg(adev->dev, "System is going to shutdown due to HW CTF!\n");
orderly_poweroff(true); orderly_poweroff(true);
} else if (client_id == SOC15_IH_CLIENTID_MP1) { } else if (client_id == SOC15_IH_CLIENTID_MP1) {
if (src_id == 0xfe) if (src_id == 0xfe) {
smu_v11_0_ack_ac_dc_interrupt(&adev->smu); switch (ctxid) {
case 0x3:
dev_dbg(adev->dev, "Switched to AC mode!\n");
smu_v11_0_ack_ac_dc_interrupt(&adev->smu);
break;
case 0x4:
dev_dbg(adev->dev, "Switched to DC mode!\n");
smu_v11_0_ack_ac_dc_interrupt(&adev->smu);
break;
}
}
} }
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment