Message ID | 20230308130710.368085-3-bhe@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> 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 <rfc822;toshivichauhan@gmail.com> + 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 <rfc822;linux-kernel@vger.kernel.org>); 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 <linux-kernel@vger.kernel.org>; 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 <bhe@redhat.com> 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 <bhe@redhat.com>, Thomas Bogendoerfer <tsbogend@alpha.franken.de>, Helge Deller <deller@gmx.de>, Serge Semin <fancer.lancer@gmail.com>, Florian Fainelli <f.fainelli@gmail.com>, Huacai Chen <chenhuacai@kernel.org>, Jiaxun Yang <jiaxun.yang@flygoat.com>, linux-mips@vger.kernel.org Subject: [PATCH v4 2/4] mips: add <asm-generic/io.h> 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 Content-Transfer-Encoding: 8bit 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: <linux-kernel.vger.kernel.org> 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?= |
Series | arch/*/io.h: remove ioremap_uc in some architectures | |
Commit Message
Baoquan He
March 8, 2023, 1:07 p.m. UTC
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 <bhe@redhat.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Geert Uytterhoeven <geert@linux-m68k.org> Cc: Helge Deller <deller@gmx.de> Cc: Serge Semin <fancer.lancer@gmail.com> Cc: Florian Fainelli <f.fainelli@gmail.com> Cc: Huacai Chen <chenhuacai@kernel.org> Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> Cc: linux-mips@vger.kernel.org --- arch/mips/include/asm/io.h | 78 ++++++++++++++++++++++++++++++++++---- 1 file changed, 70 insertions(+), 8 deletions(-)
Comments
On Wed, Mar 08, 2023 at 09:07:08PM +0800, Baoquan He wrote: > With the adding, some default ioremap_xx methods defined in > asm-generic/io.h can be used. E.g the default ioremap_uc() returning > NULL. > > Signed-off-by: Baoquan He <bhe@redhat.com> > Reviewed-by: Arnd Bergmann <arnd@arndb.de> > Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> > Cc: Geert Uytterhoeven <geert@linux-m68k.org> > Cc: Helge Deller <deller@gmx.de> > Cc: Serge Semin <fancer.lancer@gmail.com> > Cc: Florian Fainelli <f.fainelli@gmail.com> > Cc: Huacai Chen <chenhuacai@kernel.org> > Cc: Jiaxun Yang <jiaxun.yang@flygoat.com> > Cc: linux-mips@vger.kernel.org > --- > 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 <asm-generic/io.h> this #include blows up builds with: GEN Makefile Checking missing-syscalls for N32 CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh Checking missing-syscalls for O32 CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh CC init/version.o In file included from /local/tbogendoerfer/korg/linux/include/linux/spinlock.h:311:0, from /local/tbogendoerfer/korg/linux/include/linux/vmalloc.h:5, from /local/tbogendoerfer/korg/linux/include/asm-generic/io.h:994, from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/io.h:618, from /local/tbogendoerfer/korg/linux/include/linux/io.h:13, from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/mips-cps.h:11, from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp-ops.h:16, from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp.h:21, from /local/tbogendoerfer/korg/linux/include/linux/smp.h:113, from /local/tbogendoerfer/korg/linux/include/linux/lockdep.h:14, from /local/tbogendoerfer/korg/linux/include/linux/rcupdate.h:29, from /local/tbogendoerfer/korg/linux/include/linux/rculist.h:11, from /local/tbogendoerfer/korg/linux/include/linux/pid.h:5, from /local/tbogendoerfer/korg/linux/include/linux/sched.h:14, from /local/tbogendoerfer/korg/linux/include/linux/utsname.h:6, from /local/tbogendoerfer/korg/linux/init/version.c:17: /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h: In function ‘__raw_spin_trylock’: /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:90:3: error: implicit declaration of function ‘spin_acquire’ [-Werror=implicit-function-declaration] spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); ^~~~~~~~~~~~ /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:90:21: error: ‘raw_spinlock_t {aka struct raw_spinlock}’ has no member named ‘dep_map’ spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); ^~ /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h: In function ‘__raw_spin_lock_irqsave’: /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:110:20: error: ‘raw_spinlock_t {aka struct raw_spinlock}’ has no member named ‘dep_map’ spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); ^~ /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:111:2: error: implicit declaration of function ‘LOCK_CONTENDED’ [-Werror=implicit-function-declaration] LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); ^~~~~~~~~~~~~~ GEN Makefile Checking missing-syscalls for N32 CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh Checking missing-syscalls for O32 CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh CC init/version.o In file included from /local/tbogendoerfer/korg/linux/include/linux/spinlock.h:311:0, from /local/tbogendoerfer/korg/linux/include/linux/vmalloc.h:5, from /local/tbogendoerfer/korg/linux/include/asm-generic/io.h:994, from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/io.h:618, from /local/tbogendoerfer/korg/linux/include/linux/io.h:13, from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/mips-cps.h:11, from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp-ops.h:16, from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp.h:21, from /local/tbogendoerfer/korg/linux/include/linux/smp.h:113, from /local/tbogendoerfer/korg/linux/include/linux/lockdep.h:14, from /local/tbogendoerfer/korg/linux/include/linux/rcupdate.h:29, from /local/tbogendoerfer/korg/linux/include/linux/rculist.h:11, from /local/tbogendoerfer/korg/linux/include/linux/pid.h:5, from /local/tbogendoerfer/korg/linux/include/linux/sched.h:14, from /local/tbogendoerfer/korg/linux/include/linux/utsname.h:6, from /local/tbogendoerfer/korg/linux/init/version.c:17: /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h: In function ‘__raw_spin_trylock’: /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:90:3: error: implicit declaration of function ‘spin_acquire’ [-Werror=implicit-function-declaration] spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); ^~~~~~~~~~~~ /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:90:21: error: ‘raw_spinlock_t {aka struct raw_spinlock}’ has no member named ‘dep_map’ spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); ^~ /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h: In function ‘__raw_spin_lock_irqsave’: /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:110:20: error: ‘raw_spinlock_t {aka struct raw_spinlock}’ has no member named ‘dep_map’ spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); ^~ /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:111:2: error: implicit declaration of function ‘LOCK_CONTENDED’ [-Werror=implicit-function-declaration] LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); ^~~~~~~~~~~~~~ GEN Makefile Checking missing-syscalls for N32 CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh Checking missing-syscalls for O32 CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh CC init/version.o In file included from /local/tbogendoerfer/korg/linux/include/linux/spinlock.h:311:0, from /local/tbogendoerfer/korg/linux/include/linux/vmalloc.h:5, from /local/tbogendoerfer/korg/linux/include/asm-generic/io.h:994, from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/io.h:618, from /local/tbogendoerfer/korg/linux/include/linux/io.h:13, from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/mips-cps.h:11, from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp-ops.h:16, from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp.h:21, from /local/tbogendoerfer/korg/linux/include/linux/smp.h:113, from /local/tbogendoerfer/korg/linux/include/linux/lockdep.h:14, from /local/tbogendoerfer/korg/linux/include/linux/rcupdate.h:29, from /local/tbogendoerfer/korg/linux/include/linux/rculist.h:11, from /local/tbogendoerfer/korg/linux/include/linux/pid.h:5, from /local/tbogendoerfer/korg/linux/include/linux/sched.h:14, from /local/tbogendoerfer/korg/linux/include/linux/utsname.h:6, from /local/tbogendoerfer/korg/linux/init/version.c:17: /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h: In function ‘__raw_spin_trylock’: /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:90:3: error: implicit declaration of function ‘spin_acquire’ [-Werror=implicit-function-declaration] spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); ^~~~~~~~~~~~ /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:90:21: error: ‘raw_spinlock_t {aka struct raw_spinlock}’ has no member named ‘dep_map’ spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); ^~ /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h: In function ‘__raw_spin_lock_irqsave’: /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:110:20: error: ‘raw_spinlock_t {aka struct raw_spinlock}’ has no member named ‘dep_map’ spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); ^~ /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:111:2: error: implicit declaration of function ‘LOCK_CONTENDED’ [-Werror=implicit-function-declaration] LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); ^~~~~~~~~~~~~~ [...] I've cut the compiler output. Removing the asm-generic doesn't show this problem, but so far I fail to see the reason... Thomas.
On 03/13/23 at 06:55pm, Thomas Bogendoerfer wrote: ...... > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:111:2: error: implicit declaration of function ‘LOCK_CONTENDED’ [-Werror=implicit-function-declaration] > LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); > ^~~~~~~~~~~~~~ > GEN Makefile > Checking missing-syscalls for N32 > CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh > Checking missing-syscalls for O32 > CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh > CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh > CC init/version.o > In file included from /local/tbogendoerfer/korg/linux/include/linux/spinlock.h:311:0, > from /local/tbogendoerfer/korg/linux/include/linux/vmalloc.h:5, > from /local/tbogendoerfer/korg/linux/include/asm-generic/io.h:994, > from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/io.h:618, > from /local/tbogendoerfer/korg/linux/include/linux/io.h:13, > from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/mips-cps.h:11, > from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp-ops.h:16, > from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp.h:21, > from /local/tbogendoerfer/korg/linux/include/linux/smp.h:113, > from /local/tbogendoerfer/korg/linux/include/linux/lockdep.h:14, > from /local/tbogendoerfer/korg/linux/include/linux/rcupdate.h:29, > from /local/tbogendoerfer/korg/linux/include/linux/rculist.h:11, > from /local/tbogendoerfer/korg/linux/include/linux/pid.h:5, > from /local/tbogendoerfer/korg/linux/include/linux/sched.h:14, > from /local/tbogendoerfer/korg/linux/include/linux/utsname.h:6, > from /local/tbogendoerfer/korg/linux/init/version.c:17: > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h: In function ‘__raw_spin_trylock’: > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:90:3: error: implicit declaration of function ‘spin_acquire’ [-Werror=implicit-function-declaration] > spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); > ^~~~~~~~~~~~ > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:90:21: error: ‘raw_spinlock_t {aka struct raw_spinlock}’ has no member named ‘dep_map’ > spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); > ^~ > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h: In function ‘__raw_spin_lock_irqsave’: > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:110:20: error: ‘raw_spinlock_t {aka struct raw_spinlock}’ has no member named ‘dep_map’ > spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); > ^~ > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:111:2: error: implicit declaration of function ‘LOCK_CONTENDED’ [-Werror=implicit-function-declaration] > LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); > ^~~~~~~~~~~~~~ > [...] > > I've cut the compiler output. Removing the asm-generic doesn't show this > problem, but so far I fail to see the reason... Thanks for trying this. Do you have the kernel config file, I can try to reproduce on my local machine. And by the way, it could be fixed with below patch, not very sure. Earlier, Arnd suggested this to fix a similar case. From b3310e58c063b695ba7ab3966c57269f57f16585 Mon Sep 17 00:00:00 2001 From: Baoquan He <bhe@redhat.com> Date: Tue, 14 Mar 2023 08:53:15 +0800 Subject: [PATCH] mips: use wmb() instead to replace iobarrier_w() Content-type: text/plain Otherwise nested including of asm/io.h and asm/mmiowb.h will cause compiling error. Signed-off-by: Baoquan He <bhe@redhat.com> --- arch/mips/include/asm/mmiowb.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/mips/include/asm/mmiowb.h b/arch/mips/include/asm/mmiowb.h index a40824e3ef8e..dd206792abed 100644 --- a/arch/mips/include/asm/mmiowb.h +++ b/arch/mips/include/asm/mmiowb.h @@ -2,9 +2,7 @@ #ifndef _ASM_MMIOWB_H #define _ASM_MMIOWB_H -#include <asm/io.h> - -#define mmiowb() iobarrier_w() +#define mmiowb() wmb() #include <asm-generic/mmiowb.h>
On Tue, Mar 14, 2023 at 10:56:36AM +0800, Baoquan He wrote: > On 03/13/23 at 06:55pm, Thomas Bogendoerfer wrote: > ...... > > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:111:2: error: implicit declaration of function ‘LOCK_CONTENDED’ [-Werror=implicit-function-declaration] > > LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); > > ^~~~~~~~~~~~~~ > > GEN Makefile > > Checking missing-syscalls for N32 > > CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh > > Checking missing-syscalls for O32 > > CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh > > CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh > > CC init/version.o > > In file included from /local/tbogendoerfer/korg/linux/include/linux/spinlock.h:311:0, > > from /local/tbogendoerfer/korg/linux/include/linux/vmalloc.h:5, > > from /local/tbogendoerfer/korg/linux/include/asm-generic/io.h:994, > > from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/io.h:618, > > from /local/tbogendoerfer/korg/linux/include/linux/io.h:13, > > from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/mips-cps.h:11, > > from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp-ops.h:16, > > from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp.h:21, > > from /local/tbogendoerfer/korg/linux/include/linux/smp.h:113, > > from /local/tbogendoerfer/korg/linux/include/linux/lockdep.h:14, > > from /local/tbogendoerfer/korg/linux/include/linux/rcupdate.h:29, > > from /local/tbogendoerfer/korg/linux/include/linux/rculist.h:11, > > from /local/tbogendoerfer/korg/linux/include/linux/pid.h:5, > > from /local/tbogendoerfer/korg/linux/include/linux/sched.h:14, > > from /local/tbogendoerfer/korg/linux/include/linux/utsname.h:6, > > from /local/tbogendoerfer/korg/linux/init/version.c:17: > > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h: In function ‘__raw_spin_trylock’: > > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:90:3: error: implicit declaration of function ‘spin_acquire’ [-Werror=implicit-function-declaration] > > spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); > > ^~~~~~~~~~~~ > > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:90:21: error: ‘raw_spinlock_t {aka struct raw_spinlock}’ has no member named ‘dep_map’ > > spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); > > ^~ > > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h: In function ‘__raw_spin_lock_irqsave’: > > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:110:20: error: ‘raw_spinlock_t {aka struct raw_spinlock}’ has no member named ‘dep_map’ > > spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); > > ^~ > > /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:111:2: error: implicit declaration of function ‘LOCK_CONTENDED’ [-Werror=implicit-function-declaration] > > LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); > > ^~~~~~~~~~~~~~ > > [...] > > > > I've cut the compiler output. Removing the asm-generic doesn't show this > > problem, but so far I fail to see the reason... > > Thanks for trying this. > > Do you have the kernel config file, I can try to reproduce on my local > machine. And by the way, it could be fixed with below patch, not very > sure. Earlier, Arnd suggested this to fix a similar case. already tried it, but it doesn't fix the issue. I've attached the config. Thomas.
On 3/14/23 08:34, Thomas Bogendoerfer wrote: > On Tue, Mar 14, 2023 at 10:56:36AM +0800, Baoquan He wrote: >> On 03/13/23 at 06:55pm, Thomas Bogendoerfer wrote: >> ...... >>> /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:111:2: error: implicit declaration of function ‘LOCK_CONTENDED’ [-Werror=implicit-function-declaration] >>> LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); >>> ^~~~~~~~~~~~~~ >>> GEN Makefile >>> Checking missing-syscalls for N32 >>> CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh >>> Checking missing-syscalls for O32 >>> CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh >>> CALL /local/tbogendoerfer/korg/linux/scripts/checksyscalls.sh >>> CC init/version.o >>> In file included from /local/tbogendoerfer/korg/linux/include/linux/spinlock.h:311:0, >>> from /local/tbogendoerfer/korg/linux/include/linux/vmalloc.h:5, >>> from /local/tbogendoerfer/korg/linux/include/asm-generic/io.h:994, >>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/io.h:618, >>> from /local/tbogendoerfer/korg/linux/include/linux/io.h:13, >>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/mips-cps.h:11, >>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp-ops.h:16, >>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp.h:21, >>> from /local/tbogendoerfer/korg/linux/include/linux/smp.h:113, >>> from /local/tbogendoerfer/korg/linux/include/linux/lockdep.h:14, >>> from /local/tbogendoerfer/korg/linux/include/linux/rcupdate.h:29, >>> from /local/tbogendoerfer/korg/linux/include/linux/rculist.h:11, >>> from /local/tbogendoerfer/korg/linux/include/linux/pid.h:5, >>> from /local/tbogendoerfer/korg/linux/include/linux/sched.h:14, >>> from /local/tbogendoerfer/korg/linux/include/linux/utsname.h:6, >>> from /local/tbogendoerfer/korg/linux/init/version.c:17: >>> /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h: In function ‘__raw_spin_trylock’: >>> /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:90:3: error: implicit declaration of function ‘spin_acquire’ [-Werror=implicit-function-declaration] >>> spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); >>> ^~~~~~~~~~~~ >>> /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:90:21: error: ‘raw_spinlock_t {aka struct raw_spinlock}’ has no member named ‘dep_map’ >>> spin_acquire(&lock->dep_map, 0, 1, _RET_IP_); >>> ^~ >>> /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h: In function ‘__raw_spin_lock_irqsave’: >>> /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:110:20: error: ‘raw_spinlock_t {aka struct raw_spinlock}’ has no member named ‘dep_map’ >>> spin_acquire(&lock->dep_map, 0, 0, _RET_IP_); >>> ^~ >>> /local/tbogendoerfer/korg/linux/include/linux/spinlock_api_smp.h:111:2: error: implicit declaration of function ‘LOCK_CONTENDED’ [-Werror=implicit-function-declaration] >>> LOCK_CONTENDED(lock, do_raw_spin_trylock, do_raw_spin_lock); >>> ^~~~~~~~~~~~~~ >>> [...] >>> >>> I've cut the compiler output. Removing the asm-generic doesn't show this >>> problem, but so far I fail to see the reason... >> >> Thanks for trying this. >> >> Do you have the kernel config file, I can try to reproduce on my local >> machine. And by the way, it could be fixed with below patch, not very >> sure. Earlier, Arnd suggested this to fix a similar case. > > already tried it, but it doesn't fix the issue. I've attached the > config. I had attempted a similar approach before as Baoquan did, but met the same build issue as Thomas that was not immediately clear to me why it popped up. I would be curious to see how this can be resolved.
On Tue, Mar 14, 2023, at 17:31, Florian Fainelli wrote: > On 3/14/23 08:34, Thomas Bogendoerfer wrote: >> On Tue, Mar 14, 2023 at 10:56:36AM +0800, Baoquan He wrote: >>>> In file included from /local/tbogendoerfer/korg/linux/include/linux/spinlock.h:311:0, >>>> from /local/tbogendoerfer/korg/linux/include/linux/vmalloc.h:5, >>>> from /local/tbogendoerfer/korg/linux/include/asm-generic/io.h:994, >>>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/io.h:618, >>>> from /local/tbogendoerfer/korg/linux/include/linux/io.h:13, >>>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/mips-cps.h:11, >>>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp-ops.h:16, >>>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp.h:21, >>>> from /local/tbogendoerfer/korg/linux/include/linux/smp.h:113, >>>> from /local/tbogendoerfer/korg/linux/include/linux/lockdep.h:14, >>>> from /local/tbogendoerfer/korg/linux/include/linux/rcupdate.h:29, >>>> from /local/tbogendoerfer/korg/linux/include/linux/rculist.h:11, >>>> from /local/tbogendoerfer/korg/linux/include/linux/pid.h:5, >>>> from /local/tbogendoerfer/korg/linux/include/linux/sched.h:14, >>>> from /local/tbogendoerfer/korg/linux/include/linux/utsname.h:6, >>>> from /local/tbogendoerfer/korg/linux/init/version.c:17: >> >> already tried it, but it doesn't fix the issue. I've attached the >> config. > > I had attempted a similar approach before as Baoquan did, but met the > same build issue as Thomas that was not immediately clear to me why it > popped up. I would be curious to see how this can be resolved. I think this is the result of recursive header inclusion: spinlock.h includes lockdep.h, but its header guard is already there from the include chain. There is probably something in one of the mips asm/*.h headers that causes this recursion that is not present elsewhere. I think this should fix it, but is likely to cause another problem elsewhere: --- a/arch/mips/include/asm/smp-ops.h +++ b/arch/mips/include/asm/smp-ops.h @@ -13,8 +13,6 @@ #include <linux/errno.h> -#include <asm/mips-cps.h> - #ifdef CONFIG_SMP #include <linux/cpumask.h> Arnd
On 03/14/23 at 06:19pm, Arnd Bergmann wrote: > On Tue, Mar 14, 2023, at 17:31, Florian Fainelli wrote: > > On 3/14/23 08:34, Thomas Bogendoerfer wrote: > >> On Tue, Mar 14, 2023 at 10:56:36AM +0800, Baoquan He wrote: > >>>> In file included from /local/tbogendoerfer/korg/linux/include/linux/spinlock.h:311:0, > >>>> from /local/tbogendoerfer/korg/linux/include/linux/vmalloc.h:5, > >>>> from /local/tbogendoerfer/korg/linux/include/asm-generic/io.h:994, > >>>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/io.h:618, > >>>> from /local/tbogendoerfer/korg/linux/include/linux/io.h:13, > >>>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/mips-cps.h:11, > >>>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp-ops.h:16, > >>>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp.h:21, > >>>> from /local/tbogendoerfer/korg/linux/include/linux/smp.h:113, > >>>> from /local/tbogendoerfer/korg/linux/include/linux/lockdep.h:14, > >>>> from /local/tbogendoerfer/korg/linux/include/linux/rcupdate.h:29, > >>>> from /local/tbogendoerfer/korg/linux/include/linux/rculist.h:11, > >>>> from /local/tbogendoerfer/korg/linux/include/linux/pid.h:5, > >>>> from /local/tbogendoerfer/korg/linux/include/linux/sched.h:14, > >>>> from /local/tbogendoerfer/korg/linux/include/linux/utsname.h:6, > >>>> from /local/tbogendoerfer/korg/linux/init/version.c:17: > >> > >> already tried it, but it doesn't fix the issue. I've attached the > >> config. > > > > I had attempted a similar approach before as Baoquan did, but met the > > same build issue as Thomas that was not immediately clear to me why it > > popped up. I would be curious to see how this can be resolved. > > I think this is the result of recursive header inclusion: > spinlock.h includes lockdep.h, but its header guard is already > there from the include chain. > > There is probably something in one of the mips asm/*.h headers that > causes this recursion that is not present elsewhere. > > I think this should fix it, but is likely to cause another problem elsewhere: > > --- a/arch/mips/include/asm/smp-ops.h > +++ b/arch/mips/include/asm/smp-ops.h > @@ -13,8 +13,6 @@ > > #include <linux/errno.h> > > -#include <asm/mips-cps.h> > - > #ifdef CONFIG_SMP > > #include <linux/cpumask.h> Will meet below compiling error after appllying above patch. Adding asm/mips-cps.h including in arch/mips/kernel/setup.c will fix it as below. arch/mips/kernel/setup.c: In function ‘setup_arch’: arch/mips/kernel/setup.c:781:9: error: implicit declaration of function ‘mips_cm_probe’ [-Werror=implicit-function-declaration] 781 | mips_cm_probe(); | ^~~~~~~~~~~~~ cc1: all warnings being treated as errors diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index f1c88f8a1dc5..e8c4020ef367 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c @@ -43,6 +43,7 @@ #include <asm/smp-ops.h> #include <asm/prom.h> #include <asm/fw/fw.h> +#include <asm/mips-cps.h> #ifdef CONFIG_MIPS_ELF_APPENDED_DTB char __section(".appended_dtb") __appended_dtb[0x100000];
On Wed, Mar 15, 2023 at 08:49:53AM +0800, Baoquan He wrote: > On 03/14/23 at 06:19pm, Arnd Bergmann wrote: > > On Tue, Mar 14, 2023, at 17:31, Florian Fainelli wrote: > > > On 3/14/23 08:34, Thomas Bogendoerfer wrote: > > >> On Tue, Mar 14, 2023 at 10:56:36AM +0800, Baoquan He wrote: > > >>>> In file included from /local/tbogendoerfer/korg/linux/include/linux/spinlock.h:311:0, > > >>>> from /local/tbogendoerfer/korg/linux/include/linux/vmalloc.h:5, > > >>>> from /local/tbogendoerfer/korg/linux/include/asm-generic/io.h:994, > > >>>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/io.h:618, > > >>>> from /local/tbogendoerfer/korg/linux/include/linux/io.h:13, > > >>>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/mips-cps.h:11, > > >>>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp-ops.h:16, > > >>>> from /local/tbogendoerfer/korg/linux/arch/mips/include/asm/smp.h:21, > > >>>> from /local/tbogendoerfer/korg/linux/include/linux/smp.h:113, > > >>>> from /local/tbogendoerfer/korg/linux/include/linux/lockdep.h:14, > > >>>> from /local/tbogendoerfer/korg/linux/include/linux/rcupdate.h:29, > > >>>> from /local/tbogendoerfer/korg/linux/include/linux/rculist.h:11, > > >>>> from /local/tbogendoerfer/korg/linux/include/linux/pid.h:5, > > >>>> from /local/tbogendoerfer/korg/linux/include/linux/sched.h:14, > > >>>> from /local/tbogendoerfer/korg/linux/include/linux/utsname.h:6, > > >>>> from /local/tbogendoerfer/korg/linux/init/version.c:17: > > >> > > >> already tried it, but it doesn't fix the issue. I've attached the > > >> config. > > > > > > I had attempted a similar approach before as Baoquan did, but met the > > > same build issue as Thomas that was not immediately clear to me why it > > > popped up. I would be curious to see how this can be resolved. > > > > I think this is the result of recursive header inclusion: > > spinlock.h includes lockdep.h, but its header guard is already > > there from the include chain. > > > > There is probably something in one of the mips asm/*.h headers that > > causes this recursion that is not present elsewhere. > > > > I think this should fix it, but is likely to cause another problem elsewhere: > > > > --- a/arch/mips/include/asm/smp-ops.h > > +++ b/arch/mips/include/asm/smp-ops.h > > @@ -13,8 +13,6 @@ > > > > #include <linux/errno.h> > > > > -#include <asm/mips-cps.h> > > - > > #ifdef CONFIG_SMP > > > > #include <linux/cpumask.h> > > Will meet below compiling error after appllying above patch. Adding > asm/mips-cps.h including in arch/mips/kernel/setup.c will fix it as below. > > arch/mips/kernel/setup.c: In function ‘setup_arch’: > arch/mips/kernel/setup.c:781:9: error: implicit declaration of function ‘mips_cm_probe’ [-Werror=implicit-function-declaration] > 781 | mips_cm_probe(); > | ^~~~~~~~~~~~~ > cc1: all warnings being treated as errors > > > diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c > index f1c88f8a1dc5..e8c4020ef367 100644 > --- a/arch/mips/kernel/setup.c > +++ b/arch/mips/kernel/setup.c > @@ -43,6 +43,7 @@ > #include <asm/smp-ops.h> > #include <asm/prom.h> > #include <asm/fw/fw.h> > +#include <asm/mips-cps.h> > > #ifdef CONFIG_MIPS_ELF_APPENDED_DTB > char __section(".appended_dtb") __appended_dtb[0x100000]; with diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c index d85cbf84e41c..973faea61cad 100644 --- a/arch/mips/pci/pci-ip27.c +++ b/arch/mips/pci/pci-ip27.c @@ -7,6 +7,9 @@ * Copyright (C) 1999, 2000, 04 Ralf Baechle (ralf@linux-mips.org) * Copyright (C) 1999, 2000 Silicon Graphics, Inc. */ + +#include <linux/io.h> + #include <asm/sn/addrs.h> #include <asm/sn/types.h> #include <asm/sn/klconfig.h> on top, all my builds are ok. But my malta qemu setup crashes: Unhandled kernel unaligned access[#1]: CPU: 0 PID: 1 Comm: systemd Not tainted 6.3.0-rc1-00022-gff6bffcfbf9e #290 $ 0 : 00000000 00000001 81000640 00000001 $ 4 : 80bd8641 00000001 00000000 00000000 $ 8 : 00000001 00000001 77c5abae ffffffff $12 : 00000000 7b3eeedb 820f7380 bdd54e39 $16 : 80bd8641 820fbdc4 81000640 80ad0000 $20 : 00000008 80ad0000 80ad0000 80ad0000 $24 : 00000000 f592e7d4 $28 : 820f8000 820fbd48 80c20000 801c44f4 Hi : 001f93e2 Lo : 18073cf3 epc : 80902188 _raw_spin_lock+0xc/0x54 ra : 801c44f4 add_timer_on+0x94/0x1b0 Status: 1400a402 KERNEL EXL Cause : 10800010 (ExcCode 04) BadVA : 80bd8641 PrId : 00019300 (MIPS 24Kc) Modules linked in: Process systemd (pid: 1, threadinfo=(ptrval), task=(ptrval), tls=76f2b6e0) Stack : 80bd8641 820fbdc4 80ad0000 80ad0000 00000008 80ad0000 80ad0000 801c44f4 80ad0000 80ad0000 820f8000 820fbd98 00000001 f01a83f8 00000008 820fbdc0 80ad0000 820fbdc4 80ad0000 808f4f20 00000001 822f7640 822f7940 f01a83f8 00000000 820fbec0 00000001 00000001 00000001 77d3fafc 3e01e433 00000122 00000000 ffff8c77 808f513c 0dc40000 00000001 00000001 00000001 82a1f900 ... Call Trace: [<80902188>] _raw_spin_lock+0xc/0x54 [<801c44f4>] add_timer_on+0x94/0x1b0 [<808f4f20>] try_to_generate_entropy+0x1e8/0x270 [<805c7408>] urandom_read_iter+0x10c/0x114 [<802d77f8>] vfs_read+0x21c/0x2bc [<802d8284>] ksys_read+0x7c/0x118 [<8011b130>] syscall_common+0x34/0x58 Code: 27bdffe0 afbf001c 24030001 <c0850000> 14a00005 00000000 00600825 e0810000 1020fffa ---[ end trace 0000000000000000 ]--- I guess this has something to do with the removal of #include <asm/mips-cps.h> Thomas.
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 <asm-generic/io.h> + #endif /* _ASM_IO_H */