Skip to content

Commit 355d991

Browse files
Evan Quanalexdeucher
authored andcommitted
drm/amd/powerplay: issue no PPSMC_MSG_GetCurrPkgPwr on unsupported ASICs
Otherwise, the error message prompted will confuse user. Signed-off-by: Evan Quan <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent 9ea3fa7 commit 355d991

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3478,18 +3478,31 @@ static int smu7_get_pp_table_entry(struct pp_hwmgr *hwmgr,
34783478

34793479
static int smu7_get_gpu_power(struct pp_hwmgr *hwmgr, u32 *query)
34803480
{
3481+
struct amdgpu_device *adev = hwmgr->adev;
34813482
int i;
34823483
u32 tmp = 0;
34833484

34843485
if (!query)
34853486
return -EINVAL;
34863487

3487-
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0);
3488-
tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0);
3489-
*query = tmp;
3488+
/*
3489+
* PPSMC_MSG_GetCurrPkgPwr is not supported on:
3490+
* - Hawaii
3491+
* - Bonaire
3492+
* - Fiji
3493+
* - Tonga
3494+
*/
3495+
if ((adev->asic_type != CHIP_HAWAII) &&
3496+
(adev->asic_type != CHIP_BONAIRE) &&
3497+
(adev->asic_type != CHIP_FIJI) &&
3498+
(adev->asic_type != CHIP_TONGA)) {
3499+
smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetCurrPkgPwr, 0);
3500+
tmp = cgs_read_register(hwmgr->device, mmSMC_MSG_ARG_0);
3501+
*query = tmp;
34903502

3491-
if (tmp != 0)
3492-
return 0;
3503+
if (tmp != 0)
3504+
return 0;
3505+
}
34933506

34943507
smum_send_msg_to_smc(hwmgr, PPSMC_MSG_PmStatusLogStart);
34953508
cgs_write_ind_register(hwmgr->device, CGS_IND_REG__SMC,

0 commit comments

Comments
 (0)