Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp565733imw; Thu, 14 Jul 2022 06:49:33 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tJKPjBdysaB6EvLadyH1AzZ28MRjnTrzsENXbhSez+opqfU88QCiSUtPoB2rDEIInC+tup X-Received: by 2002:a17:90b:896:b0:1ef:935c:f326 with SMTP id bj22-20020a17090b089600b001ef935cf326mr9829687pjb.193.1657806573601; Thu, 14 Jul 2022 06:49:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657806573; cv=none; d=google.com; s=arc-20160816; b=Hqf7KzfSZxFRkU/F3Xvfdk4F+IKsA7NwW7WljolgvbrzcisGQN3GciiVUjoLDHM7K7 m74yAfTenbeP0+S/jKzpvml/6hIIs7dTg6fTluKBtxY2LcEGqquK8D7wTAx/wRGY9wIH nUsvw0a3aCwfBMY735fl5hMb0VrRLgY2mnB207bVrvAo6rCqegsP4UZQthjj2CKi/zA8 mWzQhxM/hw8mE+i0CsL2sA958Tex82DsNf1UkuiG6vX2rrH2vDfHoo4SaUdofww+zdM1 EBOTqLtuQAvFqUQTjH0Ig2lHVnV8clfUfFjT86L1hFkN4aD26ZQ05HIjyO+H5P5LImVN aUDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=Qxbg2JzHYQ/WeKknT5D7VDweKjB9CRMPxP1C7ZmTP3U=; b=hHNi+TFhTna8ktB4mEVkjMOyQw0EMicOOADW0tCQ6yG8MU5oBciR9GtTOwQT3pAjpd 1in/WcL44BZnuX1pllhq18PqbB0mV1An84nSIqTp7b4I3+vNQpf1AfEhOJ6hHQdWzl5n U15aKtKbYXNJZJSi2pJ6u0cOp6Q0b7t3NwHW0KKKNO39vRhyg93BRyxCitVvhUuOmkm5 4mzhounS23TObvvjn2dXsh2GD7zrkOu4lYvT8f4rW8dCoYHyqfisJrYFh5NwZen7WFXK tW2r0G0U5cDaSQdeG5d6C9e8LaxHZFL5AVLN5KFsg5Eh8WhN2rSM9WEL5IU0+rKr3PxF gcpg== 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 188-20020a6304c5000000b00412a9c163b3si1809824pge.51.2022.07.14.06.49.21; Thu, 14 Jul 2022 06:49:33 -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 S239669AbiGNNOn (ORCPT + 99 others); Thu, 14 Jul 2022 09:14:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235068AbiGNNOk (ORCPT ); Thu, 14 Jul 2022 09:14:40 -0400 Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.17.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 457431C924 for ; Thu, 14 Jul 2022 06:14:38 -0700 (PDT) Received: from mail-yw1-f181.google.com ([209.85.128.181]) by mrelayeu.kundenserver.de (mreue108 [213.165.67.113]) with ESMTPSA (Nemesis) id 1Mi2Fj-1nYmAX0zq5-00e8DK for ; Thu, 14 Jul 2022 15:14:36 +0200 Received: by mail-yw1-f181.google.com with SMTP id 00721157ae682-31bf3656517so16228397b3.12 for ; Thu, 14 Jul 2022 06:14:36 -0700 (PDT) X-Gm-Message-State: AJIora87dVBX+DLh37CXKUqy3ESZ510y4pTRJQH+h1oG/NCEbkzVIilh 8O9sUD5XiawQRXw1Ai2V7cV2/cxFX+G9TNOwL/A= X-Received: by 2002:a81:9b02:0:b0:31c:9ae4:99ec with SMTP id s2-20020a819b02000000b0031c9ae499ecmr9597696ywg.495.1657804475066; Thu, 14 Jul 2022 06:14:35 -0700 (PDT) MIME-Version: 1.0 References: <20220714042736.2133067-1-shorne@gmail.com> <20220714042736.2133067-2-shorne@gmail.com> In-Reply-To: From: Arnd Bergmann Date: Thu, 14 Jul 2022 15:14:18 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] openrisc: Add pci bus support To: Stafford Horne Cc: Arnd Bergmann , LKML , Openrisc , Jonas Bonn , Stefan Kristiansson , Palmer Dabbelt , Peter Zijlstra Content-Type: text/plain; charset="UTF-8" X-Provags-ID: V03:K1:jHmubrKEqz1zeuuGx1djmsVNmjLP5jT81eHPCDSYJ+5UDzfG47g qIrCFWfqD+8IE3e4ZRwJQ/G6Ce4kgNSFcO2m42ndtAaTSA95hQHlESPMwYJaXl9zCnRwkK/ YC0DJstaFhKKtZB5IB9hCJgupSK9Cs3sTMIGNjc04fa8hwmPs3nyn0m/YRHra7KPp93el8L nKAYHQ9nFAwop5JOisMCg== X-UI-Out-Filterresults: notjunk:1;V03:K0:789tF/xj5OM=:EaTxDqXhyPyKfuuWsmMyvY auQ2FYUzmIEjm+Gn/iW3pBt1xDyjUGjtu2svgW/yoGZm43YYTYE6gz/dzlWwrBFLO7p4p94w7 Gv+MUN8I8nHxesIuYFH6Zu9U8Fsl43P+xYfg7eC4e40piTQWWa/xHkZQO3awiuvyJl7gyeE1P xt5jo8WiD0MvBFAGzdRyiR2kbBHITqxSOehBKqZxkqCs34OeNX+t7dEtRIFTswRALS/d6Qk2K da4kShO3ClRl4UnnlgwyJXZJtY57Ve/cR6ETKJLyc5KwWlX/NerFBBkaa6OE7CfRpPC3oD/Ug EwnjyrZNPgdnZhFG0TuVwVRO+HQTZT82kQhWy3Odg1ZKjdIELIKUMA0VSCGvsxk1bCN661lKC wc8vGcNRs4Fx/d+FstOYEeV/YXgr46Ds4d18KnzwtlMmP1j19FjCMhYXLzeKL7zqd12YXYb3N 9C4pHnXrTuePdkKItMx0DluNpcUzGj3ojgNXXptKnB6aY1emfysqgkugy874Yx5KG2HTg9y4y +ZK/fZN31eIXGbD4lGlMVRe20GraQParfayxJlnVrpHOSFGDSnhN+IgLKq8zDEZCkQFaEWl1W 38X8hU302xvEpLgh7o1EFvOpCNy7qv7Rc/WDOnJ221RAUQkAxt1ceIWeMUrWo79Rcw7IrT+UC peWlpsbtwmdKZY4y4XfyRUupACS8W7Dg6cCg5d77A17DwmOeVKyc7DGqvv0oDw1OrLC3apt0J tbThgxDPRT+tayk6rjS8WMnpnWessrVYdLSs3A== 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 Thu, Jul 14, 2022 at 2:41 PM Stafford Horne wrote: > On Thu, Jul 14, 2022 at 09:56:44AM +0200, Arnd Bergmann wrote: > > > diff --git a/arch/openrisc/Kconfig b/arch/openrisc/Kconfig > > > index e814df4c483c..327241988819 100644 > > > --- a/arch/openrisc/Kconfig > > > +++ b/arch/openrisc/Kconfig > > > @@ -21,7 +21,9 @@ config OPENRISC > > > select GENERIC_IRQ_PROBE > > > select GENERIC_IRQ_SHOW > > > select GENERIC_IOMAP > > > + select GENERIC_PCI_IOMAP > > > select GENERIC_CPU_DEVICES > > > > > @@ -46,9 +50,6 @@ config MMU > > > config GENERIC_HWEIGHT > > > def_bool y > > > > > > -config NO_IOPORT_MAP > > > - def_bool y > > > - > > I tried the below patch on top of this but I get failures, as the __pci_ioport_map > uses ioport_map. > > lib/pci_iomap.c: In function 'pci_iomap_range': > CC drivers/i2c/i2c-core-base.o > ./include/asm-generic/pci_iomap.h:29:41: error: implicit declaration of function 'ioport_map'; did you mean 'ioremap'? [-Werror=implicit-function-declaration] > 29 | #define __pci_ioport_map(dev, port, nr) ioport_map((port), (nr)) > | ^~~~~~~~~~ > lib/pci_iomap.c:44:24: note: in expansion of macro '__pci_ioport_map' > 44 | return __pci_ioport_map(dev, start, len); > | ^~~~~~~~~~~~~~~~ > Ah, I see. So setting NO_IOPORT_MAP without GENERIC_PCI_IOMAP probably just works, but then you'd also build all the driver that use ioport_map() when they cannot work. Maybe add another #define __pci_ioport_map(dev, port, nr) NULL case to include/asm-generic/pci_iomap.h, or add an #ifdef to lib pci_iomap_range() to not call it in this case. > > GENERIC_IOMAP makes no sense without PIO, and I think you also > > need to keep the NO_IOPORT_MAP. I think you still want > > GENERIC_PCI_IOMAP, which in the absence of the other two > > should turn just return an __iomem pointer for memory resource > > and NULL for i/o resources. > > OK. > > If we keep NO_IOPORT_MAP, it causes HAS_IOPORT_MAP to be false and it removes > the definition of ioport_map which still seems to be needed at link time. Maybe > thats an issue though. This is the intention of CONFIG_NO_IOPORT_MAP, it's meant to be set on architectures that have no way of defining ioport_map() in a sensible way. Arnd