From patchwork Fri Jun 9 07:55:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13273362 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 6BCBAC7EE29 for ; Fri, 9 Jun 2023 07:57:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 0C2578E000B; Fri, 9 Jun 2023 03:57:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 04B098E0001; Fri, 9 Jun 2023 03:57:16 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E2CE38E000B; Fri, 9 Jun 2023 03:57:16 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id CE0BF8E0001 for ; Fri, 9 Jun 2023 03:57:16 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 97473140162 for ; Fri, 9 Jun 2023 07:57:16 +0000 (UTC) X-FDA: 80882454072.16.9864521 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf16.hostedemail.com (Postfix) with ESMTP id CEF8A180011 for ; Fri, 9 Jun 2023 07:57:14 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CWHAKSEW; spf=pass (imf16.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.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=1686297434; 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=LUIKuTNwx3aGCN/mpc81rLXKw/yQlIAJox5sUw6Md70=; b=MhLr3us7SLk4mzKicMraIRWTtfay+llfagWTVM6FoEOwEyFwYj42Vps+HbZu1kwYZql7kW ygxe5Myzgn0Nhf3b2MCoqnsnKta/fVWHjxAc7NNP8yEg5B2z6yAzCZ8ElmHZnUcau2Kny2 SjM0lH+vG58dvWyV0rdmSbYCU890hu0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1686297434; a=rsa-sha256; cv=none; b=7nOiT1jIMehGOH/eyxxbxz22fyj+/e18NXgq4S8UMMnINNzVv8Cmu9ssBQaFWxklKpbTv7 a4FH36yAaqt72lcnIrBD7cVN4wbY4UWkHgZgjLrG9J2V0xrDCHlnS3svYmz3d7jsEO0xAJ 5CHdMb/pNX8gKQVbnj4FqLAaTrOZQrM= ARC-Authentication-Results: i=1; imf16.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=CWHAKSEW; spf=pass (imf16.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686297434; 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=LUIKuTNwx3aGCN/mpc81rLXKw/yQlIAJox5sUw6Md70=; b=CWHAKSEWmJJzJkiOyZG9eFPU8KON9eYOHwLG6WUuDwIHlt1MCdr2cMMF1u9HYjWo6gAzDv OPFXUplSfINESmno72SmSxLTGHtQXymdTwoNpu/yyFS/NUQUuP1Sh+C4UL9ZoLyPlEEeD1 6+mleVKmeBZvr732Z4vyZ7TPGyKDgCw= 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-298-qdGF8u1yOFKOwOjmf_5LtQ-1; Fri, 09 Jun 2023 03:56:57 -0400 X-MC-Unique: qdGF8u1yOFKOwOjmf_5LtQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7360385A5BB; Fri, 9 Jun 2023 07:56:56 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-92.pek2.redhat.com [10.72.12.92]) by smtp.corp.redhat.com (Postfix) with ESMTP id E440120268C6; Fri, 9 Jun 2023 07:56:48 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-arch@vger.kernel.org, linux-mm@kvack.org, arnd@arndb.de, christophe.leroy@csgroup.eu, hch@lst.de, rppt@kernel.org, willy@infradead.org, agordeev@linux.ibm.com, wangkefeng.wang@huawei.com, schnelle@linux.ibm.com, David.Laight@ACULAB.COM, shorne@gmail.com, deller@gmx.de, Baoquan He , Yoshinori Sato , Rich Felker , linux-sh@vger.kernel.org Subject: [PATCH v6 11/19] sh: add including Date: Fri, 9 Jun 2023 15:55:20 +0800 Message-Id: <20230609075528.9390-12-bhe@redhat.com> In-Reply-To: <20230609075528.9390-1-bhe@redhat.com> References: <20230609075528.9390-1-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Stat-Signature: auhnphoh1rhp7pa9nsu51tobx13hx89i X-Rspamd-Server: rspam10 X-Rspamd-Queue-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gH6389h20zr5ENj30TDHUV1ucP9Yav6wsy+ws5dY9TJQWinmtcpUTEjs0JXJBSaD9Y3HxASK7waBoHwzL3AhFpSjJoguOjYG7lrOdZohf2aimhiPWTb2ALI4tvljlAXGuHQf2Lls875Nxf3cMvttzW4wtSFy9f72/xcUYnYR8H0O7bMiJ+XPTMZXqVKZWQj20ZK4H9F/3p9Bcf7xb4h1BMUjmHuRDCoH4q6y4+4LM4gDRM= 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: Also add macro definitions for port|mm io functions since SuperH has its own implementation in arch/sh/kernel/iomap.c and arch/sh/include/asm/io_noioport.h. These will conflict with the port|mm io function definitions in include/asm-generic/io.h to cause compiling errors like below: ==== CC arch/sh/kernel/asm-offsets.s In file included from ./arch/sh/include/asm/io.h:294, from ./include/linux/io.h:13, ...... from arch/sh/kernel/asm-offsets.c:16: ./include/asm-generic/io.h:792:17: error: conflicting types for ‘ioread8’ 792 | #define ioread8 ioread8 | ^~~~~~~ ./include/asm-generic/io.h:793:18: note: in expansion of macro ‘ioread8’ 793 | static inline u8 ioread8(const volatile void __iomem *addr) | ^~~~~~~ In file included from ./arch/sh/include/asm/io.h:22, from ./include/linux/io.h:13, ...... from arch/sh/kernel/asm-offsets.c:16: ./include/asm-generic/iomap.h:29:21: note: previous declaration of ‘ioread8’ was here 29 | extern unsigned int ioread8(const void __iomem *); ==== Signed-off-by: Baoquan He Cc: Yoshinori Sato Cc: Rich Felker Cc: linux-sh@vger.kernel.org --- v5->v6: split that inclusion of include/asm-generic/io.h and redefining of the helpers from the old patch 11 into this prep patch - Christoph arch/sh/include/asm/io.h | 25 +++++++++++++++++++++++++ arch/sh/include/asm/io_noioport.h | 7 +++++++ 2 files changed, 32 insertions(+) diff --git a/arch/sh/include/asm/io.h b/arch/sh/include/asm/io.h index fba90e670ed4..270e7952950c 100644 --- a/arch/sh/include/asm/io.h +++ b/arch/sh/include/asm/io.h @@ -119,6 +119,26 @@ void __raw_readsl(const void __iomem *addr, void *data, int longlen); __BUILD_MEMORY_STRING(__raw_, q, u64) +#define ioread8 ioread8 +#define ioread16 ioread16 +#define ioread16be ioread16be +#define ioread32 ioread32 +#define ioread32be ioread32be + +#define iowrite8 iowrite8 +#define iowrite16 iowrite16 +#define iowrite16be iowrite16be +#define iowrite32 iowrite32 +#define iowrite32be iowrite32be + +#define ioread8_rep ioread8_rep +#define ioread16_rep ioread16_rep +#define ioread32_rep ioread32_rep + +#define iowrite8_rep iowrite8_rep +#define iowrite16_rep iowrite16_rep +#define iowrite32_rep iowrite32_rep + #ifdef CONFIG_HAS_IOPORT_MAP /* @@ -225,6 +245,9 @@ __BUILD_IOPORT_STRING(q, u64) #define IO_SPACE_LIMIT 0xffffffff /* We really want to try and get these to memcpy etc */ +#define memset_io memset_io +#define memcpy_fromio memcpy_fromio +#define memcpy_toio memcpy_toio void memcpy_fromio(void *, const volatile void __iomem *, unsigned long); void memcpy_toio(volatile void __iomem *, const void *, unsigned long); void memset_io(volatile void __iomem *, int, unsigned long); @@ -287,6 +310,8 @@ static inline void iounmap(volatile void __iomem *addr) { } */ #define xlate_dev_mem_ptr(p) __va(p) +#include + #define ARCH_HAS_VALID_PHYS_ADDR_RANGE int valid_phys_addr_range(phys_addr_t addr, size_t size); int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); diff --git a/arch/sh/include/asm/io_noioport.h b/arch/sh/include/asm/io_noioport.h index f7938fe0f911..5ba4116b4265 100644 --- a/arch/sh/include/asm/io_noioport.h +++ b/arch/sh/include/asm/io_noioport.h @@ -53,6 +53,13 @@ static inline void ioport_unmap(void __iomem *addr) #define outw_p(x, addr) outw((x), (addr)) #define outl_p(x, addr) outl((x), (addr)) +#define insb insb +#define insw insw +#define insl insl +#define outsb outsb +#define outsw outsw +#define outsl outsl + static inline void insb(unsigned long port, void *dst, unsigned long count) { BUG();