All of lore.kernel.org
 help / color / mirror / Atom feed
From: Felix Kuehling <felix.kuehling-5C7GfCeVMHo@public.gmane.org>
To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
Subject: Re: [PATCH 2/5] drm/amdgpu/sdma4: set wptr shadow atomically
Date: Thu, 27 Jul 2017 16:39:15 -0400	[thread overview]
Message-ID: <ae92b966-bff6-b727-6c57-f4dbaa388b46@amd.com> (raw)
In-Reply-To: <1501184765-26699-2-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>


On 17-07-27 03:46 PM, Alex Deucher wrote:
> No functional change until wptr polling uses this
> location (future patch).
>
> Cc: Frank Min <Frank.Min@amd.com>
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> index 7cb5320..9392799 100644
> --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
> @@ -301,8 +301,8 @@ static void sdma_v4_0_ring_set_wptr(struct amdgpu_ring *ring)
>  				lower_32_bits(ring->wptr << 2),
>  				upper_32_bits(ring->wptr << 2));
>  		/* XXX check if swapping is necessary on BE */
> -		adev->wb.wb[ring->wptr_offs] = lower_32_bits(ring->wptr << 2);
> -		adev->wb.wb[ring->wptr_offs + 1] = upper_32_bits(ring->wptr << 2);
> +		atomic64_set((atomic64_t *)&adev->wb.wb[ring->wptr_offs],
> +			     (ring->wptr << 2));

This looks a bit awkward. Would "writeq" do the job? That's what we use
for updating kernel queue doorbells in KFD.

The generic implementation of atomic64_set uses a spinlock. But that
doesn't do anything for protecting against concurrent access by the GPU
hardware.

Regards,
  Felix

>  		DRM_DEBUG("calling WDOORBELL64(0x%08x, 0x%016llx)\n",
>  				ring->doorbell_index, ring->wptr << 2);
>  

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

  parent reply	other threads:[~2017-07-27 20:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-27 19:46 [PATCH 1/5] drm/amdgpu/sdma4: drop unused register header Alex Deucher
     [not found] ` <1501184765-26699-1-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2017-07-27 19:46   ` [PATCH 2/5] drm/amdgpu/sdma4: set wptr shadow atomically Alex Deucher
     [not found]     ` <1501184765-26699-2-git-send-email-alexander.deucher-5C7GfCeVMHo@public.gmane.org>
2017-07-27 20:39       ` Felix Kuehling [this message]
     [not found]         ` <ae92b966-bff6-b727-6c57-f4dbaa388b46-5C7GfCeVMHo@public.gmane.org>
2017-07-27 20:50           ` Alex Deucher
     [not found]             ` <CADnq5_OE3zAfpir1x-m-b7Oy53D=ZaN7TjB5XmUoQT0Ln=DC_g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-07-28  8:54               ` Christian König
2017-07-27 19:46   ` [PATCH 3/5] drm/amdgpu/sdma4: drop hdp flush from wptr shadow update Alex Deucher
2017-07-27 19:46   ` [PATCH 4/5] drm/amdgpu/sdma4: drop allocation of poll_mem_offs Alex Deucher
2017-07-27 19:46   ` [PATCH 5/5] drm/amdgpu/sdma4: move wptr polling setup Alex Deucher
2017-07-28  8:56   ` [PATCH 1/5] drm/amdgpu/sdma4: drop unused register header Christian König

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=ae92b966-bff6-b727-6c57-f4dbaa388b46@amd.com \
    --to=felix.kuehling-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.