Commit 234676d6 authored by Alex Deucher's avatar Alex Deucher

drm/amdgpu/swsmu: add interrupt work handler for smu11 parts

We need to schedule the smu AC/DC interrupt ack to avoid
potentially sleeping if the smu message mutex is contended.

Fixes: e1188aac ("drm/amdgpu/smu11: add support for SMU AC/DC interrupts")
Reviewed-by: default avatarHawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 1a8a763b
...@@ -280,5 +280,7 @@ int smu_v11_0_gfx_ulv_control(struct smu_context *smu, ...@@ -280,5 +280,7 @@ int smu_v11_0_gfx_ulv_control(struct smu_context *smu,
int smu_v11_0_deep_sleep_control(struct smu_context *smu, int smu_v11_0_deep_sleep_control(struct smu_context *smu,
bool enablement); bool enablement);
void smu_v11_0_interrupt_work(struct smu_context *smu);
#endif #endif
#endif #endif
...@@ -2388,6 +2388,7 @@ static const struct pptable_funcs arcturus_ppt_funcs = { ...@@ -2388,6 +2388,7 @@ static const struct pptable_funcs arcturus_ppt_funcs = {
.gfx_ulv_control = smu_v11_0_gfx_ulv_control, .gfx_ulv_control = smu_v11_0_gfx_ulv_control,
.deep_sleep_control = smu_v11_0_deep_sleep_control, .deep_sleep_control = smu_v11_0_deep_sleep_control,
.get_fan_parameters = arcturus_get_fan_parameters, .get_fan_parameters = arcturus_get_fan_parameters,
.interrupt_work = smu_v11_0_interrupt_work,
}; };
void arcturus_set_ppt_funcs(struct smu_context *smu) void arcturus_set_ppt_funcs(struct smu_context *smu)
......
...@@ -2755,6 +2755,7 @@ static const struct pptable_funcs navi10_ppt_funcs = { ...@@ -2755,6 +2755,7 @@ static const struct pptable_funcs navi10_ppt_funcs = {
.deep_sleep_control = smu_v11_0_deep_sleep_control, .deep_sleep_control = smu_v11_0_deep_sleep_control,
.get_fan_parameters = navi10_get_fan_parameters, .get_fan_parameters = navi10_get_fan_parameters,
.post_init = navi10_post_smu_init, .post_init = navi10_post_smu_init,
.interrupt_work = smu_v11_0_interrupt_work,
}; };
void navi10_set_ppt_funcs(struct smu_context *smu) void navi10_set_ppt_funcs(struct smu_context *smu)
......
...@@ -2784,6 +2784,7 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = { ...@@ -2784,6 +2784,7 @@ static const struct pptable_funcs sienna_cichlid_ppt_funcs = {
.gfx_ulv_control = smu_v11_0_gfx_ulv_control, .gfx_ulv_control = smu_v11_0_gfx_ulv_control,
.deep_sleep_control = smu_v11_0_deep_sleep_control, .deep_sleep_control = smu_v11_0_deep_sleep_control,
.get_fan_parameters = sienna_cichlid_get_fan_parameters, .get_fan_parameters = sienna_cichlid_get_fan_parameters,
.interrupt_work = smu_v11_0_interrupt_work,
}; };
void sienna_cichlid_set_ppt_funcs(struct smu_context *smu) void sienna_cichlid_set_ppt_funcs(struct smu_context *smu)
......
...@@ -955,6 +955,12 @@ static int smu_v11_0_process_pending_interrupt(struct smu_context *smu) ...@@ -955,6 +955,12 @@ static int smu_v11_0_process_pending_interrupt(struct smu_context *smu)
return ret; return ret;
} }
void smu_v11_0_interrupt_work(struct smu_context *smu)
{
if (smu_v11_0_ack_ac_dc_interrupt(smu))
dev_err(smu->adev->dev, "Ack AC/DC interrupt Failed!\n");
}
int smu_v11_0_enable_thermal_alert(struct smu_context *smu) int smu_v11_0_enable_thermal_alert(struct smu_context *smu)
{ {
int ret = 0; int ret = 0;
...@@ -1320,11 +1326,11 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev, ...@@ -1320,11 +1326,11 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev,
switch (ctxid) { switch (ctxid) {
case 0x3: case 0x3:
dev_dbg(adev->dev, "Switched to AC mode!\n"); dev_dbg(adev->dev, "Switched to AC mode!\n");
smu_v11_0_ack_ac_dc_interrupt(&adev->smu); schedule_work(&smu->interrupt_work);
break; break;
case 0x4: case 0x4:
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); schedule_work(&smu->interrupt_work);
break; break;
case 0x7: case 0x7:
/* /*
......
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