Received: by 10.223.176.46 with SMTP id f43csp2754568wra; Mon, 22 Jan 2018 02:53:00 -0800 (PST) X-Google-Smtp-Source: AH8x225niVsIUqLxcPXxaFyfhq47vLur2I0u1rANkuLSQ0aKEk9rXn2+1ba7mRgCGVdQjVpI8rsN X-Received: by 10.99.110.10 with SMTP id j10mr6862529pgc.72.1516618380557; Mon, 22 Jan 2018 02:53:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516618380; cv=none; d=google.com; s=arc-20160816; b=JGHYgUILTELQw7/CCmzFo/lN0bgBINORYiZv12LcxtAnqYYDIuDVlWOjil0svifeE1 Ew6bAtbA+0Efs6ZGcKpLibvN7tvKX59UWz7NKbXo60G1N0X7YY8j1wfc/6Oq8Vg1ED/B N4jZoHkT1un1GymVJ7jyBl8oOsyX4tnBxcWKtpN80WLbLWECIKZnACBq7MLTKEdfwO7C SfWeTYGlbOEq/XTl/hnvNuq42TDFjVLSz1lv8MqVw6oc59zkviXBBi4rvwKnxvJ1Kug4 4Tm8fU3gcAaR5i1aAl5TTBPN3gE2sLDN+2R3QEFZ0p73Lpz2RCMTveNPudVzD2Ipi8UB /2Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=A1M5lfyBvoGLUj8w53JjBw/MfFsDYAprrYL2BAPmpn0=; b=Cnkbxifw0Ha3I9drD9cnbufiMvHn8E/7O2lC84KcTxTClcjUA+YxQWD+dols7RqoIK VZd1Sdxe475+0M7wcpNtkGCdloXuqlUp+LxeihOgvQnhDj1yv65tdT5+orSaJfgFdfrw IgM2GgmPh1WCRZrqXOnXH9Iyow1HQXOaIEOgZp9rMtNMhWvLqoOF5HZ0ZCGB7tKfOjyE BaKykgT/D2HyXnhIyt+HkgPfj05YKw24MD8qDoIYiWPjr3tBH2kTZlNMOEU9C0QcOmY4 2Xp6hjw0bGBvjsiApjxlDPh4bDrPs9dKMJaST6pynj94Xd3VSHbT4/BiUUlAAwuRDgf8 pR5w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q17si1611726pgv.144.2018.01.22.02.52.46; Mon, 22 Jan 2018 02:53:00 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751099AbeAVKwW (ORCPT + 99 others); Mon, 22 Jan 2018 05:52:22 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56944 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750925AbeAVKwV (ORCPT ); Mon, 22 Jan 2018 05:52:21 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 36AB81529; Mon, 22 Jan 2018 02:52:21 -0800 (PST) Received: from red-moon (red-moon.cambridge.arm.com [10.1.206.55]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id ADC0E3F53D; Mon, 22 Jan 2018 02:52:19 -0800 (PST) Date: Mon, 22 Jan 2018 10:53:27 +0000 From: Lorenzo Pieralisi To: Bjorn Helgaas 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: <20180122105327.GA31766@red-moon> References: <20180119093906.27670-1-niklas.cassel@axis.com> <20180119111859.GA24300@red-moon> <20180120024005.GC160618@bhelgaas-glaptop.roam.corp.google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180120024005.GC160618@bhelgaas-glaptop.roam.corp.google.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 19, 2018 at 08:40:05PM -0600, Bjorn Helgaas wrote: > 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. Thank you, I just wanted to say that it was better to provide a general description/introduction of the issue (like you did) instead of referring to a specific driver. Anyway - thanks for the patch - I think that after the merge window we can rework the code and remove it. Thanks, Lorenzo > 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 */