From patchwork Wed Mar 8 13:07:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13165699 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C7D2EC678D5 for ; Wed, 8 Mar 2023 13:07:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 31B326B0074; Wed, 8 Mar 2023 08:07:32 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CAB46B0075; Wed, 8 Mar 2023 08:07:32 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 16B4A280001; Wed, 8 Mar 2023 08:07:32 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id F12296B0074 for ; Wed, 8 Mar 2023 08:07:31 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id CEADC40F2C for ; Wed, 8 Mar 2023 13:07:31 +0000 (UTC) X-FDA: 80545757502.12.4C387B6 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf10.hostedemail.com (Postfix) with ESMTP id 0C048C0025 for ; Wed, 8 Mar 2023 13:07:29 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NAw80EVS; spf=pass (imf10.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678280850; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=uwBTGd8vP947AeUSF0iMuOil3XwvoXMLAawY3OLENFQ=; b=KiSVyPFFaWSusUVAGCYGzMUlUip48WVhnFY102Dao/IwmldElOD6MWX0seYyCpJEa+a/HR wwcETKm8k0DpvdhhVJ8x+0AEeLGD7B7POdF0tLR5XN25gV/e44qM+C5DG3XAc89mlJdlfb IPudlS4vbFEmGpp1tUxcoH5VAy1Q1S0= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=NAw80EVS; spf=pass (imf10.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678280850; a=rsa-sha256; cv=none; b=HM0E+f6ZZHFx7uxIX6iI5hRs32U/5gPHKBlVor0xTexrX5GvFB7YmOcMuNBxWa91eh/cOl mSmFA8D10HuprPn5MrkGMHY2ZNM7zuA/46nEo0mHhJL0YK6jn6+vcMQmEmgI71jmjq4U9c 4xcJTxKahxJRTmS/9uupdyN6VMkf6mc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678280849; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uwBTGd8vP947AeUSF0iMuOil3XwvoXMLAawY3OLENFQ=; b=NAw80EVSC7712NdXBtXng7FWL1il8fegbFjHgoUsYwgoLDJoisd4T28cbGMrDHAUu5iIP1 EWrf0Zbl8bhyAkXxmUzv+501gC6DF6Q3D+Og2N6vcul/C/pnFZuWrUYdVOO0dNbAJsPI8b wnnDaIA/mk7lS6cBNPDKhDfe/Q2khHQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-595-QZ6zXcGKMfiG3-HnaItivQ-1; Wed, 08 Mar 2023 08:07:26 -0500 X-MC-Unique: QZ6zXcGKMfiG3-HnaItivQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 4AEFF858F09; Wed, 8 Mar 2023 13:07:25 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-137.pek2.redhat.com [10.72.12.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 914522166B26; Wed, 8 Mar 2023 13:07:18 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, mpe@ellerman.id.au, geert@linux-m68k.org, mcgrof@kernel.org, hch@infradead.org, Baoquan He , Helge Deller , Thomas Zimmermann , Christophe Leroy , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH v4 1/4] video: fbdev: atyfb: only use ioremap_uc() on i386 and ia64 Date: Wed, 8 Mar 2023 21:07:07 +0800 Message-Id: <20230308130710.368085-2-bhe@redhat.com> In-Reply-To: <20230308130710.368085-1-bhe@redhat.com> References: <20230308130710.368085-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 0C048C0025 X-Stat-Signature: hxgsat5um6tw4dw6zwu4zcgcb91f77ja X-Rspam-User: X-HE-T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ormhF8HDXaQKKzCCFmfL5dMNTYSMUclrBCvJmEkENdOTyeIS3o/97xnPLIPwcqhFdE/1Zilua7LOelgK6ay+12fScFT8axrGP/V6Y8C3463Bp0zW2Nwrgz+e3r6FqHXKdUmlaShzyYcLpOdYBIOzdGaHjRY15VKnjPWB/Q31IMTj0muv3kndNx1FoWGU2swkGWDi/JmVlNA077x0cuorb0faXjXfSff8sHBCqzz96k0kyIlLnro1YjJh1Ge53r7u1C2aXfm0JJYwt4N6u6TLEHUAcFtNSmWiSAlHUk9cJzKoyw7IciUx8xPYyDUn67BfBQKsr52tu0JhuP5TS4nF/pNFaa5P X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Arnd Bergmann ioremap_uc() is only meaningful on old x86-32 systems with the PAT extension, and on ia64 with its slightly unconventional ioremap() behavior, everywhere else this is the same as ioremap() anyway. Change the only driver that still references ioremap_uc() to only do so on x86-32/ia64 in order to allow removing that interface at some point in the future for the other architectures. On some architectures, ioremap_uc() just returns NULL, changing the driver to call ioremap() means that they now have a chance of working correctly. Signed-off-by: Arnd Bergmann Signed-off-by: Baoquan He Cc: Helge Deller Cc: Thomas Zimmermann Cc: Christophe Leroy Cc: linux-fbdev@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Reviewed-by: Luis Chamberlain --- drivers/video/fbdev/aty/atyfb_base.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c index b02e4e645035..6553c71b113f 100644 --- a/drivers/video/fbdev/aty/atyfb_base.c +++ b/drivers/video/fbdev/aty/atyfb_base.c @@ -3440,11 +3440,15 @@ static int atyfb_setup_generic(struct pci_dev *pdev, struct fb_info *info, } info->fix.mmio_start = raddr; +#if defined(__i386__) || defined(__ia64__) /* * By using strong UC we force the MTRR to never have an * effect on the MMIO region on both non-PAT and PAT systems. */ par->ati_regbase = ioremap_uc(info->fix.mmio_start, 0x1000); +#else + par->ati_regbase = ioremap(info->fix.mmio_start, 0x1000); +#endif if (par->ati_regbase == NULL) return -ENOMEM; From patchwork Wed Mar 8 13:07:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13165700 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DA76C64EC4 for ; Wed, 8 Mar 2023 13:07:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9A9A26B0075; Wed, 8 Mar 2023 08:07:42 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 9599D6B0078; Wed, 8 Mar 2023 08:07:42 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7FBBF280001; Wed, 8 Mar 2023 08:07:42 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 6CC346B0075 for ; Wed, 8 Mar 2023 08:07:42 -0500 (EST) Received: from smtpin15.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 3924E160EE0 for ; Wed, 8 Mar 2023 13:07:42 +0000 (UTC) X-FDA: 80545757964.15.5B33EC3 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 72B001C001E for ; Wed, 8 Mar 2023 13:07:40 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OuJf1RaW; spf=pass (imf18.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678280860; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=QTt8B6xdpie3JQtkOGQkvv8PGf5htHiQBmIwsiz6QFE=; b=vyCrQy/bW2T3uJy9HdYsYDsEGWVWTAJT4RIYw7r1r3Y65z4oOIn+0BhiZeFbnz2BT0swcP ZHEi1AqA4jik9H0f018bVPYfsd4VlAr3Yz59QFzgHeoI+38pwrS0xJXdcxvCzc8IOySmmq JASNpT+O+BLhciis9h8wHuEcFKI+Qjw= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=OuJf1RaW; spf=pass (imf18.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678280860; a=rsa-sha256; cv=none; b=Zy29UApBxQgbcrnieTKSX/SNm/tXbAAKBlAuqIuyllYwrd4dnZ4RWv7cN4sbA+1xBfPkBT yeuEryVG9yJayBZitl4gtTlff542thf1HZQ1sQQyePIxdMJNt788pSmbDpXZd0afvtVf/2 cl70RERqfZwgrmIwg6l3AGnP75zOUos= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678280859; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QTt8B6xdpie3JQtkOGQkvv8PGf5htHiQBmIwsiz6QFE=; b=OuJf1RaWoxWKx248gB22+t/o9ABzmo3Ms6D9j7scrahqu7SwDpWDjFBZmrOhdnSlc1a2ch 2zuGpxsIQhyzn/pJ9rJNtta3ITu11M72JXi+8Qeeh2e8xsk0KViJNPpVW+YSV4FrnmOa27 KAM61jz9C0nuo2vvc7f+qosUsqgVS48= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-61-zmKLBDpnNMKup2LB2LatPQ-1; Wed, 08 Mar 2023 08:07:34 -0500 X-MC-Unique: zmKLBDpnNMKup2LB2LatPQ-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6B469857D07; Wed, 8 Mar 2023 13:07:33 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-137.pek2.redhat.com [10.72.12.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0CAC32166B26; Wed, 8 Mar 2023 13:07:25 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, mpe@ellerman.id.au, geert@linux-m68k.org, mcgrof@kernel.org, hch@infradead.org, Baoquan He , Thomas Bogendoerfer , Helge Deller , Serge Semin , Florian Fainelli , Huacai Chen , Jiaxun Yang , linux-mips@vger.kernel.org Subject: [PATCH v4 2/4] mips: add including Date: Wed, 8 Mar 2023 21:07:08 +0800 Message-Id: <20230308130710.368085-3-bhe@redhat.com> In-Reply-To: <20230308130710.368085-1-bhe@redhat.com> References: <20230308130710.368085-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 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etCihc0tt63c3zeMs7j/AJ MHITKuh6 8DIi5BWGOhULomqPKT9jF3MjXc3cIKcMqq/e6qNvPmiw19uZHvxhAWvYrU2N4kPI06RZC+i8QyNR+I8CWhUML4VAF5DtvFjWPY+X/NQXlganHS8LYFWHSo6uG07YCYDUhTgIJhqqwAKFXu2/Us/J0aqBSuHKx0rrvrrh7g/c3Dggdjn2IOInC7PAfAQcrilP53YjjfiORo+42cm39eWd6L3UmKYig8fW0CwRPRjAmdd+onWzfBf53qZoT02cujXyi3z8e0KDX3XKSSFmrfJfhHE5sr/cNDyRYiWC3khK+3P6OaDunq4EcYhAZQcUNhYfrbxNwBv1dtloN3pwqrpXyhsoXOo6EwPlydKy94n+mKL0+2LIVAGwTkYoJvmwVgnyZhTorx2R+8OkkRSM/qzwZfVxQ3wL67+3C45OFD6E9HSq66PB+fOMdb3kqLtrKWkpL+B0auoR3GYqBKGbmqRYyCjy+8Q== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Reviewed-by: Arnd Bergmann 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 Signed-off-by: Baoquan He --- arch/mips/include/asm/io.h | 78 ++++++++++++++++++++++++++++++++++---- 1 file changed, 70 insertions(+), 8 deletions(-) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index cec8347f0b85..6756baadba6c 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -126,6 +126,7 @@ static inline phys_addr_t virt_to_phys(const volatile void *x) * almost all conceivable cases a device driver should not be using * this function */ +#define phys_to_virt phys_to_virt static inline void * phys_to_virt(unsigned long address) { return __va(address); @@ -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 + #define __BUILD_IOPORT_PFX(bus, bwlq, type) \ __BUILD_IOPORT_SINGLE(bus, bwlq, type, 1, 0,) \ __BUILD_IOPORT_SINGLE(bus, bwlq, type, 1, 0, _p) @@ -374,6 +396,27 @@ BUILDIO_IOPORT(l, u32) BUILDIO_IOPORT(q, u64) #endif +#define inb inb +#define inw inw +#define inl inl +#define inb_p inb_p +#define inw_p inw_p +#define inl_p inl_p + +#define outb outb +#define outw outw +#define outl outl +#define outb_p outb_p +#define outw_p outw_p +#define outl_p outl_p + +#ifdef CONFIG_64BIT +#define inq inq +#define outq outq +#define inq_p inq_p +#define outq_p outq_p +#endif + #define __BUILDIO(bwlq, type) \ \ __BUILD_MEMORY_SINGLE(____raw_, bwlq, type, 1, 0, 0) @@ -412,14 +455,6 @@ __BUILDIO(q, u64) #define writeq_be(val, addr) \ __raw_writeq(cpu_to_be64((val)), (__force unsigned *)(addr)) -/* - * Some code tests for these symbols - */ -#ifdef CONFIG_64BIT -#define readq readq -#define writeq writeq -#endif - #define __BUILD_MEMORY_STRING(bwlq, type) \ \ static inline void writes##bwlq(volatile void __iomem *mem, \ @@ -480,14 +515,39 @@ BUILDSTRING(l, u32) BUILDSTRING(q, u64) #endif +#define insb insb +#define insw insw +#define insl insl +#define outsb outsb +#define outsw outsw +#define outsl outsl + +#define readsb readsb +#define readsw readsw +#define readsl readsl +#define writesb writesb +#define writesw writesw +#define writesl writesl + +#ifdef CONFIG_64BIT +#define insq insq +#define readsq readsq +#define readsq readsq +#define writesq writesq +#endif + + +#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 static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count) { memcpy((void __force *) dst, src, count); @@ -556,4 +616,6 @@ extern void (*_dma_cache_inv)(unsigned long start, unsigned long size); void __ioread64_copy(void *to, const void __iomem *from, size_t count); +#include + #endif /* _ASM_IO_H */ From patchwork Wed Mar 8 13:07:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13165701 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2108FC678D5 for ; Wed, 8 Mar 2023 13:07:50 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7D4446B007B; Wed, 8 Mar 2023 08:07:49 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7854F6B007D; Wed, 8 Mar 2023 08:07:49 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 626EF6B007E; Wed, 8 Mar 2023 08:07:49 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 4FDB86B007B for ; Wed, 8 Mar 2023 08:07:49 -0500 (EST) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2620AAB532 for ; Wed, 8 Mar 2023 13:07:49 +0000 (UTC) X-FDA: 80545758258.07.1A66B6E Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 3FEA61C000E for ; Wed, 8 Mar 2023 13:07:47 +0000 (UTC) Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Rtr36wSq; spf=pass (imf18.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678280867; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=YuzOmgr2u1PyDfkmKFazdLyWcjTDX0CNS9csyPmB6+k=; b=vP7D7CfqHneZIPPN2Eee/9KAxWwZGj5bd4+jY4lH2oHlC1e2bqE3rK3qm1qfL/YQ0H3q+Q Mom8afLry138S357F4IHXAXd8zycj2ws0vxRcXirIQ3T9eBZdGLschj7YS8cKpifPZPk0o +oH1c0Oy1zqv+1w2A2WEDLp17vRwaZU= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=Rtr36wSq; spf=pass (imf18.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678280867; a=rsa-sha256; cv=none; b=TfO2oJde8Qjik1KZbxK51iUJKYuCNcalLcFy3oSdV/f0ENbC8mB0f8rIwU7lWPwvUXlgUZ EZagK5HcJJWuqpZxMxzujuQLsEKOwEMqVQUOydPuF2uNzcVHnVoin6SpBSQ+2mADjmMjEX v+slfQuuFqJRuXqtfIYbjEi1dRcU7h0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678280866; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YuzOmgr2u1PyDfkmKFazdLyWcjTDX0CNS9csyPmB6+k=; b=Rtr36wSqkTxAYPKryO6NR8TfuGsjNn+ZpOZahDQaKE6YkFaT65gTyet9eya5gYZwk8TaDu tWvcYLicCta7FNhN0/3u0JUuuFLmlVNi1vh5TYnDyxhWV61jsFX7OyqnltwArVCxQWv5b1 jz9Mev5lP3SZKL+2+q2THgwpaL3rphQ= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-209-h5-YcZh5Ok2x1n76ZKCkaw-1; Wed, 08 Mar 2023 08:07:43 -0500 X-MC-Unique: h5-YcZh5Ok2x1n76ZKCkaw-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2F67B185A794; Wed, 8 Mar 2023 13:07:42 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-137.pek2.redhat.com [10.72.12.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3B58D2166B2A; Wed, 8 Mar 2023 13:07:33 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, mpe@ellerman.id.au, geert@linux-m68k.org, mcgrof@kernel.org, hch@infradead.org, Baoquan He , linux-alpha@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org Subject: [PATCH v4 3/4] arch/*/io.h: remove ioremap_uc in some architectures Date: Wed, 8 Mar 2023 21:07:09 +0800 Message-Id: <20230308130710.368085-4-bhe@redhat.com> In-Reply-To: <20230308130710.368085-1-bhe@redhat.com> References: <20230308130710.368085-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Rspamd-Queue-Id: 3FEA61C000E X-Stat-Signature: ayqixheybpfjhpytktrcehsbmxfugppq X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1678280867-122123 X-HE-Meta: U2FsdGVkX1/BDY6hKqHQARlguQIQ4bF3E9YvE4nURhS5cpd/QDA8j3wFeXuwLpwuRyhLRTLVTr7EzhFU+Ykn2Ql8ozw5Pwpur84PqXwByKrbcEXdE1aqhaE4EgecyROi5XNGM54RvYWMpqTPT/GuOfTOnMTNXONAWbsWRka5P3QDH0zdognTxcFFaSJiIa7HEaEZd6GCl3cLf+ox7FzHjrovw2raQfGDJhpaQtIDmg+17BgdWEL56BWUFkFT3H7j8rmqhEEscbkG6Hi2CrD7otRyz6ipC3BdUWkLDri1bu9E2yGspj8YqrMrNj4EX0C/cvF4P8w7HlEOXdnF28r30J8nupio/NQp3HIA4i4+pAFWShRyc4JwWab4rZrNozK3JXc2CgUDZ6ERwKYqyfg75RJo4TKiMmv5CTESRnkArze67F9QpX2T5jEyRMwEugMCohztwaTsT7LeJQCnwzS7BOrHUpmTTB40jZJOJs8ybLns9Br0PHipoCcQrkV20uGTAAGBlkZfMEw+L+DAqxrmYXzsdWqOEnJCj3hAQMIjj4K15fkr8k3gASkLmO1vJf0LlAhkMNMV6ofuQfABlpM+enq9kAA+AVzPOkXtZa6v4IuZ9ulyuLtQKPzpPxkss1p+jBmlCaP7amuSXvEyJOVush5pmQ1Z9jw4bpcD2zQuhB/UrI0pLkLEzv0hY4+IsJfZdqok5HfgoNtOTNeSGCAZwu+7lL5kB0UnX1iqdWjj8B3M0yEr2P5jyS7osFyIk8iFwWgVuHqRW1xchgG2vNElcQaZ1Z9vREOhOBujuOOpRWV050ajGY6A6h76G2Q57qKqQxJXJpHuC8fnrre+cauAXRTnBd2CgC/mlpC9nQJuTi51DbdDjkWY/gdRM9bqeflux3882ctJOhOXWjHIa/SCSM+01piHsSROV4EFWM16djyReS8EOibvlzz+qaOJ4eqb/BVrecBHYewdSDuk8HX OO+Bk5gh lQnM2WdYWKpm3g2bjY9hmMxYOjA/VemwmUza7+0lqDUXaCH5ftrA4WIlqz9mgXhs7N/3BUXJ/l62LMhuiOzgHoITp6o3ei/0olk6vFd+CogWDYoH+qiUxmZLrCw5HzzHr9BWSgXQTiQdFoPHQPsH2G5m4xeXDsS1nC45jC7gxHueVoanD5j7CWLUdS/ji/tzvOeuqYF3vOcsXKeyM5i3d7SatQNJmC0/+efsraoCWS+pELs08oJqoJC0+7I5wSRDQ4KqD+igaxAVng8/SQbYo26FCV08EulsjHrm26Ed+i+iW7V5kWrqCwRr+F5FsMWTIoH4FyNBDgGZ1zvxz3o3U9tWLy3AlO/xeKBQqh/MSvEH1G4mVCM/xiM8fOcy53QMl9+BqhgdJZVLGzAyEt5m2lkXCIo9y4Fy/nluA X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: ioremap_uc() is only meaningful on old x86-32 systems with the PAT extension, and on ia64 with its slightly unconventional ioremap() behavior. So remove the ioremap_uc() definition in architecutures other than x86 and ia64. These architectures all have asm-generic/io.h included and will have the default ioremap_uc() definition which returns NULL. This changes the existing behaviour, while no need to worry about any breakage because in the only callsite of ioremap_uc(), code has been adjusted to eliminate the impact. Please see atyfb_setup_generic() of drivers/video/fbdev/aty/atyfb_base.c. If any new invocation of ioremap_uc() need be added, please consider using ioremap() intead or adding a ARCH specific version if necessary. Acked-by: Geert Uytterhoeven Signed-off-by: Baoquan He Cc: linux-alpha@vger.kernel.org Cc: linux-hexagon@vger.kernel.org Cc: linux-m68k@lists.linux-m68k.org Cc: linux-mips@vger.kernel.org Cc: linux-parisc@vger.kernel.org Cc: linuxppc-dev@lists.ozlabs.org Cc: linux-sh@vger.kernel.org Cc: sparclinux@vger.kernel.org Acked-by: Michael Ellerman (powerpc) Acked-by: Helge Deller # parisc --- Documentation/driver-api/device-io.rst | 9 +++++---- arch/alpha/include/asm/io.h | 1 - arch/hexagon/include/asm/io.h | 3 --- arch/m68k/include/asm/kmap.h | 1 - arch/mips/include/asm/io.h | 1 - arch/parisc/include/asm/io.h | 2 -- arch/powerpc/include/asm/io.h | 1 - arch/sh/include/asm/io.h | 2 -- arch/sparc/include/asm/io_64.h | 1 - 9 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Documentation/driver-api/device-io.rst b/Documentation/driver-api/device-io.rst index 4d2baac0311c..d55384b106bd 100644 --- a/Documentation/driver-api/device-io.rst +++ b/Documentation/driver-api/device-io.rst @@ -408,11 +408,12 @@ functions for details on the CPU side of things. ioremap_uc() ------------ -ioremap_uc() behaves like ioremap() except that on the x86 architecture without -'PAT' mode, it marks memory as uncached even when the MTRR has designated -it as cacheable, see Documentation/x86/pat.rst. +ioremap_uc() is only meaningful on old x86-32 systems with the PAT extension, +and on ia64 with its slightly unconventional ioremap() behavior, everywhere +elss ioremap_uc() defaults to return NULL. -Portable drivers should avoid the use of ioremap_uc(). + +Portable drivers should avoid the use of ioremap_uc(), use ioremap() instead. ioremap_cache() --------------- diff --git a/arch/alpha/include/asm/io.h b/arch/alpha/include/asm/io.h index 7aeaf7c30a6f..076f0e4e7f1e 100644 --- a/arch/alpha/include/asm/io.h +++ b/arch/alpha/include/asm/io.h @@ -308,7 +308,6 @@ static inline void __iomem *ioremap(unsigned long port, unsigned long size) } #define ioremap_wc ioremap -#define ioremap_uc ioremap static inline void iounmap(volatile void __iomem *addr) { diff --git a/arch/hexagon/include/asm/io.h b/arch/hexagon/include/asm/io.h index dcd9cbbf5934..b9847472f25c 100644 --- a/arch/hexagon/include/asm/io.h +++ b/arch/hexagon/include/asm/io.h @@ -176,9 +176,6 @@ static inline void writel(u32 data, volatile void __iomem *addr) #define _PAGE_IOREMAP (_PAGE_PRESENT | _PAGE_READ | _PAGE_WRITE | \ (__HEXAGON_C_DEV << 6)) -#define ioremap_uc(addr, size) ioremap((addr), (size)) - - #define __raw_writel writel static inline void memcpy_fromio(void *dst, const volatile void __iomem *src, diff --git a/arch/m68k/include/asm/kmap.h b/arch/m68k/include/asm/kmap.h index 4efb3efa593a..b778f015c917 100644 --- a/arch/m68k/include/asm/kmap.h +++ b/arch/m68k/include/asm/kmap.h @@ -25,7 +25,6 @@ static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size) return __ioremap(physaddr, size, IOMAP_NOCACHE_SER); } -#define ioremap_uc ioremap #define ioremap_wt ioremap_wt static inline void __iomem *ioremap_wt(unsigned long physaddr, unsigned long size) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index 6756baadba6c..da0a625c3c6d 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -167,7 +167,6 @@ void iounmap(const volatile void __iomem *addr); */ #define ioremap(offset, size) \ ioremap_prot((offset), (size), _CACHE_UNCACHED) -#define ioremap_uc ioremap /* * ioremap_cache - map bus memory into CPU space diff --git a/arch/parisc/include/asm/io.h b/arch/parisc/include/asm/io.h index 366537042465..48630c78714a 100644 --- a/arch/parisc/include/asm/io.h +++ b/arch/parisc/include/asm/io.h @@ -132,8 +132,6 @@ static inline void gsc_writeq(unsigned long long val, unsigned long addr) #define ioremap_wc(addr, size) \ ioremap_prot((addr), (size), _PAGE_IOREMAP) -#define ioremap_uc(addr, size) \ - ioremap_prot((addr), (size), _PAGE_IOREMAP) #define pci_iounmap pci_iounmap diff --git a/arch/powerpc/include/asm/io.h b/arch/powerpc/include/asm/io.h index 978d687edf32..7873fc83c82c 100644 --- a/arch/powerpc/include/asm/io.h +++ b/arch/powerpc/include/asm/io.h @@ -863,7 +863,6 @@ void __iomem *ioremap_wt(phys_addr_t address, unsigned long size); #endif void __iomem *ioremap_coherent(phys_addr_t address, unsigned long size); -#define ioremap_uc(addr, size) ioremap((addr), (size)) #define ioremap_cache(addr, size) \ ioremap_prot((addr), (size), pgprot_val(PAGE_KERNEL)) diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index b3a26b405c8d..12a892804082 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h @@ -278,8 +278,6 @@ unsigned long long poke_real_address_q(unsigned long long addr, ioremap_prot((addr), (size), pgprot_val(PAGE_KERNEL)) #endif /* CONFIG_MMU */ -#define ioremap_uc ioremap - /* * Convert a physical pointer to a virtual kernel pointer for /dev/mem * access diff --git a/arch/sparc/include/asm/io_64.h b/arch/sparc/include/asm/io_64.h index 9303270b22f3..d8ee1442f303 100644 --- a/arch/sparc/include/asm/io_64.h +++ b/arch/sparc/include/asm/io_64.h @@ -423,7 +423,6 @@ static inline void __iomem *ioremap(unsigned long offset, unsigned long size) return (void __iomem *)offset; } -#define ioremap_uc(X,Y) ioremap((X),(Y)) #define ioremap_wc(X,Y) ioremap((X),(Y)) #define ioremap_wt(X,Y) ioremap((X),(Y)) static inline void __iomem *ioremap_np(unsigned long offset, unsigned long size) From patchwork Wed Mar 8 13:07:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13165702 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DB749C742A7 for ; Wed, 8 Mar 2023 13:08:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7AF2F6B007D; Wed, 8 Mar 2023 08:08:01 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 75D9A6B007E; Wed, 8 Mar 2023 08:08:01 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 625DD280001; Wed, 8 Mar 2023 08:08:01 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 5406A6B007D for ; Wed, 8 Mar 2023 08:08:01 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 28977809E9 for ; Wed, 8 Mar 2023 13:08:01 +0000 (UTC) X-FDA: 80545758762.22.73930C8 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf14.hostedemail.com (Postfix) with ESMTP id B92DE100025 for ; Wed, 8 Mar 2023 13:07:57 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eZzpjABt; spf=pass (imf14.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678280879; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=gLq762oeic7hM/krtcOf8E8H5QTsFuEhCmd4UZ/jjZs=; b=XLHzHbgmxrCJ8vED9VZ1wcrFmyJD25k0rtv0Bc3MIjFuTHBLxCFYgZj87MemL8d9WVFg6R KNnQs01UKIVWy7nM8sI2lRTwsuYIoC5skFpzoXxrT3EoNI1EQg4fz2O+0vBn0PnHmsYjyf 3P6O0wDeA4dfTEZF6KOwphEGPpIXi78= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=eZzpjABt; spf=pass (imf14.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678280879; a=rsa-sha256; cv=none; b=hPUt2xpehHImGEPI41O3PANgaBA841JtcavbSE2OvW0LK3FgCIE08wPMMnI4fASG4Qlrws u8nF4BpZFCLGYlR84adgdpkOmRjOHy3qrRa7Wx4mFUVXk8cacmxlVkefXQZ48g/JjW5mIK IEKu6JvTIcYXAbt8rH6n6IJFBl6haeI= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678280877; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=gLq762oeic7hM/krtcOf8E8H5QTsFuEhCmd4UZ/jjZs=; b=eZzpjABtRrRU8+oZ/VUrqtSUll8ZUnDa71/WcbEEVEgj//WxqiepNsm9gkvR33ovyDb9uJ zEW8vhrtVf8enDLAwb+b/qU+ljE0yxh/F8aMyM9qOe5ix1c82eyZtFLap+gFZvxfCyRF+f QB56ZuwBkkqyS4otGoCAZZVjD9U7j5Q= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-637-uSFGI7sxPSKXvm-FACyRDg-1; Wed, 08 Mar 2023 08:07:51 -0500 X-MC-Unique: uSFGI7sxPSKXvm-FACyRDg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 505EC2932493; Wed, 8 Mar 2023 13:07:50 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-137.pek2.redhat.com [10.72.12.137]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0CAD02166B26; Wed, 8 Mar 2023 13:07:42 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, mpe@ellerman.id.au, geert@linux-m68k.org, mcgrof@kernel.org, hch@infradead.org, Baoquan He , Thomas Bogendoerfer , Helge Deller , Serge Semin , Florian Fainelli , Huacai Chen , Jiaxun Yang , linux-mips@vger.kernel.org Subject: [PATCH v4 4/4] mips: io: remove duplicated codes Date: Wed, 8 Mar 2023 21:07:10 +0800 Message-Id: <20230308130710.368085-5-bhe@redhat.com> In-Reply-To: <20230308130710.368085-1-bhe@redhat.com> References: <20230308130710.368085-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: B92DE100025 X-Rspam-User: X-Stat-Signature: 49j7s9n9ixpm3xc76punn7nifyybh5ha X-HE-Tag: 1678280877-219382 X-HE-Meta: U2FsdGVkX1+BiYnJ9vQqyzD7OSwF6aI/H6oF4JnNWG3o2uRphAAxDiDpqXEszRkO13GpA4Oqn8V+h9FNIX33/m5AZooMy2VVo0Nck7g6cmKZxhjE+gur65/ekU4M0Y3BuRrXbV4iGD7SHhwz/R1K1CIv31yCYxhWE7TAr611r1XsZu0ZgJjbLxMoRk0zyztTj51fHmd7+7JKgf+hv+h0Hp+++/aL/nr7MgrDyhpf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YFJQLfjln0C462MF+eTOA0YXlHL80/18/le7wNF8mch4U5ZqPDQtOSKhYxUKgHBfwM0NkB29NUp4Rd7vTihDrnZtm7dPpzHjDnSMJHrZ6O4W/m9rlLHkzmAgSykS8SwF108PqqVbbRD0xoUageKDUzVO2A== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: By adding asm-generic/io.h support, there are some duplicated function implementation, like phys_to_virt, memset_io, memcpy_(from|to)io. Let's remove them to use the default version in asm-neneric/io.h. Meanwhile move isa_bus_to_virt() down below including line to fix the compiling error of missing phys_to_virt definition. 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 --- arch/mips/include/asm/io.h | 45 +++++--------------------------------- 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/arch/mips/include/asm/io.h b/arch/mips/include/asm/io.h index da0a625c3c6d..1b38f02bc608 100644 --- a/arch/mips/include/asm/io.h +++ b/arch/mips/include/asm/io.h @@ -114,24 +114,6 @@ static inline phys_addr_t virt_to_phys(const volatile void *x) return __virt_to_phys(x); } -/* - * phys_to_virt - map physical address to virtual - * @address: address to remap - * - * The returned virtual address is a current CPU mapping for - * the memory address given. It is only valid to use this function on - * addresses that have a kernel mapping - * - * This function does not handle bus mappings for DMA transfers. In - * almost all conceivable cases a device driver should not be using - * this function - */ -#define phys_to_virt phys_to_virt -static inline void * phys_to_virt(unsigned long address) -{ - return __va(address); -} - /* * ISA I/O bus memory addresses are 1:1 with the physical address. */ @@ -140,11 +122,6 @@ static inline unsigned long isa_virt_to_bus(volatile void *address) return virt_to_phys(address); } -static inline void *isa_bus_to_virt(unsigned long address) -{ - return phys_to_virt(address); -} - /* * Change "struct page" to physical address. */ @@ -535,23 +512,6 @@ BUILDSTRING(q, u64) #define writesq writesq #endif - -#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 -static inline void memcpy_toio(volatile void __iomem *dst, const void *src, int count) -{ - memcpy((void __force *) dst, src, count); -} - /* * The caches on some architectures aren't dma-coherent and have need to * handle this in software. There are three types of operations that @@ -617,4 +577,9 @@ void __ioread64_copy(void *to, const void __iomem *from, size_t count); #include +static inline void *isa_bus_to_virt(unsigned long address) +{ + return phys_to_virt(address); +} + #endif /* _ASM_IO_H */