drm/amd/powerplay: correct power reading on fiji
authorEvan Quan <evan.quan@amd.com>
Mon, 25 Feb 2019 08:44:36 +0000 (16:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:10:12 +0000 (20:10 +0100)
commit f5742ec36422a39b57f0256e4847f61b3c432f8c upstream.

Set sampling period as 500ms to provide a smooth power
reading output. Also, correct the register for power
reading.

Signed-off-by: Evan Quan <evan.quan@amd.com>
Reviewed-by: Feifei Xu <Feifei.Xu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c

index 052e60d..b52ccab 100644 (file)
@@ -3487,14 +3487,14 @@ static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr, u32 *query)
 
        smum_send_msg_to_smc(hwmgr, PPSMC_MSG_PmStatusLogStart);
        cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,
-                                                       ixSMU_PM_STATUS_94, 0);
+                                                       ixSMU_PM_STATUS_95, 0);
 
        for (i = 0; i < 10; i++) {
-               mdelay(1);
+               mdelay(500);
                smum_send_msg_to_smc(hwmgr, PPSMC_MSG_PmStatusLogSample);
                tmp = cgs_read_ind_register(hwmgr->device,
                                                CGS_IND_REG__SMC,
-                                               ixSMU_PM_STATUS_94);
+                                               ixSMU_PM_STATUS_95);
                if (tmp != 0)
                        break;
        }