From patchwork Mon Apr 29 20:14:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Parri X-Patchwork-Id: 10922887 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4EA0014B6 for ; Tue, 30 Apr 2019 07:10:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B94F2872A for ; Tue, 30 Apr 2019 07:10:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2FDC2287DC; Tue, 30 Apr 2019 07:10:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id ACBFD2872A for ; Tue, 30 Apr 2019 07:10:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2F93F89415; Tue, 30 Apr 2019 07:10:04 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by gabe.freedesktop.org (Postfix) with ESMTPS id E8DCA890F4 for ; Mon, 29 Apr 2019 20:15:55 +0000 (UTC) Received: by mail-wr1-x443.google.com with SMTP id t17so17819814wrw.13 for ; Mon, 29 Apr 2019 13:15:55 -0700 (PDT) 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=cwSDgO2K8O+XFXJ55U8ANKY2D7WkLem1vQK5GGVD8lV59jU0i1NRwxmsI4kKvG9BwA qHBRmfPrpoSBnIMIR6CqRDgP3rqVEj7aiPXSUbhfwzBAJ1TNNmbMdNWgIN0h7rurvMDl 7gC+6d+U6URl4RowYvqnpO8rXP7W1VqWFTtkB0S9BGFKbtyzoxGg/agAT6wXP1+OYXTs seclFAkQ9ogQfHACgMC2KpWJzWHbW7Cfm/hMIeUiarqh7tr99MovfRxAXm2SFoC1sqxs 9Pb+wzLAEc4zTe10vNiekBvJYD0pi3mss0pVO8MDxbdg0ja72lGcpptDZVgxEqbir6CB vhDg== X-Gm-Message-State: APjAAAViCV9DfSd7V/L4Y5xmWErRzOwcg8nlFAI4DtC23WG6OYh5+ofO pSN9w6shbbiTaTDes3JSJhP1Fw== X-Google-Smtp-Source: APXvYqw63jnClhdJcOMmVCX4Q14I5kSfu+qjnhDfPAb2p9j2fIrWdfwp6P5Jp2R5xGLI7EjMZ+WPsA== 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 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> X-Mailman-Approved-At: Tue, 30 Apr 2019 07:09:47 +0000 X-Mailman-Original-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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrea Parri , freedreno@lists.freedesktop.org, David Airlie , linux-arm-msm@vger.kernel.org, stable@vger.kernel.org, dri-devel@lists.freedesktop.org, Sean Paul MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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 */