Backport of the same commit to amdgpu.
This commit fixes some instability on Tahiti.

Fixes: a9e61410921b ("drm/radeon/kms: add dpm support for SI (v7)")
Signed-off-by: Timur Kristóf <timur.kris...@gmail.com>
---
 drivers/gpu/drm/radeon/si_dpm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/si_dpm.c b/drivers/gpu/drm/radeon/si_dpm.c
index 9deb91970d4d..47fba85436a7 100644
--- a/drivers/gpu/drm/radeon/si_dpm.c
+++ b/drivers/gpu/drm/radeon/si_dpm.c
@@ -5073,10 +5073,13 @@ static int si_disable_ulv(struct radeon_device *rdev)
 {
        struct si_power_info *si_pi = si_get_pi(rdev);
        struct si_ulv_param *ulv = &si_pi->ulv;
+       PPSMC_Result r;
 
+       r = si_send_msg_to_smc(rdev, PPSMC_MSG_DisableULV);
+
+       /* Only care about SMC reply when ULV is supported. */
        if (ulv->supported)
-               return (si_send_msg_to_smc(rdev, PPSMC_MSG_DisableULV) == 
PPSMC_Result_OK) ?
-                       0 : -EINVAL;
+               return (r == PPSMC_Result_OK) ? 0 : -EINVAL;
 
        return 0;
 }
-- 
2.50.1

Reply via email to