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 C2289C678D4 for ; Fri, 3 Mar 2023 12:41:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229918AbjCCMlV (ORCPT ); Fri, 3 Mar 2023 07:41:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53242 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229580AbjCCMlT (ORCPT ); Fri, 3 Mar 2023 07:41:19 -0500 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F3525F501; Fri, 3 Mar 2023 04:41:18 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id EF03D5C00B5; Fri, 3 Mar 2023 07:41:14 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute6.internal (MEProxy); Fri, 03 Mar 2023 07:41:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1677847274; x=1677933674; bh=mi W7z/m1o3Z+JHrWEAUIQgA5k8V0IlAjl3B3oQaEa/8=; b=hhOAXcZA+/RUyzOHaZ T5ezvIZOpsKpWta+5rrs5rURKmZEvgPA6cw83GAsNk5jXNmWJNr/9JH0bGjrXp2V WH+LWyzvgh+Lmd4E1BP7NdQbPTUnbwYE6lsNzFqF6jiYIGm7T5+2Avki93acIgjk f9MAOtwpiiRYBRnujRdlHupSoNtrEjUG1Zk4z5/DevTsGYhYnGe9RFYZf8F5W537 NeYcoSCLsfzCCNoZJBcvFV+X42im7M6vpQgJRK8gnRM4OKHB6JfskOzoovAMu5eN tTDriPdyV0XTLTJtZZn185F3N2o01MhpcOE9gK+BHgaLR4waa3wwNfma4dlQ8Cyn ZVZw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; t=1677847274; x=1677933674; bh=miW7z/m1o3Z+J HrWEAUIQgA5k8V0IlAjl3B3oQaEa/8=; b=p+1grLR0ZatZ8NvlWEJIT2nBMwBaT JFJtPp4pdg9dZqck9YoxP5C4aMEZVQPW9OwIhuuJan0SIVnBAPm0atu/L5rBPctC JZPTRQevuPvq3TxG8iR2ts7EanRMNBbBpcBAuMIBWGc0Hu4MUUfNlqKH2zFWMqt5 nxq3TezzlrAdE24np88ZQYJv3suX54SIYlhI7DPOfWKexOdBzmURa+3FKrsztG9c GuXOJHGjep6q4SYY9vMsFb7z5W2p36nywwTmZryx9RQ4CaiVfYBc5fJYtYHawrZC 6E7bLbibTxM/arg414VxOX9I9r0LEICnX1UH7mhKm0NDsBWkm+nNd0psg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrudelledgfeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 1679EB60089; Fri, 3 Mar 2023 07:41:14 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.9.0-alpha0-183-gbf7d00f500-fm-20230220.001-gbf7d00f5 Mime-Version: 1.0 Message-Id: In-Reply-To: <20230303102817.212148-2-bhe@redhat.com> References: <20230303102817.212148-1-bhe@redhat.com> <20230303102817.212148-2-bhe@redhat.com> Date: Fri, 03 Mar 2023 13:40:53 +0100 From: "Arnd Bergmann" To: "Baoquan He" , linux-kernel@vger.kernel.org Cc: Linux-Arch , linux-mm@kvack.org, "Geert Uytterhoeven" , "Luis Chamberlain" , "Christoph Hellwig" , "Thomas Bogendoerfer" , "Helge Deller" , "Serge Semin" , "Florian Fainelli" , "Huacai Chen" , "Jiaxun Yang" , linux-mips@vger.kernel.org Subject: Re: [PATCH v3 1/2] mips: add including Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 3, 2023, at 11:28, Baoquan He wrote: > With the adding, some default ioremap_xx methods defined in > asm-generic/io.h can be used. E.g the default ioremap_uc() returning > NULL. > > Signed-off-by: Baoquan He > Cc: Thomas Bogendoerfer > Cc: Geert Uytterhoeven > Cc: Helge Deller > Cc: Serge Semin > Cc: Florian Fainelli > Cc: Huacai Chen > Cc: Jiaxun Yang > Cc: linux-mips@vger.kernel.org Reviewed-by: Arnd Bergmann I think this is all good. I had look at what cleanups we could do as follow-ups: > +#define phys_to_virt phys_to_virt > static inline void * phys_to_virt(unsigned long address) > { > return __va(address); This is the same as the asm-generic version, so the mips definition is no longer needed. > @@ -359,6 +360,27 @@ __BUILD_MEMORY_PFX(__raw_, q, u64, 0) > __BUILD_MEMORY_PFX(__mem_, q, u64, 0) > #endif > > +#define readb readb > +#define readw readw > +#define readl readl > +#define writeb writeb > +#define writew writew > +#define writel writel > + > +#ifdef CONFIG_64BIT > +#define readq readq > +#define writeq writeq > +#define __raw_readq __raw_readq > +#define __raw_writeq __raw_writeq > +#endif > + > +#define __raw_readb __raw_readb > +#define __raw_readw __raw_readw > +#define __raw_readl __raw_readl > +#define __raw_writeb __raw_writeb > +#define __raw_writew __raw_writew > +#define __raw_writel __raw_writel The mips code defines the __raw variants with slightly different semantics on both barriers and byteswap, which makes it impractical to share any of the above. > +#define memset_io memset_io > static inline void memset_io(volatile void __iomem *addr, unsigned > char val, int count) > { > memset((void __force *) addr, val, count); > } > +#define memcpy_fromio memcpy_fromio > static inline void memcpy_fromio(void *dst, const volatile void > __iomem *src, int count) > { > memcpy(dst, (void __force *) src, count); > } > +#define memcpy_toio memcpy_toio These are again the same as the generic version Arnd