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 EC6C0C77B6C for ; Wed, 5 Apr 2023 21:38:37 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4PsJ0X1xDMz3fTX for ; Thu, 6 Apr 2023 07:38:36 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=aculab.com (client-ip=185.58.85.151; helo=eu-smtp-delivery-151.mimecast.com; envelope-from=david.laight@aculab.com; receiver=) X-Greylist: delayed 68 seconds by postgrey-1.36 at boromir; Thu, 06 Apr 2023 07:38:04 AEST Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.85.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4PsHzw5d4Pz3f4N for ; Thu, 6 Apr 2023 07:38:04 +1000 (AEST) 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" 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: quoted-printable 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: "linux-m68k@vger.kernel.org" , "linux-ia64@vger.kernel.org" , "Rafael J . Wysocki" , "linux-pci@vger.kernel.org" , "linux-kernel@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-mips@vger.kernel.org" , "linux-alpha@vger.kernel.org" , Johannes Berg , "linuxppc-dev@lists.ozlabs.org" Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Linuxppc-dev Arnd Bergmann > Sent: 05 April 2023 21:32 >=20 > 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=3Dn will disable compilatio= n 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. >=20 > 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. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)