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 0B798C4167B for ; Wed, 29 Dec 2021 03:41:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233992AbhL2Dlp (ORCPT ); Tue, 28 Dec 2021 22:41:45 -0500 Received: from ams.source.kernel.org ([145.40.68.75]:34734 "EHLO ams.source.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233725AbhL2Dln (ORCPT ); Tue, 28 Dec 2021 22:41:43 -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 64B43B817AB; Wed, 29 Dec 2021 03:41:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BA1FC36AF2; Wed, 29 Dec 2021 03:41:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640749300; bh=sMe3q8ad98okMs4HLXxIEZG5eWgoWBzrycggRgzNn0g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gfBUGGZtKlSdchISLRCbgoh5ApvOms88vBNDBueg3GSAqIXPSkyv3hT3+JLM3V8rd NBXbvcDdAfWC4ZFlxNGOThtvDBg9TpHafmYp6AoKHdo7tXLFlhXn/lylE8k/3yGTpP qaq0Iy+2+aSp302rKXO4x7uVkeduQCA9T79BgtkTt8BYVlCGkm7lz25aZ+zHWTEd0S 9pUWnmx3E/895Wpun2xbxI2jymz5JySeYBwqar7GOpedMrFMwNkqar44IVWO2AO8sP JiT1Dd1gOzEi7FZfU/lHPGKEXgT7N7xI/S78pUQVJ5QyKVMrZUQVQPCKosaR34UMGK rebkE+b3YsYqw== Received: by mail-wm1-f50.google.com with SMTP id g132so12789352wmg.2; Tue, 28 Dec 2021 19:41:40 -0800 (PST) X-Gm-Message-State: AOAM532T8c2HGy6epaz094iKuhVcj1hQ9WeTPLevmuDbcKD+iDwQpZ53 bEstIlkuSlWny1luVuugVfS8iYNL/sFTrCvmOP4= X-Google-Smtp-Source: ABdhPJwExVf1S5yWbdFaQXvSS7m+9fv3xxH0eSVAhqrz/dUiLqmyF5p5xrdPthuPvZdKvgQOvhEXVEuNpJp0LGzgDhQ= X-Received: by 2002:a1c:7418:: with SMTP id p24mr20244545wmc.82.1640749287841; Tue, 28 Dec 2021 19:41:27 -0800 (PST) MIME-Version: 1.0 References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> In-Reply-To: From: Arnd Bergmann Date: Tue, 28 Dec 2021 22:41:18 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary To: Michael Schmitz Cc: Geert Uytterhoeven , Niklas Schnelle , 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 , 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, Greg Ungerer Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: > Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: > > On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: > >> 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 > > > > Thanks for your patch! > > > >> --- a/arch/m68k/Kconfig > >> +++ b/arch/m68k/Kconfig > >> @@ -16,6 +16,7 @@ config M68K > >> select GENERIC_CPU_DEVICES > >> select GENERIC_IOMAP > >> select GENERIC_IRQ_SHOW > >> + select HAS_IOPORT > >> select HAVE_AOUT if MMU > >> select HAVE_ASM_MODVERSIONS > >> select HAVE_DEBUG_BUGVERBOSE > > > > This looks way too broad to me: most m68k platform do not have I/O > > port access support. > > > > My gut feeling says: > > > > select HAS_IOPORT if PCI || ISA > > > > but that might miss some intricate details... > > In particular, this misses the Atari ROM port ISA adapter case - > > select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA > > might do instead. Right, makes sense. I had suggested to go the easy way and assume that each architecture would select HAS_IOPORT if any configuration supports it, but it looks like for m68k there is a clearly defined set of platforms that do. Note that for the platforms that don't set any of the three symbols, the fallback makes inb() an alias for readb() with a different argument type, so there may be m68k specific drivers that rely on this, but those would already be broken if ATARI_ROM_ISA is set. Arnd 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 036BFC433EF for ; Wed, 29 Dec 2021 03:41:56 +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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=PnYlZPHxSrMsIKR7rH58zkmqRIwdwG8XHZLOC/aMBZk=; b=B73ZnKv27XwzQ0 UgoFV7keqZikng5SSZWqsL5+WINa1bM9TS+vHNzeAUR3YwMA2qJbxewe3FNn/Jnl2a3LQNGt4wyKx wUzIBhNaWomW4Lcq/sgvvT0R2sUF9pJEXiaWfJSfcr/Nr7KFJDzNTaiRTQX7OknPIda+KOuZip3hk UP6afXP1+SZKcPNZRx7kT++Pc9gtrVHNNyFthg5hywaQ+xhI10fpR0bx+sBAoFR6gI8brx1THkeVT 9wMcrR0jYEmqD0QeW1h97nMj/0ktrpvyiFSeuo5TfHs5K/tD7qJRlZeEfriCTu48JukjUPLYieC7Z bYfYYeZIj3wbepJfVB3A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2PqV-002Cmy-TG; Wed, 29 Dec 2021 03:41:47 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2PqQ-002ClB-AC; Wed, 29 Dec 2021 03:41:44 +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 ams.source.kernel.org (Postfix) with ESMTPS id E1DD2B81804; Wed, 29 Dec 2021 03:41:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A799C36AE7; Wed, 29 Dec 2021 03:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640749299; bh=sMe3q8ad98okMs4HLXxIEZG5eWgoWBzrycggRgzNn0g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rMRnM0sy47mX6uuR7D+TwrJ7y7ozZF3yZLCEMGxXEAotZDKwmzaKKtYWX6ysJceh8 TEgR6eIsrI8xWFWg/lZVP/llG47/437lCwf9YPuoPffvBVzcDoGP/h9e3txqXfKtm2 bBedJQfjQDI5eZt6y4NhwsbcUGne/0qnzJYb4R+94+vUQcwataYvetF5FZYNa7PQlX 2SoGPzrWz6M4JhB1Inz0mehc6DK5WFlSrG9Tjc3aHSv6kq08qajpcv/QyixqT9BYGC HZVAGqx1AU7WJYM9/X+k/w/xfA5rIX+vu4VnlvLe8n7xgxofu9qDw3fT1Vrp/ZIQTf 2SrG3XIDAsb1A== Received: by mail-wm1-f52.google.com with SMTP id k66-20020a1ca145000000b00345fa984108so5374029wme.2; Tue, 28 Dec 2021 19:41:39 -0800 (PST) X-Gm-Message-State: AOAM530dA1wTsLZOY0JX3/bjdJg0DO9p9xzD6m5TBmPK7iu0jLIZGdlk 6tmKKVRkvXUMzV6qn29CSfE/UXH9Sl6N70fXTqs= X-Google-Smtp-Source: ABdhPJwExVf1S5yWbdFaQXvSS7m+9fv3xxH0eSVAhqrz/dUiLqmyF5p5xrdPthuPvZdKvgQOvhEXVEuNpJp0LGzgDhQ= X-Received: by 2002:a1c:7418:: with SMTP id p24mr20244545wmc.82.1640749287841; Tue, 28 Dec 2021 19:41:27 -0800 (PST) MIME-Version: 1.0 References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> In-Reply-To: From: Arnd Bergmann Date: Tue, 28 Dec 2021 22:41:18 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary To: Michael Schmitz Cc: Geert Uytterhoeven , Niklas Schnelle , 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 , 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, Greg Ungerer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211228_194142_637218_0ADA1079 X-CRM114-Status: GOOD ( 28.65 ) 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 On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: > Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: > > On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: > >> 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 > > > > Thanks for your patch! > > > >> --- a/arch/m68k/Kconfig > >> +++ b/arch/m68k/Kconfig > >> @@ -16,6 +16,7 @@ config M68K > >> select GENERIC_CPU_DEVICES > >> select GENERIC_IOMAP > >> select GENERIC_IRQ_SHOW > >> + select HAS_IOPORT > >> select HAVE_AOUT if MMU > >> select HAVE_ASM_MODVERSIONS > >> select HAVE_DEBUG_BUGVERBOSE > > > > This looks way too broad to me: most m68k platform do not have I/O > > port access support. > > > > My gut feeling says: > > > > select HAS_IOPORT if PCI || ISA > > > > but that might miss some intricate details... > > In particular, this misses the Atari ROM port ISA adapter case - > > select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA > > might do instead. Right, makes sense. I had suggested to go the easy way and assume that each architecture would select HAS_IOPORT if any configuration supports it, but it looks like for m68k there is a clearly defined set of platforms that do. Note that for the platforms that don't set any of the three symbols, the fallback makes inb() an alias for readb() with a different argument type, so there may be m68k specific drivers that rely on this, but those would already be broken if ATARI_ROM_ISA is set. Arnd _______________________________________________ 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 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 CF10CC433EF for ; Wed, 29 Dec 2021 03:42:00 +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:Cc:To:Subject:Message-ID:Date:From: In-Reply-To:References:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=2RtNZXcIIKVYLHpix1+wbtU4qvIbLG2l1vPAr1V65WE=; b=S5Y78gA3ZVrzeK fq3MCjlFzk2mZqq0GOiofHVUg9DCJEU79Zyg9n9foc0f7vhoJwnrsn041WmLFkoHIsQeFSsNyq2Iy Inx0aHggEMZTq/1MqCVurBOLhz38778z10eHQUBdCBnwOppGf0IBT+6fiV/z8RC67NwjDPs6NRqc+ RXgQs7W9oatv5GMSYvHmk6ML1tdrVYc7xTz3fN9l1zaXX+hngg9z//PX6v1RVLLIenJ4vz+n7qoqr PXFWjUbFuIpTrRDeVmRh/gNzpbPiM27LWuoVthB1t1VkjvQK1ZAPJC53XGd5Odgt8wF3IgxpzMItr QeeIymrSaN379HgC0qvA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2PqU-002Cm8-8M; Wed, 29 Dec 2021 03:41:46 +0000 Received: from ams.source.kernel.org ([2604:1380:4601:e00::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n2PqQ-002ClB-AC; Wed, 29 Dec 2021 03:41:44 +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 ams.source.kernel.org (Postfix) with ESMTPS id E1DD2B81804; Wed, 29 Dec 2021 03:41:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9A799C36AE7; Wed, 29 Dec 2021 03:41:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640749299; bh=sMe3q8ad98okMs4HLXxIEZG5eWgoWBzrycggRgzNn0g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=rMRnM0sy47mX6uuR7D+TwrJ7y7ozZF3yZLCEMGxXEAotZDKwmzaKKtYWX6ysJceh8 TEgR6eIsrI8xWFWg/lZVP/llG47/437lCwf9YPuoPffvBVzcDoGP/h9e3txqXfKtm2 bBedJQfjQDI5eZt6y4NhwsbcUGne/0qnzJYb4R+94+vUQcwataYvetF5FZYNa7PQlX 2SoGPzrWz6M4JhB1Inz0mehc6DK5WFlSrG9Tjc3aHSv6kq08qajpcv/QyixqT9BYGC HZVAGqx1AU7WJYM9/X+k/w/xfA5rIX+vu4VnlvLe8n7xgxofu9qDw3fT1Vrp/ZIQTf 2SrG3XIDAsb1A== Received: by mail-wm1-f52.google.com with SMTP id k66-20020a1ca145000000b00345fa984108so5374029wme.2; Tue, 28 Dec 2021 19:41:39 -0800 (PST) X-Gm-Message-State: AOAM530dA1wTsLZOY0JX3/bjdJg0DO9p9xzD6m5TBmPK7iu0jLIZGdlk 6tmKKVRkvXUMzV6qn29CSfE/UXH9Sl6N70fXTqs= X-Google-Smtp-Source: ABdhPJwExVf1S5yWbdFaQXvSS7m+9fv3xxH0eSVAhqrz/dUiLqmyF5p5xrdPthuPvZdKvgQOvhEXVEuNpJp0LGzgDhQ= X-Received: by 2002:a1c:7418:: with SMTP id p24mr20244545wmc.82.1640749287841; Tue, 28 Dec 2021 19:41:27 -0800 (PST) MIME-Version: 1.0 References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> In-Reply-To: From: Arnd Bergmann Date: Tue, 28 Dec 2021 22:41:18 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary To: Michael Schmitz Cc: Geert Uytterhoeven , Niklas Schnelle , 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 , 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, Greg Ungerer X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211228_194142_637218_0ADA1079 X-CRM114-Status: GOOD ( 28.65 ) 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 On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: > Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: > > On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: > >> 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 > > > > Thanks for your patch! > > > >> --- a/arch/m68k/Kconfig > >> +++ b/arch/m68k/Kconfig > >> @@ -16,6 +16,7 @@ config M68K > >> select GENERIC_CPU_DEVICES > >> select GENERIC_IOMAP > >> select GENERIC_IRQ_SHOW > >> + select HAS_IOPORT > >> select HAVE_AOUT if MMU > >> select HAVE_ASM_MODVERSIONS > >> select HAVE_DEBUG_BUGVERBOSE > > > > This looks way too broad to me: most m68k platform do not have I/O > > port access support. > > > > My gut feeling says: > > > > select HAS_IOPORT if PCI || ISA > > > > but that might miss some intricate details... > > In particular, this misses the Atari ROM port ISA adapter case - > > select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA > > might do instead. Right, makes sense. I had suggested to go the easy way and assume that each architecture would select HAS_IOPORT if any configuration supports it, but it looks like for m68k there is a clearly defined set of platforms that do. Note that for the platforms that don't set any of the three symbols, the fallback makes inb() an alias for readb() with a different argument type, so there may be m68k specific drivers that rely on this, but those would already be broken if ATARI_ROM_ISA is set. Arnd _______________________________________________ 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 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 A947CC433F5 for ; Thu, 30 Dec 2021 08:01:13 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4JPgh81WnSz3c7D for ; Thu, 30 Dec 2021 19:01:12 +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=gfBUGGZt; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kernel.org (client-ip=145.40.68.75; helo=ams.source.kernel.org; envelope-from=arnd@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=gfBUGGZt; dkim-atps=neutral Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) (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 4JNxzG5nF5z2yng for ; Wed, 29 Dec 2021 14:41:46 +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 ams.source.kernel.org (Postfix) with ESMTPS id 888C1B81806 for ; Wed, 29 Dec 2021 03:41:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0CA9EC36AF3 for ; Wed, 29 Dec 2021 03:41:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640749300; bh=sMe3q8ad98okMs4HLXxIEZG5eWgoWBzrycggRgzNn0g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gfBUGGZtKlSdchISLRCbgoh5ApvOms88vBNDBueg3GSAqIXPSkyv3hT3+JLM3V8rd NBXbvcDdAfWC4ZFlxNGOThtvDBg9TpHafmYp6AoKHdo7tXLFlhXn/lylE8k/3yGTpP qaq0Iy+2+aSp302rKXO4x7uVkeduQCA9T79BgtkTt8BYVlCGkm7lz25aZ+zHWTEd0S 9pUWnmx3E/895Wpun2xbxI2jymz5JySeYBwqar7GOpedMrFMwNkqar44IVWO2AO8sP JiT1Dd1gOzEi7FZfU/lHPGKEXgT7N7xI/S78pUQVJ5QyKVMrZUQVQPCKosaR34UMGK rebkE+b3YsYqw== Received: by mail-wm1-f50.google.com with SMTP id f134-20020a1c1f8c000000b00345c05bc12dso11073235wmf.3 for ; Tue, 28 Dec 2021 19:41:39 -0800 (PST) X-Gm-Message-State: AOAM531J9BxLaEH/d/LPLw1j1Qdh5JB2cyU12vNYXcdC/Xy7Mg+h+OnD 3HEc7oFuyCrAUz9iGmFSJOt+QXJH525esQjnFU0= X-Google-Smtp-Source: ABdhPJwExVf1S5yWbdFaQXvSS7m+9fv3xxH0eSVAhqrz/dUiLqmyF5p5xrdPthuPvZdKvgQOvhEXVEuNpJp0LGzgDhQ= X-Received: by 2002:a1c:7418:: with SMTP id p24mr20244545wmc.82.1640749287841; Tue, 28 Dec 2021 19:41:27 -0800 (PST) MIME-Version: 1.0 References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> In-Reply-To: From: Arnd Bergmann Date: Tue, 28 Dec 2021 22:41:18 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary To: Michael Schmitz Content-Type: text/plain; charset="UTF-8" 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 , Greg Ungerer , 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 , Niklas Schnelle , 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 , Chris Zankel , 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" On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: > Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: > > On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: > >> 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 > > > > Thanks for your patch! > > > >> --- a/arch/m68k/Kconfig > >> +++ b/arch/m68k/Kconfig > >> @@ -16,6 +16,7 @@ config M68K > >> select GENERIC_CPU_DEVICES > >> select GENERIC_IOMAP > >> select GENERIC_IRQ_SHOW > >> + select HAS_IOPORT > >> select HAVE_AOUT if MMU > >> select HAVE_ASM_MODVERSIONS > >> select HAVE_DEBUG_BUGVERBOSE > > > > This looks way too broad to me: most m68k platform do not have I/O > > port access support. > > > > My gut feeling says: > > > > select HAS_IOPORT if PCI || ISA > > > > but that might miss some intricate details... > > In particular, this misses the Atari ROM port ISA adapter case - > > select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA > > might do instead. Right, makes sense. I had suggested to go the easy way and assume that each architecture would select HAS_IOPORT if any configuration supports it, but it looks like for m68k there is a clearly defined set of platforms that do. Note that for the platforms that don't set any of the three symbols, the fallback makes inb() an alias for readb() with a different argument type, so there may be m68k specific drivers that rely on this, but those would already be broken if ATARI_ROM_ISA is set. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Date: Tue, 28 Dec 2021 22:41:18 -0500 Subject: [OpenRISC] [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary In-Reply-To: References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: openrisc@lists.librecores.org On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: > Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: > > On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: > >> 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 > > > > Thanks for your patch! > > > >> --- a/arch/m68k/Kconfig > >> +++ b/arch/m68k/Kconfig > >> @@ -16,6 +16,7 @@ config M68K > >> select GENERIC_CPU_DEVICES > >> select GENERIC_IOMAP > >> select GENERIC_IRQ_SHOW > >> + select HAS_IOPORT > >> select HAVE_AOUT if MMU > >> select HAVE_ASM_MODVERSIONS > >> select HAVE_DEBUG_BUGVERBOSE > > > > This looks way too broad to me: most m68k platform do not have I/O > > port access support. > > > > My gut feeling says: > > > > select HAS_IOPORT if PCI || ISA > > > > but that might miss some intricate details... > > In particular, this misses the Atari ROM port ISA adapter case - > > select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA > > might do instead. Right, makes sense. I had suggested to go the easy way and assume that each architecture would select HAS_IOPORT if any configuration supports it, but it looks like for m68k there is a clearly defined set of platforms that do. Note that for the platforms that don't set any of the three symbols, the fallback makes inb() an alias for readb() with a different argument type, so there may be m68k specific drivers that rely on this, but those would already be broken if ATARI_ROM_ISA is set. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Date: Wed, 29 Dec 2021 03:41:18 +0000 Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary Message-Id: List-Id: References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michael Schmitz Cc: Geert Uytterhoeven , Niklas Schnelle , 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 , 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, Greg Ungerer On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: > Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: > > On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: > >> 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 > > > > Thanks for your patch! > > > >> --- a/arch/m68k/Kconfig > >> +++ b/arch/m68k/Kconfig > >> @@ -16,6 +16,7 @@ config M68K > >> select GENERIC_CPU_DEVICES > >> select GENERIC_IOMAP > >> select GENERIC_IRQ_SHOW > >> + select HAS_IOPORT > >> select HAVE_AOUT if MMU > >> select HAVE_ASM_MODVERSIONS > >> select HAVE_DEBUG_BUGVERBOSE > > > > This looks way too broad to me: most m68k platform do not have I/O > > port access support. > > > > My gut feeling says: > > > > select HAS_IOPORT if PCI || ISA > > > > but that might miss some intricate details... > > In particular, this misses the Atari ROM port ISA adapter case - > > select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA > > might do instead. Right, makes sense. I had suggested to go the easy way and assume that each architecture would select HAS_IOPORT if any configuration supports it, but it looks like for m68k there is a clearly defined set of platforms that do. Note that for the platforms that don't set any of the three symbols, the fallback makes inb() an alias for readb() with a different argument type, so there may be m68k specific drivers that rely on this, but those would already be broken if ATARI_ROM_ISA is set. Arnd From mboxrd@z Thu Jan 1 00:00:00 1970 From: Arnd Bergmann Subject: Re: [RFC 02/32] Kconfig: introduce HAS_IOPORT option and select it as necessary Date: Tue, 28 Dec 2021 22:41:18 -0500 Message-ID: References: <20211227164317.4146918-1-schnelle@linux.ibm.com> <20211227164317.4146918-3-schnelle@linux.ibm.com> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1640749300; bh=sMe3q8ad98okMs4HLXxIEZG5eWgoWBzrycggRgzNn0g=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=gfBUGGZtKlSdchISLRCbgoh5ApvOms88vBNDBueg3GSAqIXPSkyv3hT3+JLM3V8rd NBXbvcDdAfWC4ZFlxNGOThtvDBg9TpHafmYp6AoKHdo7tXLFlhXn/lylE8k/3yGTpP qaq0Iy+2+aSp302rKXO4x7uVkeduQCA9T79BgtkTt8BYVlCGkm7lz25aZ+zHWTEd0S 9pUWnmx3E/895Wpun2xbxI2jymz5JySeYBwqar7GOpedMrFMwNkqar44IVWO2AO8sP JiT1Dd1gOzEi7FZfU/lHPGKEXgT7N7xI/S78pUQVJ5QyKVMrZUQVQPCKosaR34UMGK rebkE+b3YsYqw== In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Michael Schmitz Cc: Geert Uytterhoeven , Niklas Schnelle , 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 On Tue, Dec 28, 2021 at 8:20 PM Michael Schmitz wrote: > Am 28.12.2021 um 23:08 schrieb Geert Uytterhoeven: > > On Mon, Dec 27, 2021 at 5:44 PM Niklas Schnelle wrote: > >> 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 > > > > Thanks for your patch! > > > >> --- a/arch/m68k/Kconfig > >> +++ b/arch/m68k/Kconfig > >> @@ -16,6 +16,7 @@ config M68K > >> select GENERIC_CPU_DEVICES > >> select GENERIC_IOMAP > >> select GENERIC_IRQ_SHOW > >> + select HAS_IOPORT > >> select HAVE_AOUT if MMU > >> select HAVE_ASM_MODVERSIONS > >> select HAVE_DEBUG_BUGVERBOSE > > > > This looks way too broad to me: most m68k platform do not have I/O > > port access support. > > > > My gut feeling says: > > > > select HAS_IOPORT if PCI || ISA > > > > but that might miss some intricate details... > > In particular, this misses the Atari ROM port ISA adapter case - > > select HAS_IOPORT if PCI || ISA || ATARI_ROM_ISA > > might do instead. Right, makes sense. I had suggested to go the easy way and assume that each architecture would select HAS_IOPORT if any configuration supports it, but it looks like for m68k there is a clearly defined set of platforms that do. Note that for the platforms that don't set any of the three symbols, the fallback makes inb() an alias for readb() with a different argument type, so there may be m68k specific drivers that rely on this, but those would already be broken if ATARI_ROM_ISA is set. Arnd