From patchwork Fri Oct 21 19:36:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 13015337 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 05625C38A2D for ; Fri, 21 Oct 2022 19:37:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230083AbiJUThR (ORCPT ); Fri, 21 Oct 2022 15:37:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229587AbiJUThQ (ORCPT ); Fri, 21 Oct 2022 15:37:16 -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 45351262069; Fri, 21 Oct 2022 12:37:15 -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 01410B82D18; Fri, 21 Oct 2022 19:37:14 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91866C433D7; Fri, 21 Oct 2022 19:37:12 +0000 (UTC) From: Bjorn Helgaas Date: Fri, 21 Oct 2022 14:36:55 -0500 Subject: [PATCH v2 1/4] sh: remove unused SLOW_DOWN_IO MIME-Version: 1.0 Message-Id: <20221021-wip-bjorn-22-10-slow-down-io-v2-1-8b3692d12ea7@google.com> References: <20221021-wip-bjorn-22-10-slow-down-io-v2-0-8b3692d12ea7@google.com> In-Reply-To: <20221021-wip-bjorn-22-10-slow-down-io-v2-0-8b3692d12ea7@google.com> To: Rich Felker , Yoshinori Sato , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1666381029; l=2551; i=bhelgaas@google.com; s=20221014; h=from:subject:message-id; bh=6zAPh9ARtgihroCgQL0WSUqpkAZpf2vsIK8eKe4fWMg=; b=sHNDXW3r7DrM//GUcvOZRAFCPgaDquvIObSr4al9u+8BY8zz3g9hZTwrY0/YW58SimSyo50AO7JQ cV5o8gfwAn+BtZceCeVR1h86tavKCM9dXf7BlynfurMpmOz4gc9s X-Developer-Key: i=bhelgaas@google.com; a=ed25519; pk=bFjaHnNobtkUv3f7ErkQcm+PpbyCUUBlIfqMtNRJwQs= Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org 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 19:36:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 13015338 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 259F6C38A2D for ; Fri, 21 Oct 2022 19:37:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229587AbiJUThU (ORCPT ); Fri, 21 Oct 2022 15:37:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230107AbiJUThS (ORCPT ); Fri, 21 Oct 2022 15:37:18 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8462A2610A1; Fri, 21 Oct 2022 12:37:17 -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 DBDD2B82D21; Fri, 21 Oct 2022 19:37:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5EE1DC433C1; Fri, 21 Oct 2022 19:37:14 +0000 (UTC) From: Bjorn Helgaas Date: Fri, 21 Oct 2022 14:36:56 -0500 Subject: [PATCH v2 2/4] sh: remove unused __BUILD_IOPORT_SINGLE 'pfx' parameter MIME-Version: 1.0 Message-Id: <20221021-wip-bjorn-22-10-slow-down-io-v2-2-8b3692d12ea7@google.com> References: <20221021-wip-bjorn-22-10-slow-down-io-v2-0-8b3692d12ea7@google.com> In-Reply-To: <20221021-wip-bjorn-22-10-slow-down-io-v2-0-8b3692d12ea7@google.com> To: Rich Felker , Yoshinori Sato , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1666381029; l=2009; i=bhelgaas@google.com; s=20221014; h=from:subject:message-id; bh=8UKhu6SX8DGey6kmjCz3BO86QD79+K2wUhfKHDjrdCk=; b=ijuER2q4Zdn6CQkGbuXFSsYkilANhzlZtWGiSZHUTKE1TmMeEqUomg+ceMjAZT7Sc5mf9BKMctC4 aUZdfA08BaLRDQGOWXJSTGBENzi3KIelyXOLjviA6uf/KjWjJIVv X-Developer-Key: i=bhelgaas@google.com; a=ed25519; pk=bFjaHnNobtkUv3f7ErkQcm+PpbyCUUBlIfqMtNRJwQs= Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org 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 19:36:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 13015339 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 527C7C433FE for ; Fri, 21 Oct 2022 19:37:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229744AbiJUThX (ORCPT ); Fri, 21 Oct 2022 15:37:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230080AbiJUThU (ORCPT ); Fri, 21 Oct 2022 15:37:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1371727CFDE; Fri, 21 Oct 2022 12:37:19 -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 86745B80CC1; Fri, 21 Oct 2022 19:37:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 259A9C433B5; Fri, 21 Oct 2022 19:37:16 +0000 (UTC) From: Bjorn Helgaas Date: Fri, 21 Oct 2022 14:36:57 -0500 Subject: [PATCH v2 3/4] sh: remove unnecessary __BUILD_IOPORT_PFX() MIME-Version: 1.0 Message-Id: <20221021-wip-bjorn-22-10-slow-down-io-v2-3-8b3692d12ea7@google.com> References: <20221021-wip-bjorn-22-10-slow-down-io-v2-0-8b3692d12ea7@google.com> In-Reply-To: <20221021-wip-bjorn-22-10-slow-down-io-v2-0-8b3692d12ea7@google.com> To: Rich Felker , Yoshinori Sato , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1666381029; l=954; i=bhelgaas@google.com; s=20221014; h=from:subject:message-id; bh=g8yI3K1tEQUHXIZtqfYnrjQ/LhOpw33jP8MlI8rMc5Q=; b=xiCc/DhxkT2exYJzheQj814cfjt+cNbZWf+N85s0rV8FZq+oATOfUE4t7nB6vfZQNwsmv60HgBZh n/6TWEFwC9Jc3eXOPnlGpVEkLT01AouqYzntBYKrqfSgotRfawXw X-Developer-Key: i=bhelgaas@google.com; a=ed25519; pk=bFjaHnNobtkUv3f7ErkQcm+PpbyCUUBlIfqMtNRJwQs= Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org 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 19:36:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 13015340 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 F0FD6C433FE for ; Fri, 21 Oct 2022 19:37:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230080AbiJUThe (ORCPT ); Fri, 21 Oct 2022 15:37:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32900 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230142AbiJUThV (ORCPT ); Fri, 21 Oct 2022 15:37:21 -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 BFA7A27CFEF; Fri, 21 Oct 2022 12:37:20 -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 56128B82D21; Fri, 21 Oct 2022 19:37:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD7F2C433D7; Fri, 21 Oct 2022 19:37:17 +0000 (UTC) From: Bjorn Helgaas Date: Fri, 21 Oct 2022 14:36:58 -0500 Subject: [PATCH v2 4/4] sh: remove unnecessary __BUILD_MEMORY_STRING() 'pfx' parameter MIME-Version: 1.0 Message-Id: <20221021-wip-bjorn-22-10-slow-down-io-v2-4-8b3692d12ea7@google.com> References: <20221021-wip-bjorn-22-10-slow-down-io-v2-0-8b3692d12ea7@google.com> In-Reply-To: <20221021-wip-bjorn-22-10-slow-down-io-v2-0-8b3692d12ea7@google.com> To: Rich Felker , Yoshinori Sato , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=ed25519-sha256; t=1666381029; l=2013; i=bhelgaas@google.com; s=20221014; h=from:subject:message-id; bh=Qvs4sw9QI5s7PTMZeS/IoQOgMgdD770AFoUMOnTvmTg=; b=OSW6VGjEHusyDpMk9rCWr6S87GCeNAW46TYFyKnDsUsxyJ2JCKKTPs1vHlxhU1q7y3vMe3L36Wm8 vHhPHK/VCoebwAt94fs2PwMIhCSyXXn3bBo4piNqiURzj2NolKva X-Developer-Key: i=bhelgaas@google.com; a=ed25519; pk=bFjaHnNobtkUv3f7ErkQcm+PpbyCUUBlIfqMtNRJwQs= Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org 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