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 8C9D9C4332F for ; Thu, 5 May 2022 08:46:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1350366AbiEEIt2 (ORCPT ); Thu, 5 May 2022 04:49:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241214AbiEEIs5 (ORCPT ); Thu, 5 May 2022 04:48:57 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 30906B93; Thu, 5 May 2022 01:45:15 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id 4E39792009C; Thu, 5 May 2022 10:45:14 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 4A38F92009B; Thu, 5 May 2022 09:45:14 +0100 (BST) Date: Thu, 5 May 2022 09:45:14 +0100 (BST) From: "Maciej W. Rozycki" To: Bjorn Helgaas cc: Arnd Bergmann , Niklas Schnelle , Arnd Bergmann , Greg Kroah-Hartman , Linux Kernel Mailing List , linux-arch , linux-pci , Dominik Brodowski Subject: Re: [RFC v2 25/39] pcmcia: add HAS_IOPORT dependencies In-Reply-To: <20220504172201.GA454911@bhelgaas> Message-ID: References: <20220504172201.GA454911@bhelgaas> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 4 May 2022, Bjorn Helgaas wrote: > > Well, yes, except I would expect POWER9_CPU (and any higher versions we > > eventually get) to clear HAS_IOPORT. Generic configurations (GENERIC_CPU) > > would set HAS_IOPORT of course, as would any lower architecture variants > > that do or may support port I/O (it's not clear to me if there are any > > that do not). Ideally a generic configuration would not issue accesses to > > random MMIO locations for port I/O accesses via `inb'/`outb', etc. for > > systems that do not support port I/O (which it now does, or at least used > > to until recently). > > It would seem weird to me that a module would build and run on a > generic kernel running on POWER9 (with some safe way of handling > inb/outb that don't actually work), but not on a kernel built > specifically for POWER9_CPU. Why? If you say configure your Alpha kernel for ALPHA_JENSEN, a pure EISA system, then you won't get PCI support nor any PCI drivers offered even though a generic Alpha kernel will get them all and still run on a Jensen system. I find that no different from our case here. And if we do ever get TURBOchannel Alpha support, then a generic kernel configuration will offer EISA, PCI and TURBOchannel drivers, while you won't be offered TURBOchannel drivers for a PCI system and vice versa. It would make no sense to me. Please mind that the main objective for system-specific configurations is optimisation, including both size and speed, and a part of the solution is discarding stuff that's irrelevant for the respective system. So in our case we do want any port I/O code not to be there at all in compiled code and consequently any driver that absolutely requires port I/O code to work will have to become a useless stub in its compiled form. What would be the point then of having it there in the first place except to spread confusion? Maciej