From patchwork Fri Oct 21 20:24:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 13015374 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B5F3C3A59D for ; Fri, 21 Oct 2022 20:24:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229542AbiJUUYo (ORCPT ); Fri, 21 Oct 2022 16:24:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbiJUUYm (ORCPT ); Fri, 21 Oct 2022 16:24:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0115D356D8; Fri, 21 Oct 2022 13:24:39 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 19F7AB82CC6; Fri, 21 Oct 2022 20:24:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AACDFC433D6; Fri, 21 Oct 2022 20:24:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666383876; bh=3P4X0zHHjLwNMrwF5wgbohXwTM8qZDpJ2Rla4uQRiBQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XtzF+mZeViSh19PnMi5v3vWASdHGMikvQMNj+uiMoDwu1BUJgSiq6aRFvOSlKN8d4 rSZXCfwd97FNflLXEfPlArIwmyj12XSUCrMVAq9hDtW8yoG5avxJH+/i96IWGwYvCD oyzIMV8pojfCcKCJzOG6vvNsiXCy4ft9gxLpKH6ByQ5GvjojjENJ8rGBH0SssSIi4p 45uPJKPa7b5h+XTVh8fpPn0ALxjRyuKv5wrs6i6wv6hyfk5gxWI/ItNB2WbwcOUePL uxbPRHMF4jgJ/A/Nv7BRNq5s0NszINzGJaaKSTgE7lIOROgkhynpi70lbHNZ/Hd9g1 aHxaMRaztMf7A== From: Bjorn Helgaas To: Yoshinori Sato , Rich Felker Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 1/4] sh: remove unused SLOW_DOWN_IO Date: Fri, 21 Oct 2022 15:24:21 -0500 Message-Id: <20221021202424.307531-2-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221021202424.307531-1-helgaas@kernel.org> References: <20221021202424.307531-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Bjorn Helgaas io.h defines SLOW_DOWN_IO only when CONF_SLOWDOWN_IO is defined, but CONF_SLOWDOWN_IO is never defined and is in fact explicitly undefined. Remove SLOW_DOWN_IO and related code. N.B. 37b7a97884ba ("sh: machvec IO death.") went to some trouble to add CONF_SLOWDOWN_IO and SLOW_DOWN_IO, for no obvious reason. Maybe there was some out-of-tree case that used this. Signed-off-by: Bjorn Helgaas Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org --- arch/sh/include/asm/io.h | 19 +++---------------- 1 file changed, 3 insertions(+), 16 deletions(-) diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index fba90e670ed4..8043b7c235ca 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h @@ -121,11 +121,6 @@ __BUILD_MEMORY_STRING(__raw_, q, u64) #ifdef CONFIG_HAS_IOPORT_MAP -/* - * Slowdown I/O port space accesses for antique hardware. - */ -#undef CONF_SLOWDOWN_IO - /* * On SuperH I/O ports are memory mapped, so we access them using normal * load/store instructions. sh_io_port_base is the virtual address to @@ -145,13 +140,7 @@ static inline void __set_io_port_base(unsigned long pbase) extern void __iomem *__ioport_map(unsigned long addr, unsigned int size); #endif -#ifdef CONF_SLOWDOWN_IO -#define SLOW_DOWN_IO __raw_readw(sh_io_port_base) -#else -#define SLOW_DOWN_IO -#endif - -#define __BUILD_IOPORT_SINGLE(pfx, bwlq, type, p, slow) \ +#define __BUILD_IOPORT_SINGLE(pfx, bwlq, type, p) \ \ static inline void pfx##out##bwlq##p(type val, unsigned long port) \ { \ @@ -159,7 +148,6 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port) \ \ __addr = __ioport_map(port, sizeof(type)); \ *__addr = val; \ - slow; \ } \ \ static inline type pfx##in##bwlq##p(unsigned long port) \ @@ -169,14 +157,13 @@ static inline type pfx##in##bwlq##p(unsigned long port) \ \ __addr = __ioport_map(port, sizeof(type)); \ __val = *__addr; \ - slow; \ \ return __val; \ } #define __BUILD_IOPORT_PFX(bus, bwlq, type) \ - __BUILD_IOPORT_SINGLE(bus, bwlq, type, ,) \ - __BUILD_IOPORT_SINGLE(bus, bwlq, type, _p, SLOW_DOWN_IO) + __BUILD_IOPORT_SINGLE(bus, bwlq, type,) \ + __BUILD_IOPORT_SINGLE(bus, bwlq, type, _p) #define BUILDIO_IOPORT(bwlq, type) \ __BUILD_IOPORT_PFX(, bwlq, type) From patchwork Fri Oct 21 20:24:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 13015375 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E4AEDC433FE for ; Fri, 21 Oct 2022 20:24:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229788AbiJUUYq (ORCPT ); Fri, 21 Oct 2022 16:24:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229535AbiJUUYm (ORCPT ); Fri, 21 Oct 2022 16:24:42 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 378E639B81; Fri, 21 Oct 2022 13:24:41 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E2339B82D23; Fri, 21 Oct 2022 20:24:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 799CFC433C1; Fri, 21 Oct 2022 20:24:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666383878; bh=Sold5O9Z0l2jkV+weo40l2ACFBfyKqurUW9j4tWzf9Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z5F7bpW03JDQ1QfA+ZZPsS9amEAAU8bSadiiM/irqZIYUY+a4dZ2E4wLIiuvqCx0Z Th2TCoRdshRRwJTo4gZ5Lco+VMzx7Nu8xZDkA3HbZ8M2SEHVKyypISackNZuugzdBS tcc/cPiZHIBG26aGA+mCHGXj+aBr8PiozkePChG2LhqwJrcl2uDxIiZTBm0JXetBNZ KcDqUTb4IDYG3f5OFr1uzaLsCNIqHC/lfFSoQ2w9tpzZF8D7DbDUk3hXw6wrN7o/TE 6Z/MLMIvGJWEjYflr45A2uujM6IErMI/z1UP6c4qzvZ79VteTlvBvJ9hWibgtX6vug 30nZcPZHpVGJQ== From: Bjorn Helgaas To: Yoshinori Sato , Rich Felker Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 2/4] sh: remove unused __BUILD_IOPORT_SINGLE 'pfx' parameter Date: Fri, 21 Oct 2022 15:24:22 -0500 Message-Id: <20221021202424.307531-3-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221021202424.307531-1-helgaas@kernel.org> References: <20221021202424.307531-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Bjorn Helgaas Previously __BUILD_IOPORT_SINGLE() accepted a "pfx" parameter, to which __BUILD_IOPORT_PFX(), the only user of __BUILD_IOPORT_SINGLE(), passed along its own "bus" parameter. But users of __BUILD_IOPORT_PFX() supplied nothing, so both "bus" and "pfx" are pointless. Remove them. Signed-off-by: Bjorn Helgaas --- arch/sh/include/asm/io.h | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index 8043b7c235ca..193640bd9563 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h @@ -140,9 +140,9 @@ static inline void __set_io_port_base(unsigned long pbase) extern void __iomem *__ioport_map(unsigned long addr, unsigned int size); #endif -#define __BUILD_IOPORT_SINGLE(pfx, bwlq, type, p) \ +#define __BUILD_IOPORT_SINGLE(bwlq, type, p) \ \ -static inline void pfx##out##bwlq##p(type val, unsigned long port) \ +static inline void out##bwlq##p(type val, unsigned long port) \ { \ volatile type *__addr; \ \ @@ -150,7 +150,7 @@ static inline void pfx##out##bwlq##p(type val, unsigned long port) \ *__addr = val; \ } \ \ -static inline type pfx##in##bwlq##p(unsigned long port) \ +static inline type in##bwlq##p(unsigned long port) \ { \ volatile type *__addr; \ type __val; \ @@ -161,12 +161,12 @@ static inline type pfx##in##bwlq##p(unsigned long port) \ return __val; \ } -#define __BUILD_IOPORT_PFX(bus, bwlq, type) \ - __BUILD_IOPORT_SINGLE(bus, bwlq, type,) \ - __BUILD_IOPORT_SINGLE(bus, bwlq, type, _p) +#define __BUILD_IOPORT_PFX(bwlq, type) \ + __BUILD_IOPORT_SINGLE(bwlq, type,) \ + __BUILD_IOPORT_SINGLE(bwlq, type, _p) #define BUILDIO_IOPORT(bwlq, type) \ - __BUILD_IOPORT_PFX(, bwlq, type) + __BUILD_IOPORT_PFX(bwlq, type) BUILDIO_IOPORT(b, u8) BUILDIO_IOPORT(w, u16) From patchwork Fri Oct 21 20:24:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 13015377 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id BCD4FFA3740 for ; Fri, 21 Oct 2022 20:24:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229568AbiJUUYs (ORCPT ); Fri, 21 Oct 2022 16:24:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbiJUUYo (ORCPT ); Fri, 21 Oct 2022 16:24:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E38962EF2A; Fri, 21 Oct 2022 13:24:42 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id A5DCBB82D4A; Fri, 21 Oct 2022 20:24:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41A11C433D6; Fri, 21 Oct 2022 20:24:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666383880; bh=+AVx5SV5r/tSMDS/xVQQrQ6GZyuBqXfn99TrHMsZq2U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sY18lwjF9NMGyRWndJF/89uK3hP/CUv48OX6gL4ugZmharMVNn0K50kXHipp4Av0l Te4WtPlqyN73O6k4RO6Se5J/xNq/r+MBkQ4PdWnNtmAcCu+vw3gcXw20uR8H9awbMP mJM2OoKEnAakMv7wMRh9ENSKVIrUOfzq+7D1Z7cW92W+nlWNFs/RKfSjPYiqNhQHs6 6UG5gr2Bxqj265fCi2ohRxGh8wuvKeNYXi/dZpP6gzlek8Gjp9GuORSzIAs58HRcGB 5PizU1eoJplVJNyarA838+XhkHuOO9EGCHZ/W9SFkCvJMO81ONP2LjOBE5HmYVOi9u RplhnzLRp/4qw== From: Bjorn Helgaas To: Yoshinori Sato , Rich Felker Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 3/4] sh: remove unnecessary __BUILD_IOPORT_PFX() Date: Fri, 21 Oct 2022 15:24:23 -0500 Message-Id: <20221021202424.307531-4-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221021202424.307531-1-helgaas@kernel.org> References: <20221021202424.307531-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Bjorn Helgaas The only reason __BUILD_IOPORT_PFX() existed was to accept a "bus" parameter, but nothing ever used that. Remove __BUILD_IOPORT_PFX() and collapse it into BUILDIO_IOPORT(). Signed-off-by: Bjorn Helgaas --- arch/sh/include/asm/io.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index 193640bd9563..e29e8870dc3b 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h @@ -161,13 +161,10 @@ static inline type in##bwlq##p(unsigned long port) \ return __val; \ } -#define __BUILD_IOPORT_PFX(bwlq, type) \ +#define BUILDIO_IOPORT(bwlq, type) \ __BUILD_IOPORT_SINGLE(bwlq, type,) \ __BUILD_IOPORT_SINGLE(bwlq, type, _p) -#define BUILDIO_IOPORT(bwlq, type) \ - __BUILD_IOPORT_PFX(bwlq, type) - BUILDIO_IOPORT(b, u8) BUILDIO_IOPORT(w, u16) BUILDIO_IOPORT(l, u32) From patchwork Fri Oct 21 20:24:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 13015376 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7B87ECDFA1 for ; Fri, 21 Oct 2022 20:24:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229793AbiJUUYr (ORCPT ); Fri, 21 Oct 2022 16:24:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229682AbiJUUYo (ORCPT ); Fri, 21 Oct 2022 16:24:44 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1AB2356D8; Fri, 21 Oct 2022 13:24:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 677CAB82CC6; Fri, 21 Oct 2022 20:24:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07516C433C1; Fri, 21 Oct 2022 20:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666383882; bh=+us4sh73zodMSJr2daIIFwpHjFf1Aug9TQOSGrI/oiw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VQTaDCeZPsfI+kuEDc+ETL9M2MSLlBX0bcHoSmBUDeo0pKPC2w8jo/NW4i4Ne9t4b pChKX5VxoOW0bFY/1uC8Jc9KPZ5uoDrxZhlCRgiYDB4D+oFR2kOQDwY2KQc1nQdImH 0pXW6EmxLKU+tegZwuaxC5iOGN5LiuMmKdcMQiu18zgux/+V6MdeQLUC606zPnKw2J +7lfoEITWMHfzrGMmCefRv1Q0kw2W4A1Ij/VHNomJMiHuJH91nkS3FyVH23NZMztA8 XJ3sBUv3gp6eEQRpqzPK2VnYCEE/nz/nfsLr9n+xMVP6cXdcV7HhBo+OVhXNh/hTQo SNN9hTT1Kzlfw== From: Bjorn Helgaas To: Yoshinori Sato , Rich Felker Cc: linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: [PATCH 4/4] sh: remove unnecessary __BUILD_MEMORY_STRING() 'pfx' parameter Date: Fri, 21 Oct 2022 15:24:24 -0500 Message-Id: <20221021202424.307531-5-helgaas@kernel.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221021202424.307531-1-helgaas@kernel.org> References: <20221021202424.307531-1-helgaas@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Bjorn Helgaas Previously __BUILD_MEMORY_STRING() accepted a "pfx" parameter, to which all users passed "__raw_". Simplify this by dropping the parameter and encoding "__raw_" in the function name explicitly. Signed-off-by: Bjorn Helgaas --- arch/sh/include/asm/io.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index e29e8870dc3b..179420fc4053 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h @@ -86,11 +86,11 @@ __BUILD_UNCACHED_IO(w, u16) __BUILD_UNCACHED_IO(l, u32) __BUILD_UNCACHED_IO(q, u64) -#define __BUILD_MEMORY_STRING(pfx, bwlq, type) \ +#define __BUILD_MEMORY_STRING(bwlq, type) \ \ static inline void \ -pfx##writes##bwlq(volatile void __iomem *mem, const void *addr, \ - unsigned int count) \ +__raw_writes##bwlq(volatile void __iomem *mem, const void *addr, \ + unsigned int count) \ { \ const volatile type *__addr = addr; \ \ @@ -100,8 +100,8 @@ pfx##writes##bwlq(volatile void __iomem *mem, const void *addr, \ } \ } \ \ -static inline void pfx##reads##bwlq(volatile void __iomem *mem, \ - void *addr, unsigned int count) \ +static inline void __raw_reads##bwlq(volatile void __iomem *mem, \ + void *addr, unsigned int count) \ { \ volatile type *__addr = addr; \ \ @@ -111,13 +111,13 @@ static inline void pfx##reads##bwlq(volatile void __iomem *mem, \ } \ } -__BUILD_MEMORY_STRING(__raw_, b, u8) -__BUILD_MEMORY_STRING(__raw_, w, u16) +__BUILD_MEMORY_STRING(b, u8) +__BUILD_MEMORY_STRING(w, u16) void __raw_writesl(void __iomem *addr, const void *data, int longlen); void __raw_readsl(const void __iomem *addr, void *data, int longlen); -__BUILD_MEMORY_STRING(__raw_, q, u64) +__BUILD_MEMORY_STRING(q, u64) #ifdef CONFIG_HAS_IOPORT_MAP