<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<!--[if !mso]><style>v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:DengXian;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
span.EmailStyle20
{mso-style-type:personal-reply;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<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 class="WordSection1">
<p class="MsoNormal">Yes. <o:p></o:p></p>
<p class="MsoNormal">These two APIs get called only during hw/smu initialization. And although there needs hw initialization also on resume/gpu reset.<o:p></o:p></p>
<p class="MsoNormal">They share no race conditions(there cannot be another gpu reset/resume unless current gpu reset/resume done).<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">BR<o:p></o:p></p>
<p class="MsoNormal">Evan<o:p></o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> amd-gfx <amd-gfx-bounces@lists.freedesktop.org>
<b>On Behalf Of </b>Deucher, Alexander<br>
<b>Sent:</b> Friday, August 28, 2020 10:16 PM<br>
<b>To:</b> Das, Nirmoy <Nirmoy.Das@amd.com>; amd-gfx@lists.freedesktop.org; Koenig, Christian <Christian.Koenig@amd.com><br>
<b>Subject:</b> Re: [PATCH 1/4] drm/amd/pm: drop unnecessary feature->mutex lock protections(V2)<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<p style="margin:15.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p style="margin:15.0pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">This code gets called during suspend and resume and GPU reset as well. Are those cases properly covered?<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black">Alex<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal"><span style="font-size:12.0pt;color:black"><o:p> </o:p></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center">
<hr size="2" width="98%" align="center">
</div>
<div id="divRplyFwdMsg">
<p class="MsoNormal"><b><span style="color:black">From:</span></b><span style="color:black"> amd-gfx <<a href="mailto:amd-gfx-bounces@lists.freedesktop.org">amd-gfx-bounces@lists.freedesktop.org</a>> on behalf of Christian König <<a href="mailto:ckoenig.leichtzumerken@gmail.com">ckoenig.leichtzumerken@gmail.com</a>><br>
<b>Sent:</b> Friday, August 28, 2020 4:16 AM<br>
<b>To:</b> Das, Nirmoy <<a href="mailto:Nirmoy.Das@amd.com">Nirmoy.Das@amd.com</a>>;
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a> <<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a>><br>
<b>Subject:</b> Re: [PATCH 1/4] drm/amd/pm: drop unnecessary feature->mutex lock protections(V2)</span>
<o:p></o:p></p>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal">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 <<a href="mailto:christian.koenig@amd.com">christian.koenig@amd.com</a>><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 <<a href="mailto:nirmoy.das@amd.com">nirmoy.das@amd.com</a>><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 <<a href="mailto:evan.quan@amd.com">evan.quan@amd.com</a>><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>
> <a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
> <a href="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">
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>
<a href="mailto:amd-gfx@lists.freedesktop.org">amd-gfx@lists.freedesktop.org</a><br>
<a href="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">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><o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>