[AMD Official Use Only - Internal Distribution Only]

Yes.
These two APIs get called only during hw/smu initialization. And although there 
needs hw initialization also on resume/gpu reset.
They share no race conditions(there cannot be another gpu reset/resume unless 
current gpu reset/resume done).

BR
Evan
From: amd-gfx <amd-gfx-boun...@lists.freedesktop.org> On Behalf Of Deucher, 
Alexander
Sent: Friday, August 28, 2020 10:16 PM
To: Das, Nirmoy <nirmoy....@amd.com>; amd-gfx@lists.freedesktop.org; Koenig, 
Christian <christian.koe...@amd.com>
Subject: Re: [PATCH 1/4] drm/amd/pm: drop unnecessary feature->mutex lock 
protections(V2)


[AMD Official Use Only - Internal Distribution Only]


[AMD Official Use Only - Internal Distribution Only]

This code gets called during suspend and resume and GPU reset as well.  Are 
those cases properly covered?

Alex

________________________________
From: amd-gfx 
<amd-gfx-boun...@lists.freedesktop.org<mailto:amd-gfx-boun...@lists.freedesktop.org>>
 on behalf of Christian König 
<ckoenig.leichtzumer...@gmail.com<mailto:ckoenig.leichtzumer...@gmail.com>>
Sent: Friday, August 28, 2020 4:16 AM
To: Das, Nirmoy <nirmoy....@amd.com<mailto:nirmoy....@amd.com>>; 
amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org> 
<amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>>
Subject: Re: [PATCH 1/4] drm/amd/pm: drop unnecessary feature->mutex lock 
protections(V2)

The explanation sounds sane, but since I don't know the affected code at
all the series is only Acked-by: Christian König 
<christian.koe...@amd.com<mailto:christian.koe...@amd.com>>

Maybe wait for Alex to give you an rb if you are unsure, otherwise feel
free to commit.

Christian.

Am 27.08.20 um 08:39 schrieb Nirmoy:
> Series is Acked-by: Nirmoy Das <nirmoy....@amd.com<mailto:nirmoy....@amd.com>>
>
>
> On 8/25/20 9:49 AM, Evan Quan wrote:
>> As these operations are performed in hardware setup and there
>> is actually no race conditions during this period considering:
>> 1. the hardware setup is serial and cannnot be in parallel
>> 2. all other operations can be performed only after hardware
>>     setup complete.
>>
>> V2: rich the commit log description
>>
>> Change-Id: I096d7ab0855ff59b0ecb56fd9d6d9946b3605fc8
>> Signed-off-by: Evan Quan <evan.q...@amd.com<mailto:evan.q...@amd.com>>
>> ---
>>   drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c      | 4 ----
>>   drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 --
>>   2 files changed, 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>> b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>> index 09dc5303762b..b7cad8ef6153 100644
>> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c
>> @@ -361,20 +361,16 @@ static int
>> smu_get_driver_allowed_feature_mask(struct smu_context *smu)
>>       int ret = 0;
>>       uint32_t allowed_feature_mask[SMU_FEATURE_MAX/32];
>>   -    mutex_lock(&feature->mutex);
>>       bitmap_zero(feature->allowed, SMU_FEATURE_MAX);
>> -    mutex_unlock(&feature->mutex);
>>         ret = smu_get_allowed_feature_mask(smu, allowed_feature_mask,
>>                            SMU_FEATURE_MAX/32);
>>       if (ret)
>>           return ret;
>>   -    mutex_lock(&feature->mutex);
>>       bitmap_or(feature->allowed, feature->allowed,
>>                 (unsigned long *)allowed_feature_mask,
>>                 feature->feature_num);
>> -    mutex_unlock(&feature->mutex);
>>         return ret;
>>   }
>> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
>> b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
>> index 548db1edd352..28a19ffd22a1 100644
>> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
>> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c
>> @@ -721,7 +721,6 @@ int smu_v11_0_set_allowed_mask(struct smu_context
>> *smu)
>>       int ret = 0;
>>       uint32_t feature_mask[2];
>>   -    mutex_lock(&feature->mutex);
>>       if (bitmap_empty(feature->allowed, SMU_FEATURE_MAX) ||
>> feature->feature_num < 64)
>>           goto failed;
>>   @@ -738,7 +737,6 @@ int smu_v11_0_set_allowed_mask(struct
>> smu_context *smu)
>>           goto failed;
>>     failed:
>> -    mutex_unlock(&feature->mutex);
>>       return ret;
>>   }
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Calexander.deucher%40amd.com%7Ccad2767c7837431f94f308d84b2ab750%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637341994162774368&amp;sdata=b8PVt6zfQJXYlVunpFMY12knU8ZlJ7UE0ojZjhAWJdY%3D&amp;reserved=0<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cevan.quan%40amd.com%7C9e52b030677540d81cbe08d84b5ced7a%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637342209834431339&sdata=Rlb%2B33bxmwO7W5Ke4sQnS8HRsGlrFkf%2F99YWmSW7OWk%3D&reserved=0>

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org<mailto:amd-gfx@lists.freedesktop.org>
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=02%7C01%7Calexander.deucher%40amd.com%7Ccad2767c7837431f94f308d84b2ab750%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637341994162774368&amp;sdata=b8PVt6zfQJXYlVunpFMY12knU8ZlJ7UE0ojZjhAWJdY%3D&amp;reserved=0<https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Cevan.quan%40amd.com%7C9e52b030677540d81cbe08d84b5ced7a%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637342209834431339&sdata=Rlb%2B33bxmwO7W5Ke4sQnS8HRsGlrFkf%2F99YWmSW7OWk%3D&reserved=0>
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to