[PATCH] drm/amd/pm: Add warning for unexpected PG requests

Felix Kuehling felix.kuehling at amd.com
Thu Nov 25 17:05:00 UTC 2021


Am 2021-11-25 um 8:32 a.m. schrieb Lazar, Lijo:
>
>
> On 11/25/2021 6:52 PM, Chen, Guchun wrote:
>> [Public]
>>
>> Use dev_warn to be mGPU friendly?
>
> The intention is to get a trace as well along with that. There are
> multiple paths to this function.

There is also a dev_WARN and dev_WARN_ONCE.

Regards,
  Felix


>
> Thanks,
> Lijo
>
>>
>> Regards,
>> Guchun
>>
>> -----Original Message-----
>> From: amd-gfx <amd-gfx-bounces at lists.freedesktop.org> On Behalf Of
>> Lijo Lazar
>> Sent: Thursday, November 25, 2021 7:51 PM
>> To: amd-gfx at lists.freedesktop.org
>> Cc: Deucher, Alexander <Alexander.Deucher at amd.com>; Limonciello,
>> Mario <Mario.Limonciello at amd.com>; Zhang, Hawking
>> <Hawking.Zhang at amd.com>
>> Subject: [PATCH] drm/amd/pm: Add warning for unexpected PG requests
>>
>> Ideally power gate/ungate requests shouldn't come when smu block is
>> uninitialized. Add a WARN message to check the origins if such a
>> thing ever happens.
>>
>> Signed-off-by: Lijo Lazar <lijo.lazar at amd.com>
>> ---
>>   drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 5 ++++-
>>   1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>> b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>> index e156add7b560..e0f8ab8be975 100644
>> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>> @@ -277,8 +277,11 @@ static int smu_dpm_set_power_gate(void *handle,
>>       struct smu_context *smu = handle;
>>       int ret = 0;
>>   -    if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled)
>> +    if (!smu->pm_enabled || !smu->adev->pm.dpm_enabled) {
>> +        WARN(true, "SMU uninitialized but power %s requested for
>> %u!\n",
>> +             gate ? "gate" : "ungate", block_type);
>>           return -EOPNOTSUPP;
>> +    }
>>         switch (block_type) {
>>       /*
>> -- 
>> 2.25.1
>>


More information about the amd-gfx mailing list