Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4074104yba; Mon, 29 Apr 2019 13:17:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqxjU68PQUIkl3qakGVHy3fJkeXQDvofEtkHDdOXAiYBDWOqlp5jUg3MdXFMIsqaEgBopLY0 X-Received: by 2002:a65:50c2:: with SMTP id s2mr62021428pgp.112.1556569042469; Mon, 29 Apr 2019 13:17:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556569042; cv=none; d=google.com; s=arc-20160816; b=f9xcxER0JdTScmp0yvI80u9O2RrAcDv3C/hJsOac9pQjIx/6DGxtzcRqFR9NVYP8vQ HjT5tWNy82iJGrR67azBJtEVUy7CyDUNdt0mRrStdfHJECBa2/F0DVekJDREbyzGN6Q6 vc3A3NCXgmz2pR4/s0tTNXwPtXRHGra7g2JZQlB1+Uwc2iW7e1PWuWcQYtz50/f2hmVx 44sI8GvLYsMQW4duz2QS/2Uen0lzfB+Y41mrsaX0nFWawzTazG/23nE86LFKPaRJBuFP u6F3CvvghbDXQk87CCDLImRTGnKRPPnQCx5odE5f3Dah6OUINBqHpTQlhfVSERAONFAt dF/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=vCxinVg6A2SbZ9ILJWHL9gGNmahRdcgdd1xrKNk0P5I=; b=MnA5bqnEgldzMTy3Zr8LbkljIL2l5wK7gyZseY21Da4cuE5zRfF8Kb/By4M55PxdxZ LGOLPKARkI8U0uzkZSAPOXzvILwDEKelNiBwW9+VhaaNyrIuQ5Jn2v2QlJxSEpUaXzFC k+FwJTvlXtNOMm2EfUhX04P4pvZ3hiIZpSamM1CKKc/ZsgL+kN5FNGeldXViO78FX9hb 2LyEvfnQUJUKEm4fx0ucVpY0jEN9xhG7VIhDoFn/xMT9xw3+tYCQQiYn9g4dG8DSza6g cBQ+LaeYqDSSdW5E7RbZk4dPfG7CL7XMwvJVXMJf6Pet1XgOmRqV6GimUob84iJtrh7l hl5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=l1Fo0n6u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m3si2143474plt.394.2019.04.29.13.17.06; Mon, 29 Apr 2019 13:17:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@amarulasolutions.com header.s=google header.b=l1Fo0n6u; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729345AbfD2UP5 (ORCPT + 99 others); Mon, 29 Apr 2019 16:15:57 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:35447 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729260AbfD2UP4 (ORCPT ); Mon, 29 Apr 2019 16:15:56 -0400 Received: by mail-wr1-f68.google.com with SMTP id f7so9374552wrs.2 for ; Mon, 29 Apr 2019 13:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=vCxinVg6A2SbZ9ILJWHL9gGNmahRdcgdd1xrKNk0P5I=; b=l1Fo0n6uuK81vsv4KUn6MAwronVLRTlTPD56VCaSdgU8NGFkVEOa609qnKppM/uCO2 HRgtrD83lc/5DFL2xOjq3oahOEW1qqD3ehf1gcdxcWCNoazbEXEAR2cf5vf3SeNvIXu8 xGW9OWHJbo1YhQVyG7oYR8xqAkT/BUsxIeWqo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=vCxinVg6A2SbZ9ILJWHL9gGNmahRdcgdd1xrKNk0P5I=; b=dUf4itAkqzcrbtM1H7alB+zBKk/XjSwlREB4oH37w45XeHd0x8BeyjCOz20bikDMi3 hoRbjdh4auiODWaEJILwNQg1hISIZgSapoOmtokjHknX3Ri8kaBQo5xZUsrXJ+bL2+KL St4qdeWRSVeEyejccZ9JirSN7kYbaFftYRFgxTRorV7a4OA5ZmvWBISwL/WC/AYjpr2B e4hA5Mb4snAKjTT46iP8yd1XKsPfxg4MybBejHFwloDnTD44cjJDYu+cp2AZcwr0oME3 DP9mABkXqOmweDFCLXLi4GHquVVouWcVlD9560nSW4qdkOeCrX9xGQkVtI/+oARyL9fL nUDQ== X-Gm-Message-State: APjAAAWcU73IUfxMezUHFoXXXpWJQ/25V5AdZMWcgRO1N2ME5eEYj2Ck GMg3UlWtZ0okLL5U8jiqQs0kJboybc0= X-Received: by 2002:a05:6000:12cb:: with SMTP id l11mr703764wrx.89.1556568954590; Mon, 29 Apr 2019 13:15:54 -0700 (PDT) Received: from localhost.localdomain (ip-93-97.sn2.clouditalia.com. [83.211.93.97]) by smtp.gmail.com with ESMTPSA id k6sm22864019wrd.20.2019.04.29.13.15.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Apr 2019 13:15:53 -0700 (PDT) From: Andrea Parri To: linux-kernel@vger.kernel.org Cc: Andrea Parri , stable@vger.kernel.org, Rob Clark , Sean Paul , David Airlie , Daniel Vetter , Jordan Crouse , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org Subject: [PATCH 1/5] drm/msm: Fix improper uses of smp_mb__{before,after}_atomic() Date: Mon, 29 Apr 2019 22:14:57 +0200 Message-Id: <1556568902-12464-2-git-send-email-andrea.parri@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com> References: <1556568902-12464-1-git-send-email-andrea.parri@amarulasolutions.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org These barriers only apply to the read-modify-write operations; in particular, they do not apply to the atomic_set() primitive. Replace the barriers with smp_mb()s. Fixes: b1fc2839d2f92 ("drm/msm: Implement preemption for A5XX targets") Cc: stable@vger.kernel.org Reported-by: "Paul E. McKenney" Reported-by: Peter Zijlstra Signed-off-by: Andrea Parri Cc: Rob Clark Cc: Sean Paul Cc: David Airlie Cc: Daniel Vetter Cc: Jordan Crouse Cc: linux-arm-msm@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: freedreno@lists.freedesktop.org --- 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 3d62310a535fb..ee0820ee0c664 100644 --- a/drivers/gpu/drm/msm/adreno/a5xx_preempt.c +++ b/drivers/gpu/drm/msm/adreno/a5xx_preempt.c @@ -39,10 +39,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.7.4