From patchwork Mon May 20 17:23:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Parri X-Patchwork-Id: 10955983 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 AC6E36C5 for ; Wed, 22 May 2019 14:36:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9D11A28C6F for ; Wed, 22 May 2019 14:36:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AFCF28C86; Wed, 22 May 2019 14:36:43 +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 C735328C6F for ; Wed, 22 May 2019 14:36:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 790B789ADC; Wed, 22 May 2019 14:35:28 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by gabe.freedesktop.org (Postfix) with ESMTPS id A100C8921C for ; Mon, 20 May 2019 17:24:36 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id q15so168769wmj.0 for ; Mon, 20 May 2019 10:24:36 -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=37CxHYKlFVVAIEnj21tdjvUOrJCuiyhrkjA75AgmUDE=; b=NzdBjszG2Cqdfh/o3vznzdaUT7qim2HSQxKXt23xelpG0X91uHU4xQCGi4kS8Tgz5W rXiT6Y8wSTIFm3YM7An69cqYkAPzXmAcxgPTq8Jrsu+kW4QBLOMoHcRuWIrw8EeZiMuE QvBjZ0nZugJUHj2GLIjXlewVgO9/1UOKT2Io5bT9OqnRFuIs9MDAEIdV0/ywye0+HO5T zNhitkzv7+w85BkMp40EopdMQH199CE+2EoY48MAz/fS4lOBwgBmXJ72MB5ZlKix1Uxl 5QlKbexZuYFBkjcscUV6bPNA0X5hI+zOFDsAkwawLO+vkex9InX2jTERL03HJOUidlYB 4f6g== X-Gm-Message-State: APjAAAUZjlQ5AEhN+RrTpFXmQ2P8rXAv03xFYoc6r6jJjdBu6czHeHuF x3V9jCbdU2wSjvhnGCKPof8tkw== X-Google-Smtp-Source: APXvYqxV/0ooJTzXznpbzssyf0Zwt44GQp/pzzVYbD8W+Rh1jTkMM3EzUOJLQxOAZDv/ikTEgktB8w== X-Received: by 2002:a1c:9dc7:: with SMTP id g190mr146017wme.121.1558373075294; Mon, 20 May 2019 10:24:35 -0700 (PDT) Received: from localhost.localdomain ([91.253.179.221]) by smtp.gmail.com with ESMTPSA id b12sm180021wmg.27.2019.05.20.10.24.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 20 May 2019 10:24:34 -0700 (PDT) From: Andrea Parri To: linux-kernel@vger.kernel.org Subject: [PATCH 1/4] drm/msm: Fix improper uses of smp_mb__{before, after}_atomic() Date: Mon, 20 May 2019 19:23:55 +0200 Message-Id: <1558373038-5611-2-git-send-email-andrea.parri@amarulasolutions.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1558373038-5611-1-git-send-email-andrea.parri@amarulasolutions.com> References: <1558373038-5611-1-git-send-email-andrea.parri@amarulasolutions.com> X-Mailman-Approved-At: Wed, 22 May 2019 14:35:24 +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=37CxHYKlFVVAIEnj21tdjvUOrJCuiyhrkjA75AgmUDE=; b=QXPL+94F09z4z+ao64JQeUt9XFjjtv8g/N09kNE3fTGLUbp/qYLl1g57/r3St9bLbM 8ytkzOh0Wuy8BN9SlXxU9XZyfWLOan/bGagJczwA0VwsDnRdfZC+BvBUhMUoa7OVVnGu Xm4cRqIxYjsIiLDMFpj6u8/02xysp+dxL6e8g= 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, Peter Zijlstra , dri-devel@lists.freedesktop.org, "Paul E. McKenney" , 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 Cc: "Paul E. McKenney" Cc: Peter Zijlstra --- 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 */