<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#0078D7;margin:15pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This code gets called during suspend and resume and GPU reset as well. Are those cases properly covered?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Alex</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Christian König <ckoenig.leichtzumerken@gmail.com><br>
<b>Sent:</b> Friday, August 28, 2020 4:16 AM<br>
<b>To:</b> Das, Nirmoy <Nirmoy.Das@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Subject:</b> Re: [PATCH 1/4] drm/amd/pm: drop unnecessary feature->mutex lock protections(V2)</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">The explanation sounds sane, but since I don't know the affected code at
<br>
all the series is only Acked-by: Christian König <christian.koenig@amd.com><br>
<br>
Maybe wait for Alex to give you an rb if you are unsure, otherwise feel <br>
free to commit.<br>
<br>
Christian.<br>
<br>
Am 27.08.20 um 08:39 schrieb Nirmoy:<br>
> Series is Acked-by: Nirmoy Das <nirmoy.das@amd.com><br>
><br>
><br>
> On 8/25/20 9:49 AM, Evan Quan wrote:<br>
>> As these operations are performed in hardware setup and there<br>
>> is actually no race conditions during this period considering:<br>
>> 1. the hardware setup is serial and cannnot be in parallel<br>
>> 2. all other operations can be performed only after hardware<br>
>> setup complete.<br>
>><br>
>> V2: rich the commit log description<br>
>><br>
>> Change-Id: I096d7ab0855ff59b0ecb56fd9d6d9946b3605fc8<br>
>> Signed-off-by: Evan Quan <evan.quan@amd.com><br>
>> ---<br>
>> drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 4 ----<br>
>> drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 --<br>
>> 2 files changed, 6 deletions(-)<br>
>><br>
>> diff --git a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c <br>
>> b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c<br>
>> index 09dc5303762b..b7cad8ef6153 100644<br>
>> --- a/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c<br>
>> +++ b/drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c<br>
>> @@ -361,20 +361,16 @@ static int <br>
>> smu_get_driver_allowed_feature_mask(struct smu_context *smu)<br>
>> int ret = 0;<br>
>> uint32_t allowed_feature_mask[SMU_FEATURE_MAX/32];<br>
>> - mutex_lock(&feature->mutex);<br>
>> bitmap_zero(feature->allowed, SMU_FEATURE_MAX);<br>
>> - mutex_unlock(&feature->mutex);<br>
>> ret = smu_get_allowed_feature_mask(smu, allowed_feature_mask,<br>
>> SMU_FEATURE_MAX/32);<br>
>> if (ret)<br>
>> return ret;<br>
>> - mutex_lock(&feature->mutex);<br>
>> bitmap_or(feature->allowed, feature->allowed,<br>
>> (unsigned long *)allowed_feature_mask,<br>
>> feature->feature_num);<br>
>> - mutex_unlock(&feature->mutex);<br>
>> return ret;<br>
>> }<br>
>> diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c <br>
>> b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c<br>
>> index 548db1edd352..28a19ffd22a1 100644<br>
>> --- a/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c<br>
>> +++ b/drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c<br>
>> @@ -721,7 +721,6 @@ int smu_v11_0_set_allowed_mask(struct smu_context <br>
>> *smu)<br>
>> int ret = 0;<br>
>> uint32_t feature_mask[2];<br>
>> - mutex_lock(&feature->mutex);<br>
>> if (bitmap_empty(feature->allowed, SMU_FEATURE_MAX) || <br>
>> feature->feature_num < 64)<br>
>> goto failed;<br>
>> @@ -738,7 +737,6 @@ int smu_v11_0_set_allowed_mask(struct <br>
>> smu_context *smu)<br>
>> goto failed;<br>
>> failed:<br>
>> - mutex_unlock(&feature->mutex);<br>
>> return ret;<br>
>> }<br>
> _______________________________________________<br>
> amd-gfx mailing list<br>
> amd-gfx@lists.freedesktop.org<br>
> <a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Ccad2767c7837431f94f308d84b2ab750%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637341994162774368&sdata=b8PVt6zfQJXYlVunpFMY12knU8ZlJ7UE0ojZjhAWJdY%3D&reserved=0">
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Ccad2767c7837431f94f308d84b2ab750%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637341994162774368&sdata=b8PVt6zfQJXYlVunpFMY12knU8ZlJ7UE0ojZjhAWJdY%3D&reserved=0</a><br>
<br>
_______________________________________________<br>
amd-gfx mailing list<br>
amd-gfx@lists.freedesktop.org<br>
<a href="https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Ccad2767c7837431f94f308d84b2ab750%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637341994162774368&sdata=b8PVt6zfQJXYlVunpFMY12knU8ZlJ7UE0ojZjhAWJdY%3D&reserved=0">https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=02%7C01%7Calexander.deucher%40amd.com%7Ccad2767c7837431f94f308d84b2ab750%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637341994162774368&sdata=b8PVt6zfQJXYlVunpFMY12knU8ZlJ7UE0ojZjhAWJdY%3D&reserved=0</a><br>
</div>
</span></font></div>
</div>
</body>
</html>