All of lore.kernel.org
 help / color / mirror / Atom feed
* re: drm/amdgpu: add amdgpu <--> amdkfd gfx7 interface
@ 2015-07-28 15:56 Dan Carpenter
  2015-07-29  7:31 ` Oded Gabbay
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2015-07-28 15:56 UTC (permalink / raw)
  To: oded.gabbay; +Cc: dri-devel

Hello Oded Gabbay,

The patch 32c22e994f44: "drm/amdgpu: add amdgpu <--> amdkfd gfx7
interface" from Jun 12, 2015, leads to the following static checker
warning:

	drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c:453 kgd_hqd_destroy()
	warn: bitwise AND condition is false here

drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c
   439  static int kgd_hqd_destroy(struct kgd_dev *kgd, uint32_t reset_type,
   440                                  unsigned int timeout, uint32_t pipe_id,
   441                                  uint32_t queue_id)
   442  {
   443          struct amdgpu_device *adev = get_amdgpu_device(kgd);
   444          uint32_t temp;
   445  
   446          acquire_queue(kgd, pipe_id, queue_id);
   447          WREG32(mmCP_HQD_PQ_DOORBELL_CONTROL, 0);
   448  
   449          WREG32(mmCP_HQD_DEQUEUE_REQUEST, reset_type);
   450  
   451          while (true) {
   452                  temp = RREG32(mmCP_HQD_ACTIVE);
   453                  if (temp & CP_HQD_ACTIVE__ACTIVE__SHIFT)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Never true.  ANDing against a shift is weird.  A zero shift is sort of
pointless, also.

   454                          break;
   455                  if (timeout == 0) {
   456                          pr_err("kfd: cp queue preemption time out (%dms)\n",
   457                                  temp);
   458                          release_queue(kgd);
   459                          return -ETIME;
   460                  }
   461                  msleep(20);
   462                  timeout -= 20;
   463          }
   464  
   465          release_queue(kgd);
   466          return 0;
   467  }

regards,
dan carpenter
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: drm/amdgpu: add amdgpu <--> amdkfd gfx7 interface
  2015-07-28 15:56 drm/amdgpu: add amdgpu <--> amdkfd gfx7 interface Dan Carpenter
@ 2015-07-29  7:31 ` Oded Gabbay
  0 siblings, 0 replies; 2+ messages in thread
From: Oded Gabbay @ 2015-07-29  7:31 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Maling list - DRI developers


[-- Attachment #1.1: Type: text/plain, Size: 2019 bytes --]

On Tue, Jul 28, 2015 at 6:56 PM, Dan Carpenter <dan.carpenter@oracle.com>
wrote:

> Hello Oded Gabbay,
>
> The patch 32c22e994f44: "drm/amdgpu: add amdgpu <--> amdkfd gfx7
> interface" from Jun 12, 2015, leads to the following static checker
> warning:
>
>         drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c:453
> kgd_hqd_destroy()
>         warn: bitwise AND condition is false here
>
> drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gfx_v7.c
>    439  static int kgd_hqd_destroy(struct kgd_dev *kgd, uint32_t
> reset_type,
>    440                                  unsigned int timeout, uint32_t
> pipe_id,
>    441                                  uint32_t queue_id)
>    442  {
>    443          struct amdgpu_device *adev = get_amdgpu_device(kgd);
>    444          uint32_t temp;
>    445
>    446          acquire_queue(kgd, pipe_id, queue_id);
>    447          WREG32(mmCP_HQD_PQ_DOORBELL_CONTROL, 0);
>    448
>    449          WREG32(mmCP_HQD_DEQUEUE_REQUEST, reset_type);
>    450
>    451          while (true) {
>    452                  temp = RREG32(mmCP_HQD_ACTIVE);
>    453                  if (temp & CP_HQD_ACTIVE__ACTIVE__SHIFT)
>                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> Never true.  ANDing against a shift is weird.  A zero shift is sort of
> pointless, also.
>
>    454                          break;
>    455                  if (timeout == 0) {
>    456                          pr_err("kfd: cp queue preemption time out
> (%dms)\n",
>    457                                  temp);
>    458                          release_queue(kgd);
>    459                          return -ETIME;
>    460                  }
>    461                  msleep(20);
>    462                  timeout -= 20;
>    463          }
>    464
>    465          release_queue(kgd);
>    466          return 0;
>    467  }
>
> regards,
> dan carpenter
>

​Dan, thanks for catching that!
Will send a fix shortly.

​      Oded

[-- Attachment #1.2: Type: text/html, Size: 3168 bytes --]

[-- Attachment #2: Type: text/plain, Size: 159 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-07-29  7:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-28 15:56 drm/amdgpu: add amdgpu <--> amdkfd gfx7 interface Dan Carpenter
2015-07-29  7:31 ` Oded Gabbay

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.