From patchwork Sat Jan 20 02:40:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Helgaas X-Patchwork-Id: 10176225 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0D2A0601C2 for ; Sat, 20 Jan 2018 02:40:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EC326287DC for ; Sat, 20 Jan 2018 02:40:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EAAA3287BF; Sat, 20 Jan 2018 02:40:33 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60B7B2881C for ; Sat, 20 Jan 2018 02:40:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755949AbeATCk1 (ORCPT ); Fri, 19 Jan 2018 21:40:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:46166 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755132AbeATCk0 (ORCPT ); Fri, 19 Jan 2018 21:40:26 -0500 Received: from localhost (unknown [69.71.4.159]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B53C921719; Sat, 20 Jan 2018 02:40:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B53C921719 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=helgaas@kernel.org Date: Fri, 19 Jan 2018 20:40:05 -0600 From: Bjorn Helgaas To: Lorenzo Pieralisi Cc: Niklas Cassel , Bjorn Helgaas , arnd@arndb.de, kishon@ti.com, Niklas Cassel , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: Add dummy pci_irqd_intx_xlate() for CONFIG_PCI=n build Message-ID: <20180120024005.GC160618@bhelgaas-glaptop.roam.corp.google.com> References: <20180119093906.27670-1-niklas.cassel@axis.com> <20180119111859.GA24300@red-moon> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20180119111859.GA24300@red-moon> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Fri, Jan 19, 2018 at 11:18:59AM +0000, Lorenzo Pieralisi wrote: > On Fri, Jan 19, 2018 at 10:39:06AM +0100, Niklas Cassel wrote: > > If CONFIG_PCI=n and CONFIG_PCI_DRA7XX_EP=y, the build fails with: > > > > drivers/pci/dwc/pci-dra7xx.c:229:11: error: 'pci_irqd_intx_xlate' > > undeclared here (not in a function) > > > > When building drivers/pci/dwc/pci-dra7xx.c without CONFIG_PCI, > > gcc is usually smart enough to realize that RC specific code > > is unreachable and can thus be eliminated. > > > > However, gcc cannot do this if there is a function that isn't > > even declared. > > > > Hence fix the issue by introducing a dummy for pci_irqd_intx_xlate(). > > > > Acked-by: Arnd Bergmann > > Acked-by: Lorenzo Pieralisi > > Signed-off-by: Niklas Cassel > > Thanks for the patch. > > I think the commit log should be rewritten (when you write it think at > someone reading it in some time - what you wrote won't probably make > any sense) but first, Bjorn are you picking this up ? It does not make > much sense to squash it in one of my pci/dwc branch commits - therefore > I am asking, just let me know. I did apply this, as follows. I don't know if the commit log makes any more sense; a lot of the sense is in the eye of the author :) But anyway, I put this on pci/misc and re-merged my "next" branch so this is applied before the dra7xx changes, so there shouldn't be any bisection issue. commit 80db6f08b7af93eddc9487535e6150b220262637 Author: Niklas Cassel Date: Fri Jan 19 10:39:06 2018 +0100 PCI: Add dummy pci_irqd_intx_xlate() for CONFIG_PCI=n build Some hardware can operate in either "host" or "endpoint" mode, which means there can be both a host bridge driver and an endpoint driver for the same device. Those drivers share a lot of code, so sometimes they live in the same source file. The host bridge driver requires CONFIG_PCI=y because it enumerates PCI devices below the bridge using the PCI core. The endpoint driver does not require CONFIG_PCI=y because it runs in an embedded kernel on the other side of the device, e.g., on an adapter card. pci-dra7xx.c contains both host and endpoint drivers. If we select only the endpoint driver (CONFIG_PCI=n and CONFIG_PCI_DRA7XX_EP=y), the unneeded host driver is still compiled. It references pci_irqd_intx_xlate(), which is not present when CONFIG_PCI=n, which causes this error: drivers/pci/dwc/pci-dra7xx.c:229:11: error: 'pci_irqd_intx_xlate' undeclared here (not in a function) Add a dummy pci_irqd_intx_xlate() for the CONFIG_PCI=n case. [bhelgaas: changelog] Signed-off-by: Niklas Cassel Signed-off-by: Bjorn Helgaas Acked-by: Arnd Bergmann Acked-by: Lorenzo Pieralisi diff --git a/include/linux/pci.h b/include/linux/pci.h index 6079ab46191f..febe7f653689 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -1686,6 +1686,13 @@ static inline int pci_get_new_domain_nr(void) { return -ENOSYS; } #define dev_is_pf(d) (false) static inline bool pci_acs_enabled(struct pci_dev *pdev, u16 acs_flags) { return false; } +static inline int pci_irqd_intx_xlate(struct irq_domain *d, + struct device_node *node, + const u32 *intspec, + unsigned int intsize, + unsigned long *out_hwirq, + unsigned int *out_type) +{ return -EINVAL; } #endif /* CONFIG_PCI */ /* Include architecture-dependent settings and functions */