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: 66219 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp324680wrd; Wed, 8 Mar 2023 05:17:14 -0800 (PST) X-Google-Smtp-Source: AK7set9lrhF+JqOON3eyl5RCgZiI2bfJWBILNmRV0qNwXzaFwNxGVjNdrsPDN4f13u5eOYHJVJy6 X-Received: by 2002:a17:906:c301:b0:8b1:7684:dfb0 with SMTP id s1-20020a170906c30100b008b17684dfb0mr18319392ejz.57.1678281434181; Wed, 08 Mar 2023 05:17:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678281434; cv=none; d=google.com; s=arc-20160816; b=ep7gfV6vqHMObHTSaIth6tq+ruDYVta1B+JZBK0r76Hb5p3ofKav5RCWPGLBviukFj hiRkg7zCGYsaTj50OJ8JM2s7wEv/X4ZSnkG95yLK7iF4czll+1SqTuCZV4mhPsWU5O/R lvkoLQmBeZNrAuwwoaxr8FD/o+Esbmn4qd5NGZN8l+EGkSjJpuzQPIRkB5QPqIeOX2Wj 8rq/M8q2KHUSYbIVMVaYiNlDSSxlahc3s2iOcRpSjyOiw6PgTT8fdO4R7s2aQ3wCW8ZZ IeCnDPadPsYdBGR3goT7M1pmRbDlz7uLCyt/gnY4LWLITFdd2Tp3NhYnx0xlph4TLpPj zSuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uwBTGd8vP947AeUSF0iMuOil3XwvoXMLAawY3OLENFQ=; b=mNO7i4TjhEQrLRznw0fGeC/qtmKNgQgZ4I8LC+GT4Cxp+IhVHgz93jf+oHSbE5OGVq Hc+IljIEBObwzoO/aYEkzxG5Bj+Sj8qQ0rhDo9q7DFQ81KPeoWH2sZVu+bFBR91cFL1i BB3Fwo7X9RCeF511KmkxS88KjZeFh6Kg0I13sX3bWLj/Xj6pjcxF6f9QY4ddBQtYHI31 TzN2JIA5LkTv9GQo+iMEPacXlwbA6CZJ/1WNkSe7012suabhgAMKLlMB9fyB8QFi9mg+ xKt4f/Wo3bJFitGB8wGolTdOVOR/SDqOk/cEjlAYjrEW+1tUxQ/JE5bqfuFoQ/+RBpls cU/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="aeY/QvMk"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x16-20020aa7dad0000000b004acd2bd34c0si4468777eds.46.2023.03.08.05.16.49; Wed, 08 Mar 2023 05:17:14 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b="aeY/QvMk"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231392AbjCHNLN (ORCPT + 99 others); Wed, 8 Mar 2023 08:11:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230373AbjCHNKn (ORCPT ); Wed, 8 Mar 2023 08:10:43 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 397A85D764 for ; Wed, 8 Mar 2023 05:08:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678280850; 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=aeY/QvMk2JdbZGnXqMjX9/b7wXM6RLAwhEJtIa5Uz9zJZR03rcfbsJzyRSzqQbUaEbh1ne /oHbavYaGHvl4wm83IgJByrBfyVEtkVuKqXHFHFgoHstq1TO0b28dcJY23P2fPd0rpL2yP E0n9UdBpaJF8P3njDJyB2PgQmlug4sc= 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759805633089627046?= X-GMAIL-MSGID: =?utf-8?q?1759805633089627046?= 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: 66227 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp331299wrd; Wed, 8 Mar 2023 05:30:22 -0800 (PST) X-Google-Smtp-Source: AK7set9BOCiS/yU/2gGbr1/eNR3CaxLABuLnh7v7VO92fCqgyaZy+Oc62IwPXFh7xtgQ05sK8GYw X-Received: by 2002:a17:907:986c:b0:8b1:2dd5:d868 with SMTP id ko12-20020a170907986c00b008b12dd5d868mr17851796ejc.55.1678282221899; Wed, 08 Mar 2023 05:30:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678282221; cv=none; d=google.com; s=arc-20160816; b=LQC83V+MNO/8ZRv05GjCe4cCfEdwgsEWIRgVdoBAfobe33Ez2LQ7IDoCRe2jAQLz1j v2FVFRnuRvLlb/ZLr9G7AkoaL9sEblBErYzfBc+/yorS4TQDTwtRRt34kYyLsobhjWVf 0ybSxOlMuQcQmzLF+1eopiQnc0Fr87sml0B7BIztY8UHP9JwQqCXqb4ZWEampxwssB64 +t9w4BIL65d33elDyCb4SNKxdk3uU4vUtpJrn2O97g2A20qmK2AmqcfeB9t2VHlpADWG MWs4J6uH2aRrsVwv4cmGYTnrbJqHsP6r293viyMISIDcr95/zTx2M+8eJemcocjCtSYO pwZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QTt8B6xdpie3JQtkOGQkvv8PGf5htHiQBmIwsiz6QFE=; b=AbrSESrhPiGiYR0lbvfRQaIXhgDPUHL94gU4Le7ZPcxOGI4G7XmGyPq91GVcTWzOn1 jqy6GOk+P104O7BrF7pkh0tt9JeYoMpQPzaQ2NKPkKbux5/BZWiH4wadOOwjIfS2Qvvh 7d2VGj4NF6nOXYYDViLoP+84/OLyONCbpyGry3uhmR1VH0lGW1hLWqYoGqMOXBTy8oie 1AI977/BM/1JU4H6p06o+mb13frYCj72ShCsg1UNoMdcugynDB0I+wgHkW65+x0VWJsv aFHnBZWuuVK8vsOf5ocFm7mKQrjoupXjZPY94Sw0NYyxWwsQPrv1v4IUA72DzXqX/pu5 yQpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=OuJf1RaW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h7-20020a17090634c700b008cd04d9ea6csi3867112ejb.433.2023.03.08.05.29.58; Wed, 08 Mar 2023 05:30:21 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=OuJf1RaW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231416AbjCHNLo (ORCPT + 99 others); Wed, 8 Mar 2023 08:11:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231614AbjCHNK7 (ORCPT ); Wed, 8 Mar 2023 08:10:59 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D1D4E90B7A for ; Wed, 8 Mar 2023 05:08:23 -0800 (PST) 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 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759806458844746044?= X-GMAIL-MSGID: =?utf-8?q?1759806458844746044?= 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: 66235 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp331960wrd; Wed, 8 Mar 2023 05:31:25 -0800 (PST) X-Google-Smtp-Source: AK7set9fom22cRKtB0ej5hknAWnp7cf+HkVGryKCz6xyVO6JkHY5PO190psRpY0grQCzphSmGSNB X-Received: by 2002:a17:907:8a1e:b0:8b1:264d:6187 with SMTP id sc30-20020a1709078a1e00b008b1264d6187mr22137341ejc.46.1678282285793; Wed, 08 Mar 2023 05:31:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678282285; cv=none; d=google.com; s=arc-20160816; b=h0txJhE//5em5baZVUm7q1p6rJQHBDDsrGddIysGgrfiPcVZ/zXlg0SlyRZXZ10nnw vDOIIdwGDkA4a1J+qfwskKe6ekGOuzdZi7FSgjkQ0A8sNBjaCmsSglBmnOuas9454dk9 EB3gZuMdIdHzrZdqF+d4Wy2tfBucR5R854IEzqERt3mNO+1p04Gk2b3PlmF28r6VKf1x m0w2nb7D8BqdNAS82pA2TX1vQh9pCKsKKhDMwhkhs6GDm8NDjJy/8SC67sH7ikyb98o1 RVHZaCTy5tB6E/nIFaQs3y/p1YxtbjihSVPnOKVBOb+uWH+GN+iXh9mlYqPEEizlBmSQ 7Rng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=YuzOmgr2u1PyDfkmKFazdLyWcjTDX0CNS9csyPmB6+k=; b=X3bX9Q3dmHRB1o/akUoY/PbBAAi5ooH+AzuAIaSambqqfJs5/0KwXu0E30Uipy7qoX eCwxsPmPx0qn3QNxmmJzzIrvEd1xH6LhdPRlqDhixVZm+abh1q/L5ORSlXYzgUP8pqQu 2jN622ia3Yzf7/sKMc0K0FcAdjCTja6G3maDjh3m0nz1dQtP1v0iyJr9hJTkhhTIPWDf eOO7hwY5ksTKJfptZuNvTCHs0KV8w9e6JOulH98Mw6F2PRKs94iecP4iCanL9jTLO6IX Yh+5gHx4HqdveIQCPCqI7Z6FnwrE2v0nu+kDqKtylHAmxUAGDB5ZbNw5211jj4vXI6wO fzEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Rtr36wSq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r7-20020aa7d147000000b004acda72375fsi574436edo.84.2023.03.08.05.31.00; Wed, 08 Mar 2023 05:31:25 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=Rtr36wSq; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231633AbjCHNM0 (ORCPT + 99 others); Wed, 8 Mar 2023 08:12:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231348AbjCHNLk (ORCPT ); Wed, 8 Mar 2023 08:11:40 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9ACAC2D87 for ; Wed, 8 Mar 2023 05:08:56 -0800 (PST) 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759806511606745177?= X-GMAIL-MSGID: =?utf-8?q?1759806526012786745?= 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: 66220 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp325022wrd; Wed, 8 Mar 2023 05:17:54 -0800 (PST) X-Google-Smtp-Source: AK7set/DgGPoTPfoUFXe2Lfb8Rx9i+ZcgPaxgi7DKjktdh+OBPGBKySwSPbUh9jvVv9EW2t7QGTU X-Received: by 2002:a05:6402:699:b0:4ad:66b:84a8 with SMTP id f25-20020a056402069900b004ad066b84a8mr18739555edy.6.1678281474057; Wed, 08 Mar 2023 05:17:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678281474; cv=none; d=google.com; s=arc-20160816; b=woB3jKFunTF3W4ETGXSzOOmMGdGlCI+7r4BOAkCrxR0EHh3QdrBDJyV1UuddJMq4PK zmy7Duva+rtzXECk+/qBXBo1O5tlWcEyF16LUjoT4dzksyLsJNZOgJpFsNI3f8hSYZuE eiQTWJcm5w6ge+U65k1MwJ3tOcrCFNd5yJAGjiGu5Jx84NbPabHFAwkJz8LP4dFm200o +/efGFugRkEt2F1uu3QaMmEqegv/K3AXLY2dwJDvBkLRRCKGrf8Vq9DHmFFHtNqg+LF1 w/I3rMvs1QzBhEoZu6HeMyzR43LVUoQGbZtdBo09P3flTv6xi2sqlv7+syUkfgysK4CX QGOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=gLq762oeic7hM/krtcOf8E8H5QTsFuEhCmd4UZ/jjZs=; b=DqZXjJfqmp2/XDJuu4pA/ek5lQjCGeyiN3UisaOKMTmStRUPmrdOUcVhdd+cljpHd6 qUvw1FDFnis767rjT2HjW/zyIHFZ+njaQ/2y4qsgCiTxlQGSa5slvu3KtLt8KaSN3bQW qZ4ndXfFN+zhabonMt4tzCP8zlailFYbCZ4COpVrtoH9UAYSzMuvNCtGS5X7K4RT80lU spx2j0q+/UX68VAg0pRgwaDhKApALNTh9qCnsM6Hn2VAVYwourfZLOr4ekGcOU8Yt+mW AKFhTkO0o4bjaVPt9+sNPHVNt+h9hBS0KirBDblTFjYDmdoY/2zihbcYrBLJ/0ytFWws x4dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=YKZuO6GA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w20-20020a50fa94000000b004ad0413e904si1933433edr.514.2023.03.08.05.17.29; Wed, 08 Mar 2023 05:17:54 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=YKZuO6GA; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230235AbjCHNNY (ORCPT + 99 others); Wed, 8 Mar 2023 08:13:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229889AbjCHNMw (ORCPT ); Wed, 8 Mar 2023 08:12:52 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37A95C6E58 for ; Wed, 8 Mar 2023 05:09:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678280876; 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=YKZuO6GAmx+C3S0ugh0LkZAtQolpu6HUJrqDOydSVIIMy00UnCnxJBQMm7gotfA4/8P2uU 7JfgIak0EyviPtRnlmVXz22g2jiNR/r2OkMR98CW+MNTlHCtrsxLPRiS2FHZZxzcRmyw3t zdt3orM37aDBn2pUlCU2d9l3wESlNt4= 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-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759805674805526673?= X-GMAIL-MSGID: =?utf-8?q?1759805674805526673?= 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 */