Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1285839rwo; Wed, 2 Aug 2023 11:27:03 -0700 (PDT) X-Google-Smtp-Source: APBJJlHKAswkNJXe2PnghlZle5nhlN1IZQbGVqTDDnPMQzJtKGUL/r+Ke0tBmX/zqlhEWMffHInn X-Received: by 2002:a17:906:51:b0:993:d617:bdc8 with SMTP id 17-20020a170906005100b00993d617bdc8mr5595934ejg.7.1691000822751; Wed, 02 Aug 2023 11:27:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691000822; cv=none; d=google.com; s=arc-20160816; b=pH36TsVp87wy1I9yGxuJVCzgLJRn23ILnm4Ks89hWa7qV06sQ/jEUk7Dfws97vSLpw 5GgiC32PXIVz5O68deFu6w7abe8p3+eloaPuX+oGTOErFirE6X1983gbgCRQdZ9zUSJG M9DLOzP0+mGkCbjyR5yNj+vcSle47r2xIQRXL+PfdmW6uSTHuEaavBE8iXm9OPt32JGE HpJbspEENce47A3YAuD4Pz3UqWMnVWrR+oLVz2Lykji8+/bi9JjB7wyTWrY/7vB4SqCZ BusSXYVQDj//q73GQBGsWqpbXzaBbVuTJHeHO4KP4B4gltn/mY9WPbgm/SsoG/raSFj2 mdPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id; bh=WLGfp5Br5EZKSzL+h+m3w1z18wBuMqqNSJKMcfSZTeY=; fh=Zykzz5fSy0Zo8xcfpWZ/GTmGzdJjwp1sAyUkTy4dXY8=; b=Sh9moKzZt/ttc1fM6DXw1h6jSC6sgJSQkoPnBpqmc5PyB8T4JUfH8KeGUYbtOwtg+2 JekQo3IpXbQWMCvmorp09BXwVDvwLqQ52f8kg7DFtYYAnmlFORr/YJemqz3CHTg4Xcuh e372ZFwzdRX7G+GtgUGrKCUJEQoM9whr4IhtI/k1TH4RWMnq0XeEI+Zfut9ggnZJG4xZ Hj2mk+0NOzXmUOJENAtKXiKQZB5Fdj7ub+q1LnEvZW+KcSYuz+EKFo4OTiz3OKzt7jrB tqrDbO9OW8L6V1hqmJ0rjrnwL1AaKaFGF+cfQ6NMa6KnxIDQFDTsOQN97nFG3OT4ctWC poAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fi1-20020a170906da0100b00997e79e646esi11719231ejb.557.2023.08.02.11.26.37; Wed, 02 Aug 2023 11:27:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233640AbjHBRkR convert rfc822-to-8bit (ORCPT + 99 others); Wed, 2 Aug 2023 13:40:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233657AbjHBRkG (ORCPT ); Wed, 2 Aug 2023 13:40:06 -0400 Received: from outpost1.zedat.fu-berlin.de (outpost1.zedat.fu-berlin.de [130.133.4.66]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 528E33583; Wed, 2 Aug 2023 10:39:42 -0700 (PDT) Received: from inpost2.zedat.fu-berlin.de ([130.133.4.69]) by outpost.zedat.fu-berlin.de (Exim 4.95) with esmtps (TLS1.3) tls TLS_AES_256_GCM_SHA384 (envelope-from ) id 1qRFfp-002UL6-Dq; Wed, 02 Aug 2023 19:30:13 +0200 Received: from p5b13a085.dip0.t-ipconnect.de ([91.19.160.133] helo=suse-laptop.fritz.box) by inpost2.zedat.fu-berlin.de (Exim 4.95) with esmtpsa (TLS1.3) tls TLS_AES_256_GCM_SHA384 (envelope-from ) id 1qRFfp-000el0-6B; Wed, 02 Aug 2023 19:30:13 +0200 Message-ID: <373656535c754006ca1abe736fffa2be3925b0aa.camel@physik.fu-berlin.de> Subject: Re: [PATCH] sh: fix asm-generic/io.h inclusion From: John Paul Adrian Glaubitz To: Arnd Bergmann , Andrew Morton Cc: Arnd Bergmann , Geert Uytterhoeven , Yoshinori Sato , Rich Felker , Baoquan He , Guenter Roeck , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org Date: Wed, 02 Aug 2023 19:30:11 +0200 In-Reply-To: <20230802141658.2064864-1-arnd@kernel.org> References: <20230802141658.2064864-1-arnd@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT User-Agent: Evolution 3.48.4 MIME-Version: 1.0 X-Original-Sender: glaubitz@physik.fu-berlin.de X-Originating-IP: 91.19.160.133 X-ZEDAT-Hint: PO X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd! On Wed, 2023-08-02 at 16:16 +0200, Arnd Bergmann wrote: > From: Arnd Bergmann > > A recent cleanup patch started using the generic asm/io.h header from > the sh version, but unfortunately this caused build regressions in many > configurations, such as: > > include/asm-generic/io.h:636:15: error: redefinition of ‘inb_p’ > > I added some of the missing defines that are needed to keep using the > sh specific implementations rather than the generic ones where they > clash. I build all sh defconfig files to catch the various combinations > of CONFIG_MMU, CONFIG_GENERIC_IOMAP and CONFIG_NO_IOPORT_MAP, this should > cover them all. > > A lot of the sh specific functions are equivalent to the generic ones > and could in fact be removed, but it would be best to only do that with > actual runtime testing. > > In particular, the indirect ioport_map() implementation is only used > for the "microdev" platform that appears to be broken beyond repair > for as long as the git history goes, so removing both microdev and the > custom ioport handling in favor of the asm-generic/io.h version would > be a great cleanup, but this can be done another time if anyone feels > motivated to clean up arch/sh. Clean-up will happen with the device tree conversion. > Fixes: e41f1f7ff6c2b ("sh: add including") > Link: https://lore.kernel.org/lkml/09094baf-dadf-4bce-9f63-f2a1f255f9a8@app.fastmail.com/ > Reported-by: Geert Uytterhoeven > Signed-off-by: Arnd Bergmann > --- > Andrew, can you pick this up into the mm tree on top of the > "sh: add including" patch? > --- > arch/sh/include/asm/io.h | 24 ++++++++++++++++++++++++ > arch/sh/include/asm/io_noioport.h | 14 -------------- > 2 files changed, 24 insertions(+), 14 deletions(-) > > diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h > index 24c560c065ec7..f2f38e9d489ac 100644 > --- a/arch/sh/include/asm/io.h > +++ b/arch/sh/include/asm/io.h > @@ -119,6 +119,10 @@ void __raw_readsl(const void __iomem *addr, void *data, int longlen); > > __BUILD_MEMORY_STRING(__raw_, q, u64) > > +#define ioport_map ioport_map > +#define ioport_unmap ioport_unmap > +#define pci_iounmap pci_iounmap > + > #define ioread8 ioread8 > #define ioread16 ioread16 > #define ioread16be ioread16be > @@ -241,6 +245,26 @@ __BUILD_IOPORT_STRING(q, u64) > > #endif > > +#define inb(addr) inb(addr) > +#define inw(addr) inw(addr) > +#define inl(addr) inl(addr) > +#define outb(x, addr) outb((x), (addr)) > +#define outw(x, addr) outw((x), (addr)) > +#define outl(x, addr) outl((x), (addr)) > + > +#define inb_p(addr) inb(addr) > +#define inw_p(addr) inw(addr) > +#define inl_p(addr) inl(addr) > +#define outb_p(x, addr) outb((x), (addr)) > +#define outw_p(x, addr) outw((x), (addr)) > +#define outl_p(x, addr) outl((x), (addr)) > + > +#define insb insb > +#define insw insw > +#define insl insl > +#define outsb outsb > +#define outsw outsw > +#define outsl outsl > > #define IO_SPACE_LIMIT 0xffffffff > > diff --git a/arch/sh/include/asm/io_noioport.h b/arch/sh/include/asm/io_noioport.h > index 5ba4116b4265c..12dad91f41c1e 100644 > --- a/arch/sh/include/asm/io_noioport.h > +++ b/arch/sh/include/asm/io_noioport.h > @@ -46,20 +46,6 @@ static inline void ioport_unmap(void __iomem *addr) > BUG(); > } > > -#define inb_p(addr) inb(addr) > -#define inw_p(addr) inw(addr) > -#define inl_p(addr) inl(addr) > -#define outb_p(x, addr) outb((x), (addr)) > -#define outw_p(x, addr) outw((x), (addr)) > -#define outl_p(x, addr) outl((x), (addr)) > - > -#define insb insb > -#define insw insw > -#define insl insl > -#define outsb outsb > -#define outsw outsw > -#define outsl outsl > - > static inline void insb(unsigned long port, void *dst, unsigned long count) > { > BUG(); Acked-by: John Paul Adrian Glaubitz -- .''`. John Paul Adrian Glaubitz : :' : Debian Developer `. `' Physicist `- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913