<div dir="ltr"><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jul 28, 2015 at 6:56 PM, Dan Carpenter <span dir="ltr"><<a href="mailto:dan.carpenter@oracle.com" target="_blank">dan.carpenter@oracle.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello Oded Gabbay,<br>
<br>
The patch 32c22e994f44: "drm/amdgpu: add amdgpu <--> amdkfd gfx7<br>
interface" from Jun 12, 2015, leads to the following static checker<br>
warning:<br>
<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c:453 kgd_hqd_destroy()<br>
warn: bitwise AND condition is false here<br>
<br>
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c<br>
439 static int kgd_hqd_destroy(struct kgd_dev *kgd, uint32_t reset_type,<br>
440 unsigned int timeout, uint32_t pipe_id,<br>
441 uint32_t queue_id)<br>
442 {<br>
443 struct amdgpu_device *adev = get_amdgpu_device(kgd);<br>
444 uint32_t temp;<br>
445<br>
446 acquire_queue(kgd, pipe_id, queue_id);<br>
447 WREG32(mmCP_HQD_PQ_DOORBELL_CONTROL, 0);<br>
448<br>
449 WREG32(mmCP_HQD_DEQUEUE_REQUEST, reset_type);<br>
450<br>
451 while (true) {<br>
452 temp = RREG32(mmCP_HQD_ACTIVE);<br>
453 if (temp & CP_HQD_ACTIVE__ACTIVE__SHIFT)<br>
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>
Never true. ANDing against a shift is weird. A zero shift is sort of<br>
pointless, also.<br>
<br>
454 break;<br>
455 if (timeout == 0) {<br>
456 pr_err("kfd: cp queue preemption time out (%dms)\n",<br>
457 temp);<br>
458 release_queue(kgd);<br>
459 return -ETIME;<br>
460 }<br>
461 msleep(20);<br>
462 timeout -= 20;<br>
463 }<br>
464<br>
465 release_queue(kgd);<br>
466 return 0;<br>
467 }<br>
<br>
regards,<br>
dan carpenter<br>
</blockquote></div><br></div><div class="gmail_extra"><div class="gmail_default" style="font-size:small">Dan, thanks for catching that!</div><div class="gmail_default" style="font-size:small">Will send a fix shortly.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"> Oded</div><br></div><img width="0" height="0" class="mailtrack-img" src="https://mailtrack.io/trace/mail/3e7663106717af89408a68c988a5beb2cc2475a8.png"></div>