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