<div dir="auto"><div>Hi, sorry for the drive-by comment but </div><div dir="auto"><span style="font-family:sans-serif"><br></span></div><div dir="auto"><span style="font-family:sans-serif">limit_param |= 0 << 24;</span></div><div dir="auto"><font face="sans-serif"><br></font></div><div dir="auto"><font face="sans-serif">Doesn't do anything.</font></div><div dir="auto"><font face="sans-serif"><br></font></div><div dir="auto"><font face="sans-serif">Best regards</font></div><div dir="auto"><font face="sans-serif">Nils<br></font><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">Den sön 3 okt. 2021 06:47Darren Powell <<a href="mailto:darren.powell@amd.com">darren.powell@amd.com</a>> skrev:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> when smu->adev->pm.ac_power == 0, message parameter with bit 16 set is saved<br>
to smu->current_power_limit.<br>
<br>
Fixes: 0cb4c62125a9 ("drm/amd/pm: correct power limit setting for SMU V11)"<br>
<br>
Signed-off-by: Darren Powell <<a href="mailto:darren.powell@amd.com" target="_blank" rel="noreferrer">darren.powell@amd.com</a>><br>
---<br>
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 9 +++++----<br>
1 file changed, 5 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c<br>
index aedaa4bb15c2..9bb6da99d5b5 100644<br>
--- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c<br>
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c<br>
@@ -984,6 +984,7 @@ int smu_v11_0_set_power_limit(struct smu_context *smu,<br>
{<br>
int power_src;<br>
int ret = 0;<br>
+ uint32_t limit_param;<br>
<br>
if (!smu_cmn_feature_is_enabled(smu, SMU_FEATURE_PPT_BIT)) {<br>
dev_err(smu->adev->dev, "Setting new power limit is not supported!\n");<br>
@@ -1003,10 +1004,10 @@ int smu_v11_0_set_power_limit(struct smu_context *smu,<br>
* BIT 16-23: PowerSource<br>
* BIT 0-15: PowerLimit<br>
*/<br>
- limit &= 0xFFFF;<br>
- limit |= 0 << 24;<br>
- limit |= (power_src) << 16;<br>
- ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetPptLimit, limit, NULL);<br>
+ limit_param = (limit & 0xFFFF);<br>
+ limit_param |= 0 << 24;<br>
+ limit_param |= (power_src) << 16;<br>
+ ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetPptLimit, limit_param, NULL);<br>
if (ret) {<br>
dev_err(smu->adev->dev, "[%s] Set power limit Failed!\n", __func__);<br>
return ret;<br>
-- <br>
2.33.0<br>
<br>
</blockquote></div></div></div>