From patchwork Thu Mar 22 10:41:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 889294 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 406NcQ4Mtnz9s1X for ; Thu, 22 Mar 2018 21:45:42 +1100 (AEDT) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PY/CvGXF"; dkim-atps=neutral Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 406NcQ2lQ5zF1ww for ; Thu, 22 Mar 2018 21:45:42 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PY/CvGXF"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:400e:c05::241; helo=mail-pg0-x241.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="PY/CvGXF"; dkim-atps=neutral Received: from mail-pg0-x241.google.com (mail-pg0-x241.google.com [IPv6:2607:f8b0:400e:c05::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 406NXH37k0zF1kt for ; Thu, 22 Mar 2018 21:42:07 +1100 (AEDT) Received: by mail-pg0-x241.google.com with SMTP id s13so3090667pgn.12 for ; Thu, 22 Mar 2018 03:42:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=vzZLexRqcJ7NTjlxgzeWV9hL+Td53Q8vTp2ecaTL50s=; b=PY/CvGXFQVjcerbAxV5vrDS38hfObYHcJhHuP3Np20in5QOimOoMnvG7kWXxGZ66yi RxbIzBNkXsva+yKdioPen3L7N6UiV9h5NJh7ULk+IlBPkOLI25b2TzETonx+F9A7duay Ybfh3foBM40UEPS9RzRgGtyP2KkK8VryYFXQ7nwfcT3mD2fWqBUVgJ7YTbWX9JnXnFrw A9tlKe1FkA1fvhwOysAFfyx9LSvtpCSFEVD+xqHMlTpL1sQ1ARKGR7T5nwVDbT53R98f JEvIMKEA6yi15DeCM2bSz3pNsRSFZE4dLGnYRFZr17WymZCFNCdN5YU46zXv66diCpCw 2Exg== 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; bh=vzZLexRqcJ7NTjlxgzeWV9hL+Td53Q8vTp2ecaTL50s=; b=eJBWkN0sfVsCYAWUAL8z/2/1qwLKZG8eLA0OPCFdtarf/1IzXIKo4QmbMFNUepjKYK sS29UWiNLjrTNksEjIxc6smeBQccJt09dS7QhaJrWI7WO5fcQmF/lVvUc07ThaAIq90d ifIFePE1f64zcNikJ8BoaF5D501/CD99SD7Jd15vGbVsqv1qAM5QF2GgvC70/O7O3NBI 79uItw6QXRx5QDrkPya0maCG0LEAuZZNLFu//bLKGQyAbskSBjG+3+K2rn4s0jqECrlB iDPFXIsVPwoZ2PR5aLr5Pthwx5Py4EMoS5lcHTq4m7gHKk5S9Q17gcwoiPE1C+G7N7/i 2Rhw== X-Gm-Message-State: AElRT7EGPfEZ2LC4SM2pxACd0AsdBGjzfw6BPly/bn+MhdGMK5jxNbYw b9aLEVCNNqaGn28BfgFhewY42Q== X-Google-Smtp-Source: AG47ELtTFb5/Vzyye2wbldTjrUAqAu3D+nq398npEP1b9tpsh7rzAWRXiPBeq2P0Jk95aHuym54p8Q== X-Received: by 10.101.71.202 with SMTP id f10mr17113798pgs.366.1521715324406; Thu, 22 Mar 2018 03:42:04 -0700 (PDT) Received: from roar.ozlabs.ibm.com (115-64-218-172.tpgi.com.au. [115.64.218.172]) by smtp.gmail.com with ESMTPSA id 68sm12483952pfx.130.2018.03.22.03.42.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Mar 2018 03:42:03 -0700 (PDT) From: Nicholas Piggin To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH] powerpc: Fix smp_wmb barrier definition use use lwsync consistently Date: Thu, 22 Mar 2018 20:41:46 +1000 Message-Id: <20180322104146.5350-1-npiggin@gmail.com> X-Mailer: git-send-email 2.16.1 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anton Blanchard , Nicholas Piggin Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" asm/barrier.h is not always included after asm/synch.h, which meant it was missing __SUBARCH_HAS_LWSYNC, so in some files smp_wmb() would be eieio when it should be lwsync. kernel/time/hrtimer.c is one case. __SUBARCH_HAS_LWSYNC is only used in one place, so just fold it in to where it's used. Previously with my small simulator config, 377 instances of eieio in the tree. After this patch there are 55. Cc: Anton Blanchard Signed-off-by: Nicholas Piggin --- arch/powerpc/include/asm/barrier.h | 3 ++- arch/powerpc/include/asm/synch.h | 4 ---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/include/asm/barrier.h b/arch/powerpc/include/asm/barrier.h index 10daa1d56e0a..c7c63959ba91 100644 --- a/arch/powerpc/include/asm/barrier.h +++ b/arch/powerpc/include/asm/barrier.h @@ -35,7 +35,8 @@ #define rmb() __asm__ __volatile__ ("sync" : : : "memory") #define wmb() __asm__ __volatile__ ("sync" : : : "memory") -#ifdef __SUBARCH_HAS_LWSYNC +/* The sub-arch has lwsync */ +#if defined(__powerpc64__) || defined(CONFIG_PPC_E500MC) # define SMPWMB LWSYNC #else # define SMPWMB eieio diff --git a/arch/powerpc/include/asm/synch.h b/arch/powerpc/include/asm/synch.h index 63e7f5a1f105..6ec546090ba1 100644 --- a/arch/powerpc/include/asm/synch.h +++ b/arch/powerpc/include/asm/synch.h @@ -6,10 +6,6 @@ #include #include -#if defined(__powerpc64__) || defined(CONFIG_PPC_E500MC) -#define __SUBARCH_HAS_LWSYNC -#endif - #ifndef __ASSEMBLY__ extern unsigned int __start___lwsync_fixup, __stop___lwsync_fixup; extern void do_lwsync_fixups(unsigned long value, void *fixup_start,