<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=gb2312">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:宋体;
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:等线;
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:"\@等线";
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"\@宋体";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:#0563C1;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
{mso-style-priority:99;
mso-style-link:"Plain Text Char";
margin:0cm;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
{mso-style-name:msonormal;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:宋体;}
span.PlainTextChar
{mso-style-name:"Plain Text Char";
mso-style-priority:99;
mso-style-link:"Plain Text";
font-family:"Calibri",sans-serif;}
p.msipheader4d0fcdd7, li.msipheader4d0fcdd7, div.msipheader4d0fcdd7
{mso-style-name:msipheader4d0fcdd7;
mso-margin-top-alt:auto;
margin-right:0cm;
mso-margin-bottom-alt:auto;
margin-left:0cm;
font-size:12.0pt;
font-family:宋体;}
span.EmailStyle21
{mso-style-type:personal-compose;
font-family:"Arial",sans-serif;
color:#0078D7;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:612.0pt 792.0pt;
margin:72.0pt 90.0pt 72.0pt 90.0pt;}
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="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="msipheader4d0fcdd7" style="margin:0cm;margin-bottom:.0001pt"><span style="font-size:10.0pt;font-family:"Arial",sans-serif;color:#0078D7">[AMD Official Use Only - Internal Distribution Only]</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:12.0pt;font-family:宋体"><o:p> </o:p></span></p>
<p class="MsoPlainText">Please check my comments inline<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Regards,<br>
Hawking<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">-----Original Message-----<br>
From: Le Ma <le.ma@amd.com> <br>
Sent: 2019<span lang="ZH-CN" style="font-family:等线">年</span>11<span lang="ZH-CN" style="font-family:等线">月</span>27<span lang="ZH-CN" style="font-family:等线">日</span> 17:15<br>
To: amd-gfx@lists.freedesktop.org<br>
Cc: Zhang, Hawking <Hawking.Zhang@amd.com>; Chen, Guchun <Guchun.Chen@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Li, Dennis <Dennis.Li@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Ma, Le <Le.Ma@amd.com><br>
Subject: [PATCH 05/10] drm/amdgpu: enable/disable doorbell interrupt in baco entry/exit helper<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">This operation is needed when baco entry/exit for ras recovery<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Change-Id: I535c7231693f3138a8e3d5acd55672e2ac68232f<o:p></o:p></p>
<p class="MsoPlainText">Signed-off-by: Le Ma <<a href="mailto:le.ma@amd.com"><span style="color:windowtext;text-decoration:none">le.ma@amd.com</span></a>><o:p></o:p></p>
<p class="MsoPlainText">---<o:p></o:p></p>
<p class="MsoPlainText">drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19 ++++++++++++-------<o:p></o:p></p>
<p class="MsoPlainText">1 file changed, 12 insertions(+), 7 deletions(-)<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<o:p></o:p></p>
<p class="MsoPlainText">index b1408c5..bd387bb 100644<o:p></o:p></p>
<p class="MsoPlainText">--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<o:p></o:p></p>
<p class="MsoPlainText">+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c<o:p></o:p></p>
<p class="MsoPlainText">@@ -4308,10 +4308,14 @@ static void amdgpu_device_get_pcie_info(struct amdgpu_device *adev) int amdgpu_device_baco_enter(struct drm_device *dev) {<o:p></o:p></p>
<p class="MsoPlainText"> struct amdgpu_device *adev = dev->dev_private;<o:p></o:p></p>
<p class="MsoPlainText">+ struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"> if (!amdgpu_device_supports_baco(adev->ddev))<o:p></o:p></p>
<p class="MsoPlainText"> return -ENOTSUPP;<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">+ if (ras && ras->supported)<o:p></o:p></p>
<p class="MsoPlainText">+ adev->nbio.funcs->enable_doorbell_interrupt(adev, false);<o:p></o:p></p>
<p class="MsoPlainText">+<o:p></o:p></p>
<p class="MsoPlainText"> if (is_support_sw_smu(adev)) {<o:p></o:p></p>
<p class="MsoPlainText"> struct smu_context *smu = &adev->smu;<o:p></o:p></p>
<p class="MsoPlainText"> int ret;<o:p></o:p></p>
<p class="MsoPlainText">@@ -4319,8 +4323,6 @@ int amdgpu_device_baco_enter(struct drm_device *dev)<o:p></o:p></p>
<p class="MsoPlainText"> ret = smu_baco_enter(smu);<o:p></o:p></p>
<p class="MsoPlainText"> if (ret)<o:p></o:p></p>
<p class="MsoPlainText"> return ret;<o:p></o:p></p>
<p class="MsoPlainText">-<o:p></o:p></p>
<p class="MsoPlainText">- return 0;<o:p></o:p></p>
<p class="MsoPlainText"> } else {<o:p></o:p></p>
<p class="MsoPlainText"> void *pp_handle = adev->powerplay.pp_handle;<o:p></o:p></p>
<p class="MsoPlainText"> const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs; @@ -4331,14 +4333,15 @@ int amdgpu_device_baco_enter(struct drm_device *dev)<o:p></o:p></p>
<p class="MsoPlainText"> /* enter BACO state */<o:p></o:p></p>
<p class="MsoPlainText"> if (pp_funcs->set_asic_baco_state(pp_handle, 1))<o:p></o:p></p>
<p class="MsoPlainText"> return -EIO;<o:p></o:p></p>
<p class="MsoPlainText">-<o:p></o:p></p>
<p class="MsoPlainText">- return 0;<o:p></o:p></p>
<p class="MsoPlainText"> }<o:p></o:p></p>
<p class="MsoPlainText">+<o:p></o:p></p>
<p class="MsoPlainText">+ return 0;<o:p></o:p></p>
<p class="MsoPlainText">}<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"> int amdgpu_device_baco_exit(struct drm_device *dev) {<o:p></o:p></p>
<p class="MsoPlainText"> struct amdgpu_device *adev = dev->dev_private;<o:p></o:p></p>
<p class="MsoPlainText">+ struct amdgpu_ras *ras = amdgpu_ras_get_context(adev);<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"> if (!amdgpu_device_supports_baco(adev->ddev))<o:p></o:p></p>
<p class="MsoPlainText"> return -ENOTSUPP;<o:p></o:p></p>
<p class="MsoPlainText">@@ -4351,7 +4354,6 @@ int amdgpu_device_baco_exit(struct drm_device *dev)<o:p></o:p></p>
<p class="MsoPlainText"> if (ret)<o:p></o:p></p>
<p class="MsoPlainText"> return ret;<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">- return 0;<o:p></o:p></p>
<p class="MsoPlainText"> } else {<o:p></o:p></p>
<p class="MsoPlainText"> void *pp_handle = adev->powerplay.pp_handle;<o:p></o:p></p>
<p class="MsoPlainText"> const struct amd_pm_funcs *pp_funcs = adev->powerplay.pp_funcs; @@ -4362,7 +4364,10 @@ int amdgpu_device_baco_exit(struct drm_device *dev)<o:p></o:p></p>
<p class="MsoPlainText"> /* exit BACO state */<o:p></o:p></p>
<p class="MsoPlainText"> if (pp_funcs->set_asic_baco_state(pp_handle, 0))<o:p></o:p></p>
<p class="MsoPlainText"> return -EIO;<o:p></o:p></p>
<p class="MsoPlainText">-<o:p></o:p></p>
<p class="MsoPlainText">- return 0;<o:p></o:p></p>
<p class="MsoPlainText"> }<o:p></o:p></p>
<p class="MsoPlainText">+<o:p></o:p></p>
<p class="MsoPlainText">+ if (ras && ras->supported)<o:p></o:p></p>
<p class="MsoPlainText">+ adev->nbio.funcs->enable_doorbell_interrupt(adev, false);<o:p></o:p></p>
<p class="MsoPlainText">+<o:p></o:p></p>
<p class="MsoPlainText"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText"><span style="color:#2F5597">[Hawking] Shouldn't be enabled doorbell interrupt after exit baco? Or do I miss something?<o:p></o:p></span></p>
<p class="MsoPlainText"><span style="color:black"><o:p> </o:p></span></p>
<p class="MsoPlainText">+ return 0;<o:p></o:p></p>
<p class="MsoPlainText">}<o:p></o:p></p>
<p class="MsoPlainText">--<o:p></o:p></p>
<p class="MsoPlainText">2.7.4<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
</div>
</body>
</html>