mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@stgolabs.net>
To: robdclark@gmail.com
Cc: sean@poorly.run, dri-devel@lists.freedesktop.org,
	Davidlohr Bueso <dbueso@suse.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drm/msm/a5xx: Fix barrier usage in set_preempt_state()
Date: Tue, 15 Oct 2019 09:21:44 -0700	[thread overview]
Message-ID: <20191015162144.fuyc25tdwvc6ddu3@linux-p48b> (raw)
In-Reply-To: <20191015011438.22184-1-dave@stgolabs.net>

Forgot to Cc lkml.

On Mon, 14 Oct 2019, Davidlohr Bueso wrote:

>Because it is not a Rmw operation, atomic_set() is never serialized,
>and therefore the 'upgradable' smp_mb__{before,after}_atomic() calls
>that order the write to preempt_state are completely bogus.
>
>This patch replaces these with smp_mb(), which seems like the
>original intent of when the code was written.
>
>Signed-off-by: Davidlohr Bueso <dbueso@suse.de>
>---
> drivers/gpu/drm/msm/adreno/a5xx_preempt.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/gpu/drm/msm/adreno/a5xx_preempt.c b/drivers/gpu/drm/msm/adreno/a5xx_preempt.c
>index 9cf9353a7ff1..d27d8d3208c6 100644
>--- a/drivers/gpu/drm/msm/adreno/a5xx_preempt.c
>+++ b/drivers/gpu/drm/msm/adreno/a5xx_preempt.c
>@@ -30,10 +30,10 @@ static inline void set_preempt_state(struct a5xx_gpu *gpu,
> 	 * preemption or in the interrupt handler so barriers are needed
> 	 * before...
> 	 */
>-	smp_mb__before_atomic();
>+	smp_mb();
> 	atomic_set(&gpu->preempt_state, new);
> 	/* ... and after*/
>-	smp_mb__after_atomic();
>+	smp_mb();
> }
>
> /* Write the most recent wptr for the given ring into the hardware */
>-- 
>2.16.4
>

           reply	other threads:[~2019-10-15 16:23 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <20191015011438.22184-1-dave@stgolabs.net>]

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=20191015162144.fuyc25tdwvc6ddu3@linux-p48b \
    --to=dave@stgolabs.net \
    --cc=dbueso@suse.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®