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 284AEC77B6E for ; Wed, 5 Apr 2023 21:36:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233462AbjDEVgz convert rfc822-to-8bit (ORCPT ); Wed, 5 Apr 2023 17:36:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232560AbjDEVgy (ORCPT ); Wed, 5 Apr 2023 17:36:54 -0400 Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2A705B9A for ; Wed, 5 Apr 2023 14:36:50 -0700 (PDT) Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-68-pbqxvDXyOE-yB95Y9KmqPw-1; Wed, 05 Apr 2023 22:36:46 +0100 X-MC-Unique: pbqxvDXyOE-yB95Y9KmqPw-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 5 Apr 2023 22:36:44 +0100 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Wed, 5 Apr 2023 22:36:44 +0100 From: David Laight To: 'Arnd Bergmann' , "H. Peter Anvin" , "Niklas Schnelle" , Richard Henderson , Ivan Kokshaysky , Matt Turner , Russell King , Catalin Marinas , Will Deacon , Huacai Chen , WANG Xuerui , "Geert Uytterhoeven" , Michal Simek , "Thomas Bogendoerfer" , "James E . J . Bottomley" , Helge Deller , Michael Ellerman , Nicholas Piggin , Christophe Leroy , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz , "David S . Miller" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "x86@kernel.org" CC: "linux-m68k@vger.kernel.org" , "linux-ia64@vger.kernel.org" , "Rafael J . Wysocki" , "linux-pci@vger.kernel.org" , "linux-mips@vger.kernel.org" , "sparclinux@vger.kernel.org" , "linux-riscv@lists.infradead.org" , Linux-Arch , "linux-sh@vger.kernel.org" , Alan Stern , =?iso-8859-1?Q?Uwe_Kleine-K=F6nig?= , "loongarch@lists.linux.dev" , Bjorn Helgaas , "Mauro Carvalho Chehab" , "linux-arm-kernel@lists.infradead.org" , Arnd Bergmann , "linux-parisc@vger.kernel.org" , "Greg Kroah-Hartman" , "linux-kernel@vger.kernel.org" , "linux-alpha@vger.kernel.org" , Johannes Berg , "linuxppc-dev@lists.ozlabs.org" Subject: RE: [PATCH v4] Kconfig: introduce HAS_IOPORT option and select it as necessary Thread-Topic: [PATCH v4] Kconfig: introduce HAS_IOPORT option and select it as necessary Thread-Index: AQHZZ/3AaiQodugroEmdF5H6jyGRq68dOQLw Date: Wed, 5 Apr 2023 21:36:44 +0000 Message-ID: References: <20230323163354.1454196-1-schnelle@linux.ibm.com> <248a41a536d5a3c9e81e8e865b34c5bf74cd36d4.camel@linux.ibm.com> In-Reply-To: Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org From: Linuxppc-dev Arnd Bergmann > Sent: 05 April 2023 21:32 > > On Wed, Apr 5, 2023, at 22:00, H. Peter Anvin wrote: > > On April 5, 2023 8:12:38 AM PDT, Niklas Schnelle wrote: > >>On Thu, 2023-03-23 at 17:33 +0100, Niklas Schnelle wrote: > >>> We introduce a new HAS_IOPORT Kconfig option to indicate 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 such as s390. > >>> >> > >>Gentle ping. As far as I can tell this hasn't been picked to any tree > >>sp far but also hasn't seen complains so I'm wondering if I should send > >>a new version of the combined series of this patch plus the added > >>HAS_IOPORT dependencies per subsystem or wait until this is picked up. > > > > You need this on a system supporting not just ISA but also PCI. > > > > Typically on non-x86 architectures this is simply mapped into a memory window. > > I'm pretty confident that the list is correct here, as the HAS_IOPORT > symbol is enabled exactly for the architectures that have a way to > map the I/O space. PCIe generally works fine without I/O space, the > only exception are drivers for devices that were around as early PCI. Isn't there a difference between cpu that have inb()/outb() (probably only x86?) and architectures (well computer designs) that can generate PCI 'I/O' cycles by some means. It isn't even just PCI I/O cycles, I've used an ARM cpu (SA1100) that mapped a chuck of physical address space onto PCMCIA I/O cycles. If the hardware can map a PCI 'IO' bar into normal kernel address space then the bar and accesses can be treated exactly like a memory bar. This probably leaves x86 as the outlier where you need (IIRC) io_readl() and friends that can generate in/out instructions for those accesses. There are also all the x86 ISA devices which need in/out instructions. But (with the likely exception of the UART) they are pretty much platform specific. So, to my mind at least, HAS_IOPORT is just the wrong question. David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)