All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org
Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: [bug report] drm/amdgpu/virt: use kiq to access registers (v2)
Date: Tue, 7 Feb 2017 11:31:27 +0300	[thread overview]
Message-ID: <20170207083127.GA26177@mwanda> (raw)

Hello Xiangliang Yu,

The patch bc992ba5a3c1: "drm/amdgpu/virt: use kiq to access registers
(v2)" from Jan 12, 2017, leads to the following static checker
warning:

	drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c:122 amdgpu_virt_kiq_rreg()
	error: uninitialized symbol 'f'.

drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c
   104  uint32_t amdgpu_virt_kiq_rreg(struct amdgpu_device *adev, uint32_t reg)
   105  {
   106          signed long r;
   107          uint32_t val;
   108          struct dma_fence *f;
   109          struct amdgpu_kiq *kiq = &adev->gfx.kiq;
   110          struct amdgpu_ring *ring = &kiq->ring;
   111  
   112          BUG_ON(!ring->funcs->emit_rreg);
   113  
   114          mutex_lock(&adev->virt.lock);
   115          amdgpu_ring_alloc(ring, 32);
   116          amdgpu_ring_emit_hdp_flush(ring);
   117          amdgpu_ring_emit_rreg(ring, reg);
   118          amdgpu_ring_emit_hdp_invalidate(ring);
   119          amdgpu_fence_emit(ring, &f);

What about if amdgpu_fence_emit() returns -ENOMEM?

   120          amdgpu_ring_commit(ring);
   121          mutex_unlock(&adev->virt.lock);
   122  
   123          r = dma_fence_wait(f, false);
   124          if (r)
   125                  DRM_ERROR("wait for kiq fence error: %ld.\n", r);
   126          dma_fence_put(f);
   127  
   128          val = adev->wb.wb[adev->virt.reg_val_offs];
   129  
   130          return val;
   131  }

regards,
dan carpenter
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

                 reply	other threads:[~2017-02-07  8:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170207083127.GA26177@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=Xiangliang.Yu-5C7GfCeVMHo@public.gmane.org \
    --cc=amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.