From patchwork Fri Mar 3 10:28:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 63863 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp336668wrd; Fri, 3 Mar 2023 02:31:45 -0800 (PST) X-Google-Smtp-Source: AK7set+7Z8OcBmxz1rHwm5Jh4AXg3HkSEUREIn5SW3EjDU0CaBEv/Nke8bGsqU9yml+eli00A6BX X-Received: by 2002:a05:6a20:9150:b0:b9:7de5:239 with SMTP id x16-20020a056a20915000b000b97de50239mr2095894pzc.27.1677839505424; Fri, 03 Mar 2023 02:31:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677839505; cv=none; d=google.com; s=arc-20160816; b=brNk/0TtwPpkqN3jWDFcHSjrAHLRT49i5IIoVdrN7H9M+mfSafkCkxaRU50HDAYFnO 1WPSm9/bd0bfczoWz8efGkTllkwwT2x5TlB+EBXimlvhiDq+wkbRvEYF+DrRHjlWiI6Z zoppXsC9YuZJkc+nDPGLKM6jhQv9sD/5oCVtlgNTAdp4NUcQPeGbwM/5n6A2z4fgRvEt FyaKXwW3xHXMe4XxcJX3DuJl8AkyT50SbydRWRohEd3TZEl2LqxeakzNV7k0xWAqjl0Q OEmii1VUx9/9ecB1yfVlg/2VDCgrB1nvCoff7PK+Nl0IXCNi03/gbZPb6d1okAZzTECf ytew== 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=BnlFtcbwXfhyAGrwtI7gGBUKKk4VFNyUGEs2k4PwONk=; b=BYfnEQ4dps7CjnYPx24wZ6Zc3mLazdWwihd20Bsig3ZM4ybaB1AcvMUAnebI5CoouT 9yoOvgZUP+JiUoIOdmqdL5tNIsUikQi4jKWnwAqe8kNIyMhxqm+h/7SMNUxdP4ZUXo6Z JwJce3QDNRYqGYbZWMtHQUDlXD37WqKzr/HOwhjAt5rMcdOZ7uH2nrNv2Lx8pNNcGvh/ YRMyie9N74DJz0r2pq9ZYXPUnkdgsruoq05Yc24JYJWzY7oDzszOKhJa2RiPnEnYLnO6 55bZpG+rJxDRDfnmpXI3ZBLEja41ENj4I86dLISwEEyimfboAYY3PTcpyJltCw1vzElU nTog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=SsyAeDSo; 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 f13-20020a63100d000000b00503e9b0490fsi1299151pgl.512.2023.03.03.02.31.31; Fri, 03 Mar 2023 02:31:45 -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=SsyAeDSo; 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 S230226AbjCCK3b (ORCPT + 99 others); Fri, 3 Mar 2023 05:29:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229698AbjCCK30 (ORCPT ); Fri, 3 Mar 2023 05:29:26 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6001D193EA for ; Fri, 3 Mar 2023 02:28:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677839319; 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=BnlFtcbwXfhyAGrwtI7gGBUKKk4VFNyUGEs2k4PwONk=; b=SsyAeDSoFb3B4EM2Lc4conpXPnTWdfAca16Lt6sM8o9OtniWxmoYW9VFPHAMLaA9mUYmr8 eWIWr1ehVHQmTTo0Kmi85pJqKoT5GcYFvY50ih5tk+VxCW++KSFXII84h/cUHhqUMzsaMA taoQ+6Nn+sbHPi1gif/Ru6ztI31YqvU= 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-582-j1tVSebUO-KvPkam6lcOPw-1; Fri, 03 Mar 2023 05:28:34 -0500 X-MC-Unique: j1tVSebUO-KvPkam6lcOPw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0571E85CBE2; Fri, 3 Mar 2023 10:28:34 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-150.pek2.redhat.com [10.72.13.150]) by smtp.corp.redhat.com (Postfix) with ESMTP id E3E68C16900; Fri, 3 Mar 2023 10:28:26 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, 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 v3 1/2] mips: add including Date: Fri, 3 Mar 2023 18:28:16 +0800 Message-Id: <20230303102817.212148-2-bhe@redhat.com> In-Reply-To: <20230303102817.212148-1-bhe@redhat.com> References: <20230303102817.212148-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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?1759342237154523168?= X-GMAIL-MSGID: =?utf-8?q?1759342237154523168?= 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 --- 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 Fri Mar 3 10:28:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 63864 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp337016wrd; Fri, 3 Mar 2023 02:32:45 -0800 (PST) X-Google-Smtp-Source: AK7set8WBoX9wwf7/R7MfTIoABvC8OBL6S2OZbYF5qKhc/msEGe1oQ+Qst5mURQjDV1Z2pADPl93 X-Received: by 2002:a05:6a20:8e12:b0:cb:2a12:b5bc with SMTP id y18-20020a056a208e1200b000cb2a12b5bcmr1940420pzj.28.1677839564756; Fri, 03 Mar 2023 02:32:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677839564; cv=none; d=google.com; s=arc-20160816; b=hISVMqlsi3LKSr5gL2tYXqP45SUes0jz62x6Y/WxGCbj8nUCBLH49PT0bIMddQ2pgB n1LDKq6HZPtwTKlC/WkGfQxKCNNuH43J93i+kz1qChu9LBHfh43wiTO9RwJvxLew7OZE OYLdR1GFh1uOXdInqXUQCYdr5TEKF49c+tGC+Z24ohE5kJev7u8nzvFlPds7HxH8omOv XLan58Dy6WbSVMLSNSgWAK/8ucFNGc7QatAiYeRDyxUnNzdcvfLCrHH9u35WUTnx/hvU SH0hqzdRojwANN3luGPjKA7vFn603EhkrL5YxbKkLJteH/jIv3gRcttiRMTMr/k7JPm4 +W+Q== 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=yopmX6MDTRKlcNmu9WG5Rv8YrLrJS47N2LsvKHp9hMg=; b=PYYKNFCApG0EQ+RXeoBhGGQ9RKhnyJ9+5uh3eLvRc0235WU4BjZpLTfg4nVGWfImpD ksv/LVBFjCVt+NAvwhNZvxT4/xh4olbCk61C0Jie5HcrFsdrAngHCRwZgv0H+sA1uccn xyeirswHGARJ5WIJuBb5JdTvcTszTy1nKF7ZaB7KAs25ewRuJWZ7MpgBnvyKyCw4GR56 u2NZSM4h7B7o1VvxQjUG6IZxSoggVEp5JNqVn0Dh6e9rimusu7AfsDeb9Z7alPXl2H4I /qNYXn49z3bsbUpYY+JMSO61/brbTxSTWtgaPbZMGrBjaDR0TN5zlF1aWfXM5uCDHfAS Jaag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=d1ZSam3N; 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 m189-20020a6258c6000000b00592d5c262aasi1924923pfb.137.2023.03.03.02.32.32; Fri, 03 Mar 2023 02:32:44 -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=d1ZSam3N; 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 S230335AbjCCK3j (ORCPT + 99 others); Fri, 3 Mar 2023 05:29:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230235AbjCCK3f (ORCPT ); Fri, 3 Mar 2023 05:29:35 -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 C1AB21CF77 for ; Fri, 3 Mar 2023 02:28:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1677839331; 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=yopmX6MDTRKlcNmu9WG5Rv8YrLrJS47N2LsvKHp9hMg=; b=d1ZSam3NCMUDZlRxUttTeHptzYWFxBRTBmOyWflYp0vlSlgR8w8ha0NDrQCYKVepZUskg/ r4FBepWXeQ1uCpYygIve4tn7KuNxB4+70qSFzQEkWOQ4Ys0izXry27b4vjdf9Fc8ZrO9Qc qmzMVQxkvJsN3V9rwZK4EVtQGkDPRJU= 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-xP6UApinMKagTPm--UP9rw-1; Fri, 03 Mar 2023 05:28:48 -0500 X-MC-Unique: xP6UApinMKagTPm--UP9rw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1E57285A5A3; Fri, 3 Mar 2023 10:28:47 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-13-150.pek2.redhat.com [10.72.13.150]) by smtp.corp.redhat.com (Postfix) with ESMTP id E2FBCC16900; Fri, 3 Mar 2023 10:28:34 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, 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 v3 2/2] arch/*/io.h: remove ioremap_uc in some architectures Date: Fri, 3 Mar 2023 18:28:17 +0800 Message-Id: <20230303102817.212148-3-bhe@redhat.com> In-Reply-To: <20230303102817.212148-1-bhe@redhat.com> References: <20230303102817.212148-1-bhe@redhat.com> MIME-Version: 1.0 Content-type: text/plain X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 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?1759160655145347145?= X-GMAIL-MSGID: =?utf-8?q?1759342298965743307?= 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. Here, 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. Note: This changes the existing behaviour and could break code calling ioremap_uc(). If any ARCH meets this breakage and really needs a specific ioremap_uc() for its own usage, one ioremap_uc() can be added in the ARCH. Link: https://lore.kernel.org/all/20191112105507.GA7122@lst.de/#t 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 --- Documentation/driver-api/device-io.rst | 14 +++++++++----- 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, 9 insertions(+), 17 deletions(-) diff --git a/Documentation/driver-api/device-io.rst b/Documentation/driver-api/device-io.rst index 4d2baac0311c..12c2ebbaa41e 100644 --- a/Documentation/driver-api/device-io.rst +++ b/Documentation/driver-api/device-io.rst @@ -408,11 +408,15 @@ 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. - -Portable drivers should avoid the use of ioremap_uc(). +ioremap_uc() will be obsoleted since it's only expected on x86 and ia64. +X86 non-PAT system marks memory as uncached even when the MTRR has designated +it as cacheable in ioremap_uc()(see Documentation/x86/pat.rst). Ia64 system +need check if attributes match, otherwise fails. Other than these two +architectures, ioremap_uc() will default to NULL. Any architectures which +meets breakage by ioremap_uc() returning NULL should provide a specific +implementation to override the default version. + +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)