summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2019-12-02 03:38:14 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2019-12-02 03:38:14 +0000
commita47c980f74e2fdc21c1cb38a9476b13ab1a668b4 (patch)
tree8f9c5b20ffe42e7a4335c219a66855ac02339277 /sys
parent389454f8ebb75c723db8b7d0bc510c49e062e1b8 (diff)
drm/amd/powerplay: issue no PPSMC_MSG_GetCurrPkgPwr on unsupported ASICs
From Evan Quan 8a67fbf6597122c4a5e2c48716bc441364357eef in linux 4.19.y/4.19.87 355d991cb6ff6ae76b5e28b8edae144124c730e4 in mainline linux
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/drm/amd/powerplay/hwmgr/smu7_hwmgr.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/sys/dev/pci/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/sys/dev/pci/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
index 9251357a923..f02a19c79eb 100644
--- a/sys/dev/pci/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
+++ b/sys/dev/pci/drm/amd/powerplay/hwmgr/smu7_hwmgr.c
@@ -3472,18 +3472,31 @@ static int smu7_get_pp_table_entry(struct pp_hwmgr *hwmgr,
static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr, u32 *query)
{
+ struct amdgpu_device *adev = hwmgr->adev;
int i;
u32 tmp = 0;
if (!query)
return -EINVAL;
- smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0);
- tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0);
- *query = tmp;
+ /*
+ * PPSMC_MSG_GetCurrPkgPwr is not supported on:
+ * - Hawaii
+ * - Bonaire
+ * - Fiji
+ * - Tonga
+ */
+ if ((adev->asic_type != CHIP_HAWAII) &&
+ (adev->asic_type != CHIP_BONAIRE) &&
+ (adev->asic_type != CHIP_FIJI) &&
+ (adev->asic_type != CHIP_TONGA)) {
+ smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0);
+ tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0);
+ *query = tmp;
- if (tmp != 0)
- return 0;
+ if (tmp != 0)
+ return 0;
+ }
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_PmStatusLogStart);
cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,