Skip to contentSkip to conversation

drm/amd/swSMU: add callback to set AC/DC power source

PATCH In review Alex Deucher 2 participants 11 messages Mar 20, 2020 – Mar 24, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/8 drm/amd/swSMU: add callback to set AC/DC power source

From: Evan Quan <[email protected]>

This is needed to tell the SMU firmware what state is in in certain cases. DC mode does not allow overclocking for example.

---
 drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 1 +
 drivers/gpu/drm/amd/powerplay/smu_internal.h   | 3 +++
 2 files changed, 4 insertions(+)
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +1 -0
index 657a6f17e91f..323e7e61493b 100644
@@ -570,6 +570,7 @@ struct pptable_funcs {
 	int (*override_pcie_parameters)(struct smu_context *smu);
 	uint32_t (*get_pptable_power_limit)(struct smu_context *smu);
 	int (*disable_umc_cdr_12gbps_workaround)(struct smu_context *smu);
+	int (*set_power_source)(struct smu_context *smu, enum smu_power_src_type power_src);
 };
 
 int smu_load_microcode(struct smu_context *smu);
drivers/gpu/drm/amd/powerplay/smu_internal.h +3 -0
index 6900877de845..40c35bcc5a0a 100644
@@ -211,4 +211,7 @@ static inline int smu_send_smc_msg(struct smu_context *smu, enum smu_message_typ
 #define smu_disable_umc_cdr_12gbps_workaround(smu) \
 	((smu)->ppt_funcs->disable_umc_cdr_12gbps_workaround ? (smu)->ppt_funcs->disable_umc_cdr_12gbps_workaround((smu)) : 0)
 
+#define smu_set_power_source(smu, power_src) \
+	((smu)->ppt_funcs->set_power_source ? (smu)->ppt_funcs->set_power_source((smu), (power_src)) : 0)
+
 #endif
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#1 lore raw

PATCH 2/8 drm/amdgpu/smu11: add a helper to set the power source

Add a common smu11 helper to set the AC/DC power source.

---
 drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h |  3 +++
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c     | 15 +++++++++++++++
 2 files changed, 18 insertions(+)
drivers/gpu/drm/amd/powerplay/inc/smu_v11_0.h +3 -0
index 1c88219fe403..674e426ed59b 100644
@@ -267,4 +267,7 @@ uint32_t smu_v11_0_get_max_power_limit(struct smu_context *smu);
 int smu_v11_0_set_performance_level(struct smu_context *smu,
 				    enum amd_dpm_forced_level level);
 
+int smu_v11_0_set_power_source(struct smu_context *smu,
+			       enum smu_power_src_type power_src);
+
 #endif
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +15 -0
index 4fd77c7cfc80..20174bed11ce 100644
@@ -1939,3 +1939,18 @@ int smu_v11_0_set_performance_level(struct smu_context *smu,
 	return ret;
 }
 
+int smu_v11_0_set_power_source(struct smu_context *smu,
+			       enum smu_power_src_type power_src)
+{
+	int pwr_source;
+
+	pwr_source = smu_power_get_index(smu, (uint32_t)power_src);
+	if (pwr_source < 0)
+		return -EINVAL;
+
+	return smu_send_smc_msg_with_param(smu,
+					SMU_MSG_NotifyPowerSource,
+					pwr_source,
+					NULL);
+}
+
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw

PATCH 3/8 drm/amdgpu/swSMU: use the smu11 power source helper for navi1x

In reply to Alex Deucher

The smu_v11_0 version works for navi1x.

---
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/powerplay/navi10_ppt.c +1 -0
index d66dfa7410b6..a23eaac28095 100644
@@ -2369,6 +2369,7 @@ static const struct pptable_funcs navi10_ppt_funcs = {
 	.get_pptable_power_limit = navi10_get_pptable_power_limit,
 	.run_btc = navi10_run_btc,
 	.disable_umc_cdr_12gbps_workaround = navi10_disable_umc_cdr_12gbps_workaround,
+	.set_power_source = smu_v11_0_set_power_source,
 };
 
 void navi10_set_ppt_funcs(struct smu_context *smu)
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#3 lore raw

PATCH 4/8 drm/amdgpu/swSMU: correct the bootup power source for Navi1X

In reply to Alex Deucher

From: Evan Quan <[email protected]>

PMFW may boots those ASICs with DC mode. Need to set it back to AC mode.

---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +15 -0
index f6d4b0ef46ad..2cfb911ab370 100644
@@ -1154,6 +1154,21 @@ static int smu_smc_table_hw_init(struct smu_context *smu,
 				}
 			}
 		}
+
+		if (adev->asic_type >= CHIP_NAVI10 &&
+		    adev->asic_type <= CHIP_NAVI12) {
+			/*
+			 * For Navi1X, manually switch it to AC mode as PMFW
+			 * may boot it with DC mode.
+			 * TODO: should check whether we are indeed under AC
+			 * mode before doing this.
+			 */
+			ret = smu_set_power_source(smu, SMU_POWER_SOURCE_AC);
+			if (ret) {
+				pr_err("Failed to switch to AC mode!\n");
+				return ret;
+			}
+		}
 	}
 	if (adev->asic_type != CHIP_ARCTURUS) {
 		ret = smu_notify_display_change(smu);
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#4 lore raw

PATCH 5/8 drm/amdgpu/swSMU: set AC/DC mode based on the current system state

In reply to Alex Deucher

Check of the pointer exists and we are actually on AC power.

---
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +5 -5
index 2cfb911ab370..54d156bbc0f3 100644
@@ -1155,15 +1155,15 @@ static int smu_smc_table_hw_init(struct smu_context *smu,
 			}
 		}
 
-		if (adev->asic_type >= CHIP_NAVI10 &&
-		    adev->asic_type <= CHIP_NAVI12) {
+		if (smu->ppt_funcs->set_power_source) {
 			/*
 			 * For Navi1X, manually switch it to AC mode as PMFW
 			 * may boot it with DC mode.
-			 * TODO: should check whether we are indeed under AC
-			 * mode before doing this.
 			 */
-			ret = smu_set_power_source(smu, SMU_POWER_SOURCE_AC);
+			if (adev->pm.ac_power)
+				ret = smu_set_power_source(smu, SMU_POWER_SOURCE_AC);
+			else
+				ret = smu_set_power_source(smu, SMU_POWER_SOURCE_DC);
 			if (ret) {
 				pr_err("Failed to switch to AC mode!\n");
 				return ret;
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#5 lore raw

PATCH 6/8 drm/amdgpu/swSMU: handle DC controlled by GPIO for navi1x

In reply to Alex Deucher

Check the platform caps in the vbios pptable to decide whether to enable automatic AC/DC transitions.

---
 drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h | 1 +
 drivers/gpu/drm/amd/powerplay/navi10_ppt.c     | 7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +1 -0
index 323e7e61493b..18172dfec947 100644
@@ -408,6 +408,7 @@ struct smu_context
 	uint32_t smc_if_version;
 
 	bool uploading_custom_pp_table;
+	bool dc_controlled_by_gpio;
 };
 
 struct i2c_adapter;
drivers/gpu/drm/amd/powerplay/navi10_ppt.c +6 -1
index a23eaac28095..9c60b38ab53a 100644
@@ -347,7 +347,6 @@ navi10_get_allowed_feature_mask(struct smu_context *smu,
 				| FEATURE_MASK(FEATURE_DS_DCEFCLK_BIT)
 				| FEATURE_MASK(FEATURE_FW_DSTATE_BIT)
 				| FEATURE_MASK(FEATURE_BACO_BIT)
-				| FEATURE_MASK(FEATURE_ACDC_BIT)
 				| FEATURE_MASK(FEATURE_GFX_SS_BIT)
 				| FEATURE_MASK(FEATURE_APCC_DFLL_BIT)
 				| FEATURE_MASK(FEATURE_FW_CTF_BIT)
@@ -391,6 +390,9 @@ navi10_get_allowed_feature_mask(struct smu_context *smu,
 	if (smu->adev->pg_flags & AMD_PG_SUPPORT_JPEG)
 		*(uint64_t *)feature_mask |= FEATURE_MASK(FEATURE_JPEG_PG_BIT);
 
+	if (smu->dc_controlled_by_gpio)
+		*(uint64_t *)feature_mask |= FEATURE_MASK(FEATURE_ACDC_BIT);
+
 	/* disable DPM UCLK and DS SOCCLK on navi10 A0 secure board */
 	if (is_asic_secure(smu)) {
 		/* only for navi10 A0 */
@@ -525,6 +527,9 @@ static int navi10_store_powerplay_table(struct smu_context *smu)
 
 	table_context->thermal_controller_type = powerplay_table->thermal_controller_type;
 
+	if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_HARDWAREDC)
+		smu->dc_controlled_by_gpio = true;
+
 	mutex_lock(&smu_baco->mutex);
 	if (powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_BACO ||
 	    powerplay_table->platform_caps & SMU_11_0_PP_PLATFORM_CAP_MACO)
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#6 lore raw

PATCH 7/8 drm/amdgpu/swSMU: handle manual AC/DC notifications

In reply to Alex Deucher

For boards that do not support automatic AC/DC transitions in firmware, manually tell the firmware when the status changes.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c        |  3 +++
 drivers/gpu/drm/amd/powerplay/amdgpu_smu.c    | 23 +++++++++++++++++++
 .../gpu/drm/amd/powerplay/inc/amdgpu_smu.h    |  1 +
 3 files changed, 27 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +3 -0
index bc3cf04a1a94..f197f1be0969 100644
@@ -92,6 +92,9 @@ void amdgpu_pm_acpi_event_handler(struct amdgpu_device *adev)
 		if (adev->powerplay.pp_funcs->enable_bapm)
 			amdgpu_dpm_enable_bapm(adev, adev->pm.ac_power);
 		mutex_unlock(&adev->pm.mutex);
+
+		if (is_support_sw_smu(adev))
+			smu_set_ac_dc(&adev->smu);
 	}
 }
 
drivers/gpu/drm/amd/powerplay/amdgpu_smu.c +23 -0
index 54d156bbc0f3..6f4015f87781 100644
@@ -2087,6 +2087,29 @@ int smu_set_watermarks_for_clock_ranges(struct smu_context *smu,
 	return 0;
 }
 
+int smu_set_ac_dc(struct smu_context *smu)
+{
+	int ret = 0;
+
+	/* controlled by firmware */
+	if (smu->dc_controlled_by_gpio)
+		return 0;
+
+	mutex_lock(&smu->mutex);
+	if (smu->ppt_funcs->set_power_source) {
+		if (smu->adev->pm.ac_power)
+			ret = smu_set_power_source(smu, SMU_POWER_SOURCE_AC);
+		else
+			ret = smu_set_power_source(smu, SMU_POWER_SOURCE_DC);
+		if (ret)
+			pr_err("Failed to switch to %s mode!\n",
+			       smu->adev->pm.ac_power ? "AC" : "DC");
+	}
+	mutex_unlock(&smu->mutex);
+
+	return ret;
+}
+
 const struct amd_ip_funcs smu_ip_funcs = {
 	.name = "smu",
 	.early_init = smu_early_init,
drivers/gpu/drm/amd/powerplay/inc/amdgpu_smu.h +1 -0
index 18172dfec947..ae2c318dd6fa 100644
@@ -720,6 +720,7 @@ int smu_get_dpm_level_range(struct smu_context *smu, enum smu_clk_type clk_type,
 enum amd_dpm_forced_level smu_get_performance_level(struct smu_context *smu);
 int smu_force_performance_level(struct smu_context *smu, enum amd_dpm_forced_level level);
 int smu_set_display_count(struct smu_context *smu, uint32_t count);
+int smu_set_ac_dc(struct smu_context *smu);
 bool smu_clk_dpm_is_enabled(struct smu_context *smu, enum smu_clk_type clk_type);
 const char *smu_get_message_name(struct smu_context *smu, enum smu_message_type type);
 const char *smu_get_feature_name(struct smu_context *smu, enum smu_feature_mask feature);
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#7 lore raw

PATCH 8/8 drm/amdgpu/smu11: add support for SMU AC/DC interrupts

In reply to Alex Deucher

Driver needs to send the ack message when it receives the AC/DC interrupt from the SMU.

TODO: verify the client and src ids.

---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +16 -0
index 20174bed11ce..d19e1d0d56c0 100644
@@ -1525,6 +1525,13 @@ int smu_v11_0_set_xgmi_pstate(struct smu_context *smu,
 	return ret;
 }
 
+static int smu_v11_0_ack_ac_dc_interrupt(struct smu_context *smu)
+{
+	return smu_send_smc_msg(smu,
+				SMU_MSG_ReenableAcDcInterrupt,
+				NULL);
+}
+
 #define THM_11_0__SRCID__THM_DIG_THERM_L2H		0		/* ASIC_TEMP > CG_THERMAL_INT.DIG_THERM_INTH  */
 #define THM_11_0__SRCID__THM_DIG_THERM_H2L		1		/* ASIC_TEMP < CG_THERMAL_INT.DIG_THERM_INTL  */
 
@@ -1558,6 +1565,9 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev,
 		break;
 
 		}
+	} else if (client_id == SOC15_IH_CLIENTID_MP1) {
+		if (src_id == 0xfe)
+			smu_v11_0_ack_ac_dc_interrupt(&adev->smu);
 	}
 
 	return 0;
@@ -1597,6 +1607,12 @@ int smu_v11_0_register_irq_handler(struct smu_context *smu)
 	if (ret)
 		return ret;
 
+	ret = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_MP1,
+				0xfe,
+				irq_src);
+	if (ret)
+		return ret;
+
 	return ret;
 }
 
Signature · 6 lines
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#8 lore raw

RE: [PATCH 8/8] drm/amdgpu/smu11: add support for SMU AC/DC interrupts

Thanks Alex. The series is reviewed-by: Evan Quan <[email protected]>

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Saturday, March 21, 2020 2:27 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; [email protected]
Subject: [PATCH 8/8] drm/amdgpu/smu11: add support for SMU AC/DC interrupts

Driver needs to send the ack message when it receives the AC/DC interrupt from the SMU.

TODO: verify the client and src ids.

---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +15 -0
index 20174bed11ce..d19e1d0d56c0 100644
@@ -1525,6 +1525,13 @@ int smu_v11_0_set_xgmi_pstate(struct smu_context *smu,
 	return ret;
 }
 
+static int smu_v11_0_ack_ac_dc_interrupt(struct smu_context *smu) {
+	return smu_send_smc_msg(smu,
+				SMU_MSG_ReenableAcDcInterrupt,
+				NULL);
+}
+
 #define THM_11_0__SRCID__THM_DIG_THERM_L2H		0		/* ASIC_TEMP > CG_THERMAL_INT.DIG_THERM_INTH  */
 #define THM_11_0__SRCID__THM_DIG_THERM_H2L		1		/* ASIC_TEMP < CG_THERMAL_INT.DIG_THERM_INTL  */
 
@@ -1558,6 +1565,9 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev,
 		break;
 
 		}
+	} else if (client_id == SOC15_IH_CLIENTID_MP1) {
+		if (src_id == 0xfe)
+			smu_v11_0_ack_ac_dc_interrupt(&adev->smu);
 	}
 
 	return 0;
@@ -1597,6 +1607,12 @@ int smu_v11_0_register_irq_handler(struct smu_context *smu)
 	if (ret)
 		return ret;
 
+	ret = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_MP1,
+				0xfe,
+				irq_src);
+	if (ret)
+		return ret;
+
 	return ret;
 }
 

--
2.25.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cevan.quan%40amd.com%7C659315d457244e756adc08d7ccfc6dab%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637203256919711120&amp;sdata=YM6rLmsPSMvUxiSxS4b4qH72I9xojvwi5QKhVnmqk0s%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#9 lore raw

Re: [PATCH 8/8] drm/amdgpu/smu11: add support for SMU AC/DC interrupts

Quoted 2 lines · Evan

Thanks Alex. The series is reviewed-by: Evan Quan <[email protected]>

Thanks Evan. Can you verify that the client and source id are correct for the interrupt? I wasn't able to find them.

Alex

Quoted 60 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Saturday, March 21, 2020 2:27 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; [email protected]
Subject: [PATCH 8/8] drm/amdgpu/smu11: add support for SMU AC/DC interrupts

Driver needs to send the ack message when it receives the AC/DC interrupt from the SMU.

TODO: verify the client and src ids.

---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +15 -1
index 20174bed11ce..d19e1d0d56c0 100644
@@ -1525,6 +1525,13 @@ int smu_v11_0_set_xgmi_pstate(struct smu_context *smu,
        return ret;
 }
 
+static int smu_v11_0_ack_ac_dc_interrupt(struct smu_context *smu) {
+       return smu_send_smc_msg(smu,
+                               SMU_MSG_ReenableAcDcInterrupt,
+                               NULL);
+}
+
 #define THM_11_0__SRCID__THM_DIG_THERM_L2H             0               /* ASIC_TEMP > CG_THERMAL_INT.DIG_THERM_INTH  */
 #define THM_11_0__SRCID__THM_DIG_THERM_H2L             1               /* ASIC_TEMP < CG_THERMAL_INT.DIG_THERM_INTL  */
 
@@ -1558,6 +1565,9 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev,
                break;
 
                }
+       } else if (client_id == SOC15_IH_CLIENTID_MP1) {
+               if (src_id == 0xfe)
+                       smu_v11_0_ack_ac_dc_interrupt(&adev->smu);
        }
 
        return 0;
@@ -1597,6 +1607,12 @@ int smu_v11_0_register_irq_handler(struct smu_context *smu)
        if (ret)
                return ret;
 
+       ret = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_MP1,
+                               0xfe,
+                               irq_src);
+       if (ret)
+               return ret;
+
        return ret;
 }
 
--

2.25.1

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Cevan.quan%40amd.com%7C659315d457244e756adc08d7ccfc6dab%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637203256919711120&amp;sdata=YM6rLmsPSMvUxiSxS4b4qH72I9xojvwi5QKhVnmqk0s%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

#10 lore raw

RE: [PATCH 8/8] drm/amdgpu/smu11: add support for SMU AC/DC interrupts

I have no target to verify that. The only nv10 board on my hand has no dc/ac automatic switch support. But it should be correct as windows uses the same client and source id per my confirmation.

Regards,
Evan
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Monday, March 23, 2020 10:47 PM
To: Quan, Evan <[email protected]>
Cc: [email protected]; Deucher, Alexander <[email protected]>; [email protected]
Subject: Re: [PATCH 8/8] drm/amdgpu/smu11: add support for SMU AC/DC interrupts

Quoted 2 lines · Evan

Thanks Alex. The series is reviewed-by: Evan Quan <[email protected]>

Thanks Evan. Can you verify that the client and source id are correct for the interrupt? I wasn't able to find them.

Alex

Quoted 63 lines

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Saturday, March 21, 2020 2:27 AM
To: [email protected]
Cc: Deucher, Alexander <[email protected]>; [email protected]
Subject: [PATCH 8/8] drm/amdgpu/smu11: add support for SMU AC/DC interrupts

Driver needs to send the ack message when it receives the AC/DC interrupt from the SMU.

TODO: verify the client and src ids.

---
 drivers/gpu/drm/amd/powerplay/smu_v11_0.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
drivers/gpu/drm/amd/powerplay/smu_v11_0.c +14 -1
index 20174bed11ce..d19e1d0d56c0 100644
@@ -1525,6 +1525,13 @@ int smu_v11_0_set_xgmi_pstate(struct smu_context *smu,
        return ret;
 }
 
+static int smu_v11_0_ack_ac_dc_interrupt(struct smu_context *smu) {
+       return smu_send_smc_msg(smu,
+                               SMU_MSG_ReenableAcDcInterrupt,
+                               NULL); }
+
 #define THM_11_0__SRCID__THM_DIG_THERM_L2H             0               /* ASIC_TEMP > CG_THERMAL_INT.DIG_THERM_INTH  */
 #define THM_11_0__SRCID__THM_DIG_THERM_H2L             1               /* ASIC_TEMP < CG_THERMAL_INT.DIG_THERM_INTL  */
 
@@ -1558,6 +1565,9 @@ static int smu_v11_0_irq_process(struct amdgpu_device *adev,
                break;
 
                }
+       } else if (client_id == SOC15_IH_CLIENTID_MP1) {
+               if (src_id == 0xfe)
+                       smu_v11_0_ack_ac_dc_interrupt(&adev->smu);
        }
 
        return 0;
@@ -1597,6 +1607,12 @@ int smu_v11_0_register_irq_handler(struct smu_context *smu)
        if (ret)
                return ret;
 
+       ret = amdgpu_irq_add_id(adev, SOC15_IH_CLIENTID_MP1,
+                               0xfe,
+                               irq_src);
+       if (ret)
+               return ret;
+
        return ret;
 }
 
--

2.25.1

Quoted 8 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flist
s.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7CEv an.Quan%40amd.com%7C0738875d4cae44f1574908d7cf3907c6%7C3dd8961fe4884e6 08e11a82d994e183d%7C0%7C0%7C637205716159695922&amp;sdata=Yct4d%2ByJkHL TXhL9ihK1jr65V8k2CJLlQrDGI4hjJx0%3D&amp;reserved=0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx