<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;background-color:#FFFFFF;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p><br>
</p>
<meta content="text/html; charset=UTF-8">
<div dir="ltr">
<div id="x_divtagdefaultwrapper" style="font-size:12pt; color:#000000; background-color:#FFFFFF; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Dave:</p>
<p><br>
</p>
<p>Thanks to your response. if it uses WARN() or WARN_ON(). Does it also block the process with for() endless loop? I thinks it is
<span id="w_10"></span><span id="w_11" class="high-light high-light-bg">essential</span>. What do you think?</p>
<p><br>
</p>
<p>Thanks</p>
<p>JimQu<font size="2"><span style="font-size:10pt"></span></font><br>
</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font style="font-size:11pt" face="Calibri, sans-serif" color="#000000"><b>发件人:</b> Dave Airlie <airlied@gmail.com><br>
<b>发送时间:</b> 2016年7月12日 11:35:19<br>
<b>收件人:</b> Qu, Jim<br>
<b>抄送:</b> amd-gfx mailing list<br>
<b>主题:</b> Re: [PATCH] drm/amdgpu: replace BUG_ON() and BUG()</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt">
<div class="PlainText">On 12 July 2016 at 10:16, jimqu <Jim.Qu@amd.com> wrote:<br>
> Sometimes, it maybe a ring test failure during S3 resume. When that<br>
> happens, it will be kernel panic in the fence interrupt and will<br>
> hangs up system. it is difficult to get any information from kernel<br>
> for debug.<br>
<br>
Please just use WARN or WARN_ON.<br>
<br>
Dave.<br>
<br>
><br>
> Change-Id: Iafa6c3793be151b8b85cf4299b929ba333b6174e<br>
> Signed-off-by: JimQu <Jim.Qu@amd.com><br>
> ---<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 15 +++++++++++++++<br>
> drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 4 ++--<br>
> 2 files changed, 17 insertions(+), 2 deletions(-)<br>
><br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> index c3bf33f..15b6c5d 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h<br>
> @@ -2242,6 +2242,21 @@ amdgpu_get_sdma_instance(struct amdgpu_ring *ring)<br>
> }<br>
><br>
> /*<br>
> + * Debug helpers<br>
> + */<br>
> +#define AMDGPU_BUG() do { \<br>
> + printk(KERN_ERR "BUG: failure at %s:%d/%s()!\n", __FILE__, __LINE__, __FUNCTION__); \<br>
> + dump_stack(); \<br>
> + for (;;); \<br>
> + } while (0)<br>
> +<br>
> +#define AMDGPU_BUG_ON(condition) do { \<br>
> + if (unlikely((condition)!= 0)) { \<br>
> + AMDGPU_BUG(); \<br>
> + } \<br>
> + } while (0)<br>
> +<br>
> +/*<br>
> * ASICs macro.<br>
> */<br>
> #define amdgpu_asic_set_vga_state(adev, state) (adev)->asic_funcs->set_vga_state((adev), (state))<br>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c<br>
> index d155876..b8e5fa7 100644<br>
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c<br>
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c<br>
> @@ -213,13 +213,13 @@ void amdgpu_fence_process(struct amdgpu_ring *ring)<br>
> fence = rcu_dereference_protected(*ptr, 1);<br>
> RCU_INIT_POINTER(*ptr, NULL);<br>
><br>
> - BUG_ON(!fence);<br>
> + AMDGPU_BUG_ON(!fence);<br>
><br>
> r = fence_signal(fence);<br>
> if (!r)<br>
> FENCE_TRACE(fence, "signaled from irq context\n");<br>
> else<br>
> - BUG();<br>
> + AMDGPU_BUG();<br>
><br>
> fence_put(fence);<br>
> }<br>
> --<br>
> 1.9.1<br>
><br>
> _______________________________________________<br>
> amd-gfx mailing list<br>
> amd-gfx@lists.freedesktop.org<br>
> <a id="LPlnk553956" href="https://lists.freedesktop.org/mailman/listinfo/amd-gfx">
https://lists.freedesktop.org/mailman/listinfo/amd-gfx</a><br>
</div>
</span></font></div>
</body>
</html>