Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1167699iob; Wed, 4 May 2022 16:26:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwzbI8jLIOvJXE6jmG39h0Wi4EiFXF8B8AYQFPR2twju8lUvw2JLuoSTWNhrHYw9PcSxRoE X-Received: by 2002:a05:6402:2753:b0:423:3895:7031 with SMTP id z19-20020a056402275300b0042338957031mr25924946edd.170.1651706770742; Wed, 04 May 2022 16:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651706770; cv=none; d=google.com; s=arc-20160816; b=DbWGZp2xGJlyAGm0M6vMgl/AsBmkW2eLgErvfZJFYuD3Cn7S7/5xR4EwYRMTDiu5UL yssfx9QDli3VOPiHvRyHRaO7Kj9UrDw1YcxVEihMBM4mgj+Y7tupSYIn1tEyOexLLD18 A8wNihw/a4WFU+AhzSgBbo+bzQEjbUJqUTj66lw9VNJoaE/VKpBK7+sDGQqAKQrL3ok7 n39FK8QCHA5evcDynBbsm00QyCdvmOdWc9Tlb8ookWLZr3WtrS6DN2wwJ+VEaygQeiAx BMRbDVCzLofnYC9zJ/EApK8t4k9CnJCvHTBNPNdBV+2Nk29JdzH2bM/CU5d62RabQwOq MlXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date; bh=+Gy0H42i3/HD9SgRoaDGnKpPvh5RxOCDIQD09ZCo9Uk=; b=o8do89bIcRSCp4IfDTHNnfL9gB6Uc8zMGtdMVEnIytpNAavEga6eXKoX1tKd1ZBJzv rHDcOwz04I2fVhj6fKF0YiMH0Lxrhuc4zjcoP+KlT/eiG67Yp2fpuIbOWNJ1W5Q8CWk7 NnTTBkT8D6J1nZcgkMpj/9hProtO9xPw8y3StUBhxZdW8T8bYCUDWodedU5jeUDNGrDx 63wzt5xZVCUx9GTewUV7d+VPmNjbEHwvtmQUDAmnJ6hE5V0ix0kYBG7KG+wFbrHEQCtx mkDBjPSpqz2MSUHWu00QpACvGYcxjSo/E3UYpfJSMET9W5KSZnCoWssnMtBf/NvjOcWK pegA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g8-20020a056402424800b00427db9c8ee3si5906edb.283.2022.05.04.16.25.47; Wed, 04 May 2022 16:26:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349066AbiEDLuW (ORCPT + 99 others); Wed, 4 May 2022 07:50:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237744AbiEDLuT (ORCPT ); Wed, 4 May 2022 07:50:19 -0400 Received: from angie.orcam.me.uk (angie.orcam.me.uk [78.133.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 136131F623; Wed, 4 May 2022 04:46:43 -0700 (PDT) Received: by angie.orcam.me.uk (Postfix, from userid 500) id A4B0A92009C; Wed, 4 May 2022 13:46:41 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id 9DFED92009B; Wed, 4 May 2022 12:46:41 +0100 (BST) Date: Wed, 4 May 2022 12:46:41 +0100 (BST) From: "Maciej W. Rozycki" To: David Laight cc: 'Linus Walleij' , William Breathitt Gray , Niklas Schnelle , Arnd Bergmann , Greg Kroah-Hartman , "linux-kernel@vger.kernel.org" , "linux-arch@vger.kernel.org" , "linux-pci@vger.kernel.org" , Arnd Bergmann , Bartosz Golaszewski , "open list:GPIO SUBSYSTEM" Subject: RE: [RFC v2 10/39] gpio: add HAS_IOPORT dependencies In-Reply-To: Message-ID: References: <20220429135108.2781579-1-schnelle@linux.ibm.com> <20220429135108.2781579-19-schnelle@linux.ibm.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 3 May 2022, David Laight wrote: > > > There is such a thing as ISA DMA, but you'll still need to initialize > > > the device via the IO Port bus first, so perhaps setting HAS_IOPORT for > > > "config ISA" is the right thing to do: all ISA devices are expected to > > > communicate in some way via ioport. > > > > Adding that dependency seems like the right solution to me. > > I think it all depends on what HAS_IOPORT is meant to mean and > how portable kernel binaries need to be. > > x86 is (probably) the only architecture that actually has 'in' > and 'out' instructions - but that doesn't mean that some other > cpu (and I mean cpu+pcb not architecture) have the ability to > generate 'IO' bus cycles on a specific physical bus. I am fairly sure IA-64 has some form of IN/OUT machine instructions too. > While the obvious case is a physical address window that generates > PCI(e) IO cycles from normal memory cycles it isn't the only one. > > I've used sparc cpu systems that have pcmcia card slots. > These are pretty much ISA and the drivers might expect to > access port 0x300 (etc) - certainly that would be right on x86. > > In this case is isn't so much that the ISA_BUS depends on support > for in/out but that presence of the ISA bus provides the required > in/out support. Well, one can implement a pluggable PCI/e expansion card with a PCI-ISA bridge on it and a backplane to plug ISA cards into. Without support for issuing I/O cycles to PCI from the host however you won't be able to make use of the ISA backplane except maybe for some ancient ISA memory cards. So logically I think CONFIG_ISA should depend on CONFIG_HAS_IOPORT and CONFIG_HAS_IOPORT ought to be selected by platform configurations. ISTR there was a company that manufactured a USB-ISA option (providing an external ISA backplane). We never supported it, but in principle if we wanted to, then it would be the USB-ISA device's driver config option that CONFIG_ISA would additionally depend on as an alternative. That wouldn't enable CONFIG_HAS_IOPORT though because the presence of this particular USB-ISA device would not itself permit the use of I/O cycles with any PCI/e buses a machine might independently have, so devices for PCI/e options that require port I/O shouldn't be made available at the same time. I think that company might have actually manufactured a similar PCI-ISA option as well, but that I suppose did rely on support for I/O cycles on PCI. Early 2000s BTW. Maciej