<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=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Aptos;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
font-size:12.0pt;
font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
font-size:10.0pt;
font-family:"Courier New";}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:Consolas;}
span.hljs
{mso-style-name:hljs;}
span.EmailStyle22
{mso-style-type:personal-reply;
font-family:"Aptos",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;
mso-ligatures:none;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
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" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-left:.5in"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Nirmoy Das <nirmoy.das@linux.intel.com>
<br>
<b>Sent:</b> Friday, December 6, 2024 11:28 PM<br>
<b>To:</b> Cavitt, Jonathan <jonathan.cavitt@intel.com>; intel-xe@lists.freedesktop.org<br>
<b>Cc:</b> Gupta, saurabhg <saurabhg.gupta@intel.com>; Zuo, Alex <alex.zuo@intel.com>; Vivi, Rodrigo <rodrigo.vivi@intel.com><br>
<b>Subject:</b> Re: [PATCH v2] drm/xe/xe_sync: Add debug printing to check_ufence<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal" style="margin-left:.5in"><o:p> </o:p></p>
<p style="margin-left:.5in"><o:p> </o:p></p>
<div>
<p class="MsoNormal" style="margin-left:.5in">On 12/6/2024 7:11 PM, Jonathan Cavitt wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre style="margin-left:.5in">The xe_sync helper function check_ufence can occasionally report EBUSY<o:p></o:p></pre>
<pre style="margin-left:.5in">if the ufence has not been signalled yet. EBUSY is a non-fatal error<o:p></o:p></pre>
<pre style="margin-left:.5in">value for the function, so it is not desireable to warn in cases where<o:p></o:p></pre>
<pre style="margin-left:.5in">EBUSY is reported because it is up to the user to decide if EBUSY is a<o:p></o:p></pre>
<pre style="margin-left:.5in">fatal error in their use cases. However, we can and should report EBUSY<o:p></o:p></pre>
<pre style="margin-left:.5in">to the debug logs for diagnostic purposes.<o:p></o:p></pre>
<pre style="margin-left:.5in"><o:p> </o:p></pre>
<pre style="margin-left:.5in">v2: Use vm_dbg instead of XE_IOCTL_DBG (Rodrigo)<o:p></o:p></pre>
<pre style="margin-left:.5in"><o:p> </o:p></pre>
<pre style="margin-left:.5in">Signed-off-by: Jonathan Cavitt <a href="mailto:jonathan.cavitt@intel.com"><jonathan.cavitt@intel.com></a><o:p></o:p></pre>
<pre style="margin-left:.5in">CC: Rodrigo Vivi <a href="mailto:rodrigo.vivi@intel.com"><rodrigo.vivi@intel.com></a><o:p></o:p></pre>
<pre style="margin-left:.5in">---<o:p></o:p></pre>
<pre style="margin-left:.5in"> drivers/gpu/drm/xe/xe_vm.c | 10 ++++++++--<o:p></o:p></pre>
<pre style="margin-left:.5in"> 1 file changed, 8 insertions(+), 2 deletions(-)<o:p></o:p></pre>
<pre style="margin-left:.5in"><o:p> </o:p></pre>
<pre style="margin-left:.5in">diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c<o:p></o:p></pre>
<pre style="margin-left:.5in">index 74d684708b00..8c770d1b916c 100644<o:p></o:p></pre>
<pre style="margin-left:.5in">--- a/drivers/gpu/drm/xe/xe_vm.c<o:p></o:p></pre>
<pre style="margin-left:.5in">+++ b/drivers/gpu/drm/xe/xe_vm.c<o:p></o:p></pre>
<pre style="margin-left:.5in">@@ -2402,8 +2402,11 @@ static int op_lock_and_prep(struct drm_exec *exec, struct xe_vm *vm,<o:p></o:p></pre>
<pre style="margin-left:.5in"> break;<o:p></o:p></pre>
<pre style="margin-left:.5in"> case DRM_GPUVA_OP_REMAP:<o:p></o:p></pre>
<pre style="margin-left:.5in"> err = check_ufence(gpuva_to_vma(op->base.remap.unmap->va));<o:p></o:p></pre>
<pre style="margin-left:.5in">- if (err)<o:p></o:p></pre>
<pre style="margin-left:.5in">+ if (err) {<o:p></o:p></pre>
<pre style="margin-left:.5in">+ vm_dbg(&vm->xe->drm,<o:p></o:p></pre>
<pre style="margin-left:.5in">+ "REMAP: vma check ufence status = %i\n", err);<o:p></o:p></pre>
</blockquote>
<p style="margin-left:.5in">Move that to <span class="hljs">check_ufence() instead so there there is only one copy of logging ?
<o:p></o:p></span></p>
<p><span style="font-size:11.0pt">IMO I think there’s value in knowing which operation is failing, and that information would<o:p></o:p></span></p>
<p><span style="font-size:11.0pt">be lost if we moved the logging into check_ufence.<o:p></o:p></span></p>
<p><span style="font-size:11.0pt">-Jonathan Cavitt<o:p></o:p></span></p>
<p style="margin-left:.5in"><span class="hljs">Regards,</span><o:p></o:p></p>
<p style="margin-left:.5in"><span class="hljs">Nirmoy </span><o:p></o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<pre style="margin-left:.5in"><o:p> </o:p></pre>
<pre style="margin-left:.5in"> break;<o:p></o:p></pre>
<pre style="margin-left:.5in">+ }<o:p></o:p></pre>
<pre style="margin-left:.5in"> <o:p></o:p></pre>
<pre style="margin-left:.5in"> err = vma_lock_and_validate(exec,<o:p></o:p></pre>
<pre style="margin-left:.5in"> gpuva_to_vma(op->base.remap.unmap->va),<o:p></o:p></pre>
<pre style="margin-left:.5in">@@ -2415,8 +2418,11 @@ static int op_lock_and_prep(struct drm_exec *exec, struct xe_vm *vm,<o:p></o:p></pre>
<pre style="margin-left:.5in"> break;<o:p></o:p></pre>
<pre style="margin-left:.5in"> case DRM_GPUVA_OP_UNMAP:<o:p></o:p></pre>
<pre style="margin-left:.5in"> err = check_ufence(gpuva_to_vma(op->base.unmap.va));<o:p></o:p></pre>
<pre style="margin-left:.5in">- if (err)<o:p></o:p></pre>
<pre style="margin-left:.5in">+ if (err) {<o:p></o:p></pre>
<pre style="margin-left:.5in">+ vm_dbg(&vm->xe->drm,<o:p></o:p></pre>
<pre style="margin-left:.5in">+ "UNMAP: vma check ufence status = %i\n", err);<o:p></o:p></pre>
<pre style="margin-left:.5in"> break;<o:p></o:p></pre>
<pre style="margin-left:.5in">+ }<o:p></o:p></pre>
<pre style="margin-left:.5in"> <o:p></o:p></pre>
<pre style="margin-left:.5in"> err = vma_lock_and_validate(exec,<o:p></o:p></pre>
<pre style="margin-left:.5in"> gpuva_to_vma(op->base.unmap.va),<o:p></o:p></pre>
</blockquote>
</div>
</body>
</html>