Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp1208815rwo; Wed, 2 Aug 2023 10:13:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlFr94+V2+zclaNbm9CbKN4r9dvTxn/iPLDPeNeTvYwQmUCQ67JT8qU5s97DKMusmrOhIh3w X-Received: by 2002:a17:902:e88e:b0:1b8:b459:f47a with SMTP id w14-20020a170902e88e00b001b8b459f47amr19985624plg.34.1690996420427; Wed, 02 Aug 2023 10:13:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690996420; cv=none; d=google.com; s=arc-20160816; b=wDmuAoSn/WujpdkcR7DvyErE4t0I3VPwKpbM1UH7fG1yyVovAh9/84k6/9cFnvmXH8 WvOZWo8+LzArFg+z9plnP7DfXgIKL4xIJMKNxwcyi6r1jSJe+kJEz2pEGSNNza9an0dF G/BzTHgm8nDlGEjfV5Xabnr2Ry+9YjjvdzkChNDsviQnvwckF9K5ILAIVXBuVLRYErZs 6xIUaY2MqQo388cz8SASRLYzf5uBRTjKT3NdhAWg/uVa76Ma3OEk2F6WCft4X1axsGLd IOiYnFsfBZlI014f0ozP8wpZnMFvLgcxQBPFP68XBCMnxUurLIdG+YofQt1ram7fWOdP djtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=N9wNAhPqFgTbxLDfrmmbpVuzhrbWWgtM2NDp+mcitMY=; fh=+TH6gGX6DPLH6TJxxUg8/u2yzzW0BG0LOj/WsfFLLjg=; b=OPE0C5LFPf9O8lvD2VB6vhnwK0r8rONC6vKpcKBPZ/Zd0/+OwyixIyIIo1ZVYinDi1 vtmxry1Ej62fHs+r8ynVw9WDn6aJfqf2NYIvDjzryF/W/yTlH7XeAjM65MkeFD/Adcfj 6VvEY84+T0QUBKLovtrnsBgDI/U2qNDlsHnEnM64LT/qzRW7PWcbsTtA3IutiM2fCTDQ MvEkzOWSm7XdKyhVKNRcM+BAkg2OLt3Yohbr23ZMDl3pQndwF+HrCpXT82R/KxN6E9hm R5YPjiSt/P9nuHPMnUvjBvNes3Y3h7s+CyTxLHl4wCzAz/mUSl0MXhdXDYUxuFZZafFe /Ucg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=QZgxZVXt; 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 c1-20020a170902d48100b001b9be3b94dfsi6810577plg.268.2023.08.02.10.13.26; Wed, 02 Aug 2023 10:13:40 -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; dkim=pass header.i=@gmail.com header.s=20221208 header.b=QZgxZVXt; 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 S235309AbjHBP5t (ORCPT + 99 others); Wed, 2 Aug 2023 11:57:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235123AbjHBP5q (ORCPT ); Wed, 2 Aug 2023 11:57:46 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F9B2E4C; Wed, 2 Aug 2023 08:57:39 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1bc02bd4eafso143905ad.1; Wed, 02 Aug 2023 08:57:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690991858; x=1691596658; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=N9wNAhPqFgTbxLDfrmmbpVuzhrbWWgtM2NDp+mcitMY=; b=QZgxZVXtdWxl4WWjLDKzIbJdAliyzaWxSLESrJszZdTcCo3INVM8UGhTS/jZAtsWeB +PGBRAPBd73e+2PsISFdKkE686unn2wpu2dpZGf+p+A9UjcjqhaxUsdjM7leHIvM0ngm 3hvs41il3sA5uw3z45G99It0eWa8V66nPlksqD5NqUPMw+Exr4EocVDHcIdSbhTVQicV LOgrQymHnGftByApwhc93Osky56PGSBsCioOrVhlqYLyJO4mrj1TbyHdgNORMUEvNuYe onEVCpZsYOAA7LloUpoWpY1H+gMPoqbXK6uv8F6CkcTocjODDEOD9JZtqPbpKLq7Nsgt LhRQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690991859; x=1691596659; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=N9wNAhPqFgTbxLDfrmmbpVuzhrbWWgtM2NDp+mcitMY=; b=C5ClcSGIhdotvBeJ/L3o9fdP4p94Rjpo0vOAheFjIZsAoh2/6ezQw2y5KKEMOorOeE nrPnx11KU4d6+QXq8WpZLFCLO10DeDu9arJPR3qCLqKlqBtGW8uqZQczBkwY9pPhJzp9 uOx+abwvhMWWmCyZPhwdFnENAggzMLEFVCjDXYOWRuJCcqwjxwTtqcQMc4DJORJ9DO1H dCg1cXnTp0FL3NyoitoPp76/IqWhtNl2c0kvHC4gqrikdgTbKcFFXkMZuqICQRTzMtMG N/JhG4anfvZjHDTsNsHEfsNI3PzJ4kGNXa77Mh6eAu1M5pjd7PkKdTNCn+enBD/eGx6H zsJw== X-Gm-Message-State: ABy/qLZzouguAslP04M63Lk5IS0s3NYvKdT9KogPd8ArpnZhOxxe2OPi 9XfanCsK/8CVNSGo1QwfSBU= X-Received: by 2002:a17:902:ea09:b0:1b8:76ce:9d91 with SMTP id s9-20020a170902ea0900b001b876ce9d91mr19841513plg.1.1690991858140; Wed, 02 Aug 2023 08:57:38 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id b21-20020a170902d31500b001b89891bfc4sm12608481plc.199.2023.08.02.08.57.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Aug 2023 08:57:37 -0700 (PDT) Sender: Guenter Roeck Message-ID: <65d29f18-8b1e-7f63-a377-a7520dc19b88@roeck-us.net> Date: Wed, 2 Aug 2023 08:57:36 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH] sh: fix asm-generic/io.h inclusion Content-Language: en-US To: Arnd Bergmann , Andrew Morton Cc: Arnd Bergmann , Geert Uytterhoeven , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , Baoquan He , linux-sh@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230802141658.2064864-1-arnd@kernel.org> From: Guenter Roeck In-Reply-To: <20230802141658.2064864-1-arnd@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 On 8/2/23 07:16, 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. > > 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 Tested-by: Guenter Roeck > --- > 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();