From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mauro Carvalho Chehab Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary Date: Tue, 28 Dec 2021 17:32:02 +0100 Message-ID: <20211228173202.678baa44@coco.lan> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640709137; bh=wYaH3iu50Xg/A/DNjyHFOWIgZ4rByTFlvgaE/FMZWqY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BTzyk4t+6+nRs9+zo0NSJy02+zZ1BbNUT8+XJkgAXThbIqJ8Tu8Bp03GHCGKlrzYX f6mxa+4pitBIl4IybQMSKiUDklqv+EWiC5aYtEZ6X8W5ej/Y8IazWuQESnlWIxcuv8 qpU3CbEDSyN9MmSRXbz0D4xklNr1SXs2T+TD8ORlrOWK73AvxU+cJQKO+CcdLaW79G ATgeIIpXvKMfQoRIkEcfC8ZFCuCdHf6v7cpx9bOyNNQeNgeuyk4t75tVGNPued/kzl l93VJjvTGGYCbrQFgpNex301S0U5MY1BOFyW0fzdInsg4whSwmaK2ya34ydGPe6YZY 2nZg+WlyMxMSA== In-Reply-To: <20211227164317.4146918-3-schnelle@linux.ibm.com> List-ID: Content-Type: text/plain; charset="us-ascii" To: Niklas Schnelle Cc: Arnd Bergmann , Bjorn Helgaas , John Garry , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Dinh Nguyen , Chris Zankel , Karol Gugala , Jeff Dike , Yoshinori Sato , Brian Cain , Heiko Carstens , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta Em Mon, 27 Dec 2021 17:42:47 +0100 Niklas Schnelle escreveu: > We introduce a new HAS_IOPORT Kconfig option to gate support for > I/O port access. In a future patch HAS_IOPORT=n will disable compilation > of the I/O accessor functions inb()/outb() and friends on architectures > which can not meaningfully support legacy I/O spaces. On these platforms > inb()/outb() etc are currently just stubs in asm-generic/io.h which when > called will cause a NULL pointer access which some compilers actually > detect and warn about. > > The dependencies on HAS_IOPORT in drivers as well as ifdefs for > HAS_IOPORT specific sections will be added in subsequent patches on > a per subsystem basis. Then a final patch will ifdef the I/O access > functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT > into a compile-time warning. > > Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ > Co-developed-by: Arnd Bergmann > Signed-off-by: Arnd Bergmann > Signed-off-by: Niklas Schnelle ... > @@ -486,6 +487,9 @@ config HAS_IOMEM > depends on !NO_IOMEM > default y > > +config HAS_IOPORT > + def_bool ISA || LEGACY_PCI > + That doesn't sound right. The only dependency for LEGACY_PCI is PCI. If one selects LEGACY_PCI on an architecture that doesn't support it, this will cause problems. Instead, HAS_IOPORT should be selected at architecture level, and the dependency here should be just the opposite: LEGACY_API should depends on HAS_IOPORT. Thanks, Mauro From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8FBAAC4332F for ; Tue, 28 Dec 2021 16:32:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235636AbhL1QcV (ORCPT ); Tue, 28 Dec 2021 11:32:21 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:40078 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233260AbhL1QcV (ORCPT ); Tue, 28 Dec 2021 11:32:21 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id CA7E0B81648; Tue, 28 Dec 2021 16:32:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C686CC36AE8; Tue, 28 Dec 2021 16:32:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640709137; bh=wYaH3iu50Xg/A/DNjyHFOWIgZ4rByTFlvgaE/FMZWqY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BTzyk4t+6+nRs9+zo0NSJy02+zZ1BbNUT8+XJkgAXThbIqJ8Tu8Bp03GHCGKlrzYX f6mxa+4pitBIl4IybQMSKiUDklqv+EWiC5aYtEZ6X8W5ej/Y8IazWuQESnlWIxcuv8 qpU3CbEDSyN9MmSRXbz0D4xklNr1SXs2T+TD8ORlrOWK73AvxU+cJQKO+CcdLaW79G ATgeIIpXvKMfQoRIkEcfC8ZFCuCdHf6v7cpx9bOyNNQeNgeuyk4t75tVGNPued/kzl l93VJjvTGGYCbrQFgpNex301S0U5MY1BOFyW0fzdInsg4whSwmaK2ya34ydGPe6YZY 2nZg+WlyMxMSA== Date: Tue, 28 Dec 2021 17:32:02 +0100 From: Mauro Carvalho Chehab To: Niklas Schnelle Cc: Arnd Bergmann , Bjorn Helgaas , John Garry , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Dinh Nguyen , Chris Zankel , Karol Gugala , Jeff Dike , Yoshinori Sato , Brian Cain , Heiko Carstens , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Michal Simek , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, linux-s390@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-ia64@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: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary Message-ID: <20211228173202.678baa44@coco.lan> In-Reply-To: <20211227164317.4146918-3-schnelle@linux.ibm.com> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-arch@vger.kernel.org Em Mon, 27 Dec 2021 17:42:47 +0100 Niklas Schnelle escreveu: > We introduce a new HAS_IOPORT Kconfig option to gate support for > I/O port access. In a future patch HAS_IOPORT=n will disable compilation > of the I/O accessor functions inb()/outb() and friends on architectures > which can not meaningfully support legacy I/O spaces. On these platforms > inb()/outb() etc are currently just stubs in asm-generic/io.h which when > called will cause a NULL pointer access which some compilers actually > detect and warn about. > > The dependencies on HAS_IOPORT in drivers as well as ifdefs for > HAS_IOPORT specific sections will be added in subsequent patches on > a per subsystem basis. Then a final patch will ifdef the I/O access > functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT > into a compile-time warning. > > Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ > Co-developed-by: Arnd Bergmann > Signed-off-by: Arnd Bergmann > Signed-off-by: Niklas Schnelle ... > @@ -486,6 +487,9 @@ config HAS_IOMEM > depends on !NO_IOMEM > default y > > +config HAS_IOPORT > + def_bool ISA || LEGACY_PCI > + That doesn't sound right. The only dependency for LEGACY_PCI is PCI. If one selects LEGACY_PCI on an architecture that doesn't support it, this will cause problems. Instead, HAS_IOPORT should be selected at architecture level, and the dependency here should be just the opposite: LEGACY_API should depends on HAS_IOPORT. Thanks, Mauro From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mauro Carvalho Chehab Date: Tue, 28 Dec 2021 16:32:02 +0000 Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary Message-Id: <20211228173202.678baa44@coco.lan> List-Id: References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> In-Reply-To: <20211227164317.4146918-3-schnelle@linux.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Niklas Schnelle Cc: Arnd Bergmann , Bjorn Helgaas , John Garry , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Dinh Nguyen , Chris Zankel , Karol Gugala , Jeff Dike , Yoshinori Sato , Brian Cain , Heiko Carstens , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Michal Simek , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, linux-s390@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-ia64@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 Em Mon, 27 Dec 2021 17:42:47 +0100 Niklas Schnelle escreveu: > We introduce a new HAS_IOPORT Kconfig option to gate support for > I/O port access. In a future patch HAS_IOPORT=n will disable compilation > of the I/O accessor functions inb()/outb() and friends on architectures > which can not meaningfully support legacy I/O spaces. On these platforms > inb()/outb() etc are currently just stubs in asm-generic/io.h which when > called will cause a NULL pointer access which some compilers actually > detect and warn about. > > The dependencies on HAS_IOPORT in drivers as well as ifdefs for > HAS_IOPORT specific sections will be added in subsequent patches on > a per subsystem basis. Then a final patch will ifdef the I/O access > functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT > into a compile-time warning. > > Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ > Co-developed-by: Arnd Bergmann > Signed-off-by: Arnd Bergmann > Signed-off-by: Niklas Schnelle ... > @@ -486,6 +487,9 @@ config HAS_IOMEM > depends on !NO_IOMEM > default y > > +config HAS_IOPORT > + def_bool ISA || LEGACY_PCI > + That doesn't sound right. The only dependency for LEGACY_PCI is PCI. If one selects LEGACY_PCI on an architecture that doesn't support it, this will cause problems. Instead, HAS_IOPORT should be selected at architecture level, and the dependency here should be just the opposite: LEGACY_API should depends on HAS_IOPORT. Thanks, Mauro From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 83621C433F5 for ; Tue, 28 Dec 2021 16:32:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=7K8EX1EOGePsUn8VDbitUWvuAbFRPBsu8NRYcpFiLiM=; b=y8Kg638NkknAcZ o+FfqK1iUkYRcW4GgBMOdwkFgx6m/RFSUSEuvUKtjgyN9olAyaL3SUBEZ03y61TUo0HMsjtUvl4Ci T0TT9LY6V+lZuvUgmDwhYp/tsYZZvAXcCu568wKLE/FFFfB3/RbVg8RXANJp8UHjmzreg3aoKGMW4 1Q+rs/+epucv3RIpsEB445ZD5PB+LVPh2bJIEo0xRbLewNJzBPliPDQyhAJlpzSSgVBv9eFxRxa+c D+WFet7Gjl19VbDIhmfv8YELkIP5npXAo+r2cAPQyCs04Tmnomn2as81ff0P6MKH42yAYJeSV1EK9 SHsu5f2b3fM5c5FxXVYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2FOf-001WjO-LF; Tue, 28 Dec 2021 16:32:21 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2FOc-001Wi4-Jq; Tue, 28 Dec 2021 16:32:20 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 10330612B1; Tue, 28 Dec 2021 16:32:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C686CC36AE8; Tue, 28 Dec 2021 16:32:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640709137; bh=wYaH3iu50Xg/A/DNjyHFOWIgZ4rByTFlvgaE/FMZWqY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BTzyk4t+6+nRs9+zo0NSJy02+zZ1BbNUT8+XJkgAXThbIqJ8Tu8Bp03GHCGKlrzYX f6mxa+4pitBIl4IybQMSKiUDklqv+EWiC5aYtEZ6X8W5ej/Y8IazWuQESnlWIxcuv8 qpU3CbEDSyN9MmSRXbz0D4xklNr1SXs2T+TD8ORlrOWK73AvxU+cJQKO+CcdLaW79G ATgeIIpXvKMfQoRIkEcfC8ZFCuCdHf6v7cpx9bOyNNQeNgeuyk4t75tVGNPued/kzl l93VJjvTGGYCbrQFgpNex301S0U5MY1BOFyW0fzdInsg4whSwmaK2ya34ydGPe6YZY 2nZg+WlyMxMSA== Date: Tue, 28 Dec 2021 17:32:02 +0100 From: Mauro Carvalho Chehab To: Niklas Schnelle Cc: Arnd Bergmann , Bjorn Helgaas , John Garry , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Dinh Nguyen , Chris Zankel , Karol Gugala , Jeff Dike , Yoshinori Sato , Brian Cain , Heiko Carstens , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Michal Simek , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, linux-s390@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-ia64@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: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary Message-ID: <20211228173202.678baa44@coco.lan> In-Reply-To: <20211227164317.4146918-3-schnelle@linux.ibm.com> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211228_083218_766957_A1334D64 X-CRM114-Status: GOOD ( 17.35 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org Em Mon, 27 Dec 2021 17:42:47 +0100 Niklas Schnelle escreveu: > We introduce a new HAS_IOPORT Kconfig option to gate support for > I/O port access. In a future patch HAS_IOPORT=n will disable compilation > of the I/O accessor functions inb()/outb() and friends on architectures > which can not meaningfully support legacy I/O spaces. On these platforms > inb()/outb() etc are currently just stubs in asm-generic/io.h which when > called will cause a NULL pointer access which some compilers actually > detect and warn about. > > The dependencies on HAS_IOPORT in drivers as well as ifdefs for > HAS_IOPORT specific sections will be added in subsequent patches on > a per subsystem basis. Then a final patch will ifdef the I/O access > functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT > into a compile-time warning. > > Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ > Co-developed-by: Arnd Bergmann > Signed-off-by: Arnd Bergmann > Signed-off-by: Niklas Schnelle ... > @@ -486,6 +487,9 @@ config HAS_IOMEM > depends on !NO_IOMEM > default y > > +config HAS_IOPORT > + def_bool ISA || LEGACY_PCI > + That doesn't sound right. The only dependency for LEGACY_PCI is PCI. If one selects LEGACY_PCI on an architecture that doesn't support it, this will cause problems. Instead, HAS_IOPORT should be selected at architecture level, and the dependency here should be just the opposite: LEGACY_API should depends on HAS_IOPORT. Thanks, Mauro _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv From mboxrd@z Thu Jan 1 00:00:00 1970 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0BB8CC433FE for ; Tue, 28 Dec 2021 16:32:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MLvkXvJLWfsj4JQJQXZ0aDiymxSUtGf979ZAFy7+2II=; b=DS8xq9I1tKIWYN Ni8AHPRY3qtLg6LK8/iYmqdz5rzIrn/9Whjzk1PyyNiH4ATmBFHtxAFh9RTlMsjScYgoWw0LNMjTC a2zz1Su5rab1cr2V1nV8r3jTlzktof9X06KVa+aNTMnVqPpZud4tAjHU76N5GaY2j4jj7f0yfggmc kVmhpI4uyG7Bwl9DIW7Tlh5bkJyo0EAbTlcbuIDDrrUzSBtIkMhB7zqMO1UkKv+RajhRbSkXBLFM9 pZGSccktN9mDupEXA6GMLx0VioXY/dgc1sjF0ogux+J4WZHPFdfM0eKpFEHUk/fY0GNOFZ12Cw+Bm 0yUj+MDU1WbQgtz/ucqg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2FOh-001WkQ-KK; Tue, 28 Dec 2021 16:32:23 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2FOc-001Wi4-Jq; Tue, 28 Dec 2021 16:32:20 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 10330612B1; Tue, 28 Dec 2021 16:32:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C686CC36AE8; Tue, 28 Dec 2021 16:32:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640709137; bh=wYaH3iu50Xg/A/DNjyHFOWIgZ4rByTFlvgaE/FMZWqY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BTzyk4t+6+nRs9+zo0NSJy02+zZ1BbNUT8+XJkgAXThbIqJ8Tu8Bp03GHCGKlrzYX f6mxa+4pitBIl4IybQMSKiUDklqv+EWiC5aYtEZ6X8W5ej/Y8IazWuQESnlWIxcuv8 qpU3CbEDSyN9MmSRXbz0D4xklNr1SXs2T+TD8ORlrOWK73AvxU+cJQKO+CcdLaW79G ATgeIIpXvKMfQoRIkEcfC8ZFCuCdHf6v7cpx9bOyNNQeNgeuyk4t75tVGNPued/kzl l93VJjvTGGYCbrQFgpNex301S0U5MY1BOFyW0fzdInsg4whSwmaK2ya34ydGPe6YZY 2nZg+WlyMxMSA== Date: Tue, 28 Dec 2021 17:32:02 +0100 From: Mauro Carvalho Chehab To: Niklas Schnelle Cc: Arnd Bergmann , Bjorn Helgaas , John Garry , Nick Hu , Greentime Hu , Vincent Chen , Paul Walmsley , Palmer Dabbelt , Albert Ou , Guo Ren , Dinh Nguyen , Chris Zankel , Karol Gugala , Jeff Dike , Yoshinori Sato , Brian Cain , Heiko Carstens , Richard Henderson , Ivan Kokshaysky , Matt Turner , Vineet Gupta , Russell King , Catalin Marinas , Will Deacon , Geert Uytterhoeven , Michal Simek , Thomas Bogendoerfer , "James E.J. Bottomley" , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Rich Felker , "David S. Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, linux-pci@vger.kernel.org, linux-riscv@lists.infradead.org, linux-csky@vger.kernel.org, linux-xtensa@linux-xtensa.org, openrisc@lists.librecores.org, linux-s390@vger.kernel.org, linux-alpha@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-ia64@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: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary Message-ID: <20211228173202.678baa44@coco.lan> In-Reply-To: <20211227164317.4146918-3-schnelle@linux.ibm.com> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211228_083218_766957_A1334D64 X-CRM114-Status: GOOD ( 17.35 ) X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+linux-snps-arc=archiver.kernel.org@lists.infradead.org Em Mon, 27 Dec 2021 17:42:47 +0100 Niklas Schnelle escreveu: > We introduce a new HAS_IOPORT Kconfig option to gate support for > I/O port access. In a future patch HAS_IOPORT=n will disable compilation > of the I/O accessor functions inb()/outb() and friends on architectures > which can not meaningfully support legacy I/O spaces. On these platforms > inb()/outb() etc are currently just stubs in asm-generic/io.h which when > called will cause a NULL pointer access which some compilers actually > detect and warn about. > > The dependencies on HAS_IOPORT in drivers as well as ifdefs for > HAS_IOPORT specific sections will be added in subsequent patches on > a per subsystem basis. Then a final patch will ifdef the I/O access > functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT > into a compile-time warning. > > Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ > Co-developed-by: Arnd Bergmann > Signed-off-by: Arnd Bergmann > Signed-off-by: Niklas Schnelle ... > @@ -486,6 +487,9 @@ config HAS_IOMEM > depends on !NO_IOMEM > default y > > +config HAS_IOPORT > + def_bool ISA || LEGACY_PCI > + That doesn't sound right. The only dependency for LEGACY_PCI is PCI. If one selects LEGACY_PCI on an architecture that doesn't support it, this will cause problems. Instead, HAS_IOPORT should be selected at architecture level, and the dependency here should be just the opposite: LEGACY_API should depends on HAS_IOPORT. Thanks, Mauro _______________________________________________ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mauro Carvalho Chehab Date: Tue, 28 Dec 2021 17:32:02 +0100 Subject: [OpenRISC] [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary In-Reply-To: <20211227164317.4146918-3-schnelle@linux.ibm.com> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> Message-ID: <20211228173202.678baa44@coco.lan> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org Em Mon, 27 Dec 2021 17:42:47 +0100 Niklas Schnelle escreveu: > We introduce a new HAS_IOPORT Kconfig option to gate support for > I/O port access. In a future patch HAS_IOPORT=n will disable compilation > of the I/O accessor functions inb()/outb() and friends on architectures > which can not meaningfully support legacy I/O spaces. On these platforms > inb()/outb() etc are currently just stubs in asm-generic/io.h which when > called will cause a NULL pointer access which some compilers actually > detect and warn about. > > The dependencies on HAS_IOPORT in drivers as well as ifdefs for > HAS_IOPORT specific sections will be added in subsequent patches on > a per subsystem basis. Then a final patch will ifdef the I/O access > functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT > into a compile-time warning. > > Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g at mail.gmail.com/ > Co-developed-by: Arnd Bergmann > Signed-off-by: Arnd Bergmann > Signed-off-by: Niklas Schnelle ... > @@ -486,6 +487,9 @@ config HAS_IOMEM > depends on !NO_IOMEM > default y > > +config HAS_IOPORT > + def_bool ISA || LEGACY_PCI > + That doesn't sound right. The only dependency for LEGACY_PCI is PCI. If one selects LEGACY_PCI on an architecture that doesn't support it, this will cause problems. Instead, HAS_IOPORT should be selected at architecture level, and the dependency here should be just the opposite: LEGACY_API should depends on HAS_IOPORT. Thanks, Mauro From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DC203C433F5 for ; Thu, 30 Dec 2021 07:59:58 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4JPgfj4Cxmz3cY2 for ; Thu, 30 Dec 2021 18:59:57 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=BTzyk4t+; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=mchehab@kernel.org; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=BTzyk4t+; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4JNg6r2Y1hz2yPp for ; Wed, 29 Dec 2021 03:32:20 +1100 (AEDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 10330612B1; Tue, 28 Dec 2021 16:32:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C686CC36AE8; Tue, 28 Dec 2021 16:32:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640709137; bh=wYaH3iu50Xg/A/DNjyHFOWIgZ4rByTFlvgaE/FMZWqY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=BTzyk4t+6+nRs9+zo0NSJy02+zZ1BbNUT8+XJkgAXThbIqJ8Tu8Bp03GHCGKlrzYX f6mxa+4pitBIl4IybQMSKiUDklqv+EWiC5aYtEZ6X8W5ej/Y8IazWuQESnlWIxcuv8 qpU3CbEDSyN9MmSRXbz0D4xklNr1SXs2T+TD8ORlrOWK73AvxU+cJQKO+CcdLaW79G ATgeIIpXvKMfQoRIkEcfC8ZFCuCdHf6v7cpx9bOyNNQeNgeuyk4t75tVGNPued/kzl l93VJjvTGGYCbrQFgpNex301S0U5MY1BOFyW0fzdInsg4whSwmaK2ya34ydGPe6YZY 2nZg+WlyMxMSA== Date: Tue, 28 Dec 2021 17:32:02 +0100 From: Mauro Carvalho Chehab To: Niklas Schnelle Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary Message-ID: <20211228173202.678baa44@coco.lan> In-Reply-To: <20211227164317.4146918-3-schnelle@linux.ibm.com> References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Thu, 30 Dec 2021 18:58:16 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rich Felker , linux-sh@vger.kernel.org, Catalin Marinas , Dave Hansen , linux-pci@vger.kernel.org, linux-mips@vger.kernel.org, "James E.J. Bottomley" , sparclinux@vger.kernel.org, Guo Ren , "H. Peter Anvin" , Borislav Petkov , linux-ia64@vger.kernel.org, linux-riscv@lists.infradead.org, Vincent Chen , Will Deacon , Karol Gugala , linux-arch@vger.kernel.org, linux-s390@vger.kernel.org, Yoshinori Sato , Helge Deller , x86@kernel.org, Russell King , linux-csky@vger.kernel.org, Ingo Molnar , Geert Uytterhoeven , linux-parisc@vger.kernel.org, Vineet Gupta , Matt Turner , linux-snps-arc@lists.infradead.org, Heiko Carstens , linux-xtensa@linux-xtensa.org, Albert Ou , Chris Zankel , Jeff Dike , John Garry , linux-m68k@lists.linux-m68k.org, openrisc@lists.librecores.org, Ivan Kokshaysky , Greentime Hu , Paul Walmsley , Bjorn Helgaas , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, Richard Henderson , Arnd Bergmann , Michal Simek , Thomas Bogendoerfer , Brian Cain , Nick Hu , linux-kernel@vger.kernel.org, Dinh Nguyen , Palmer Dabbelt , linux-alpha@vger.kernel.org, Paul Mackerras , linuxppc-dev@lists.ozlabs.org, "David S. Miller" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Em Mon, 27 Dec 2021 17:42:47 +0100 Niklas Schnelle escreveu: > We introduce a new HAS_IOPORT Kconfig option to gate support for > I/O port access. In a future patch HAS_IOPORT=n will disable compilation > of the I/O accessor functions inb()/outb() and friends on architectures > which can not meaningfully support legacy I/O spaces. On these platforms > inb()/outb() etc are currently just stubs in asm-generic/io.h which when > called will cause a NULL pointer access which some compilers actually > detect and warn about. > > The dependencies on HAS_IOPORT in drivers as well as ifdefs for > HAS_IOPORT specific sections will be added in subsequent patches on > a per subsystem basis. Then a final patch will ifdef the I/O access > functions on HAS_IOPORT thus turning any use not gated by HAS_IOPORT > into a compile-time warning. > > Link: https://lore.kernel.org/lkml/CAHk-=wg80je=K7madF4e7WrRNp37e3qh6y10Svhdc7O8SZ_-8g@mail.gmail.com/ > Co-developed-by: Arnd Bergmann > Signed-off-by: Arnd Bergmann > Signed-off-by: Niklas Schnelle ... > @@ -486,6 +487,9 @@ config HAS_IOMEM > depends on !NO_IOMEM > default y > > +config HAS_IOPORT > + def_bool ISA || LEGACY_PCI > + That doesn't sound right. The only dependency for LEGACY_PCI is PCI. If one selects LEGACY_PCI on an architecture that doesn't support it, this will cause problems. Instead, HAS_IOPORT should be selected at architecture level, and the dependency here should be just the opposite: LEGACY_API should depends on HAS_IOPORT. Thanks, Mauro