Received: by 10.223.176.46 with SMTP id f43csp1399725wra; Fri, 19 Jan 2018 10:58:39 -0800 (PST) X-Google-Smtp-Source: ACJfBot33S+xl2rtKMWe6QGxjehWd3CHD7Z1a4nIl+/JYJJx01y2wqgaTM/bv2SnW6zqQ+Rw3WGV X-Received: by 10.98.102.4 with SMTP id a4mr31202712pfc.210.1516388319229; Fri, 19 Jan 2018 10:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516388319; cv=none; d=google.com; s=arc-20160816; b=FkBVeNFys+bdJ+uGXNNSrqPpxIcHP/ftG15KQI2tv9ohPsRUUFpWQF58tmnEw+wTLH geYjquaoeeRBi4Vi9vIyen51NAljhBCMXEGgcBZ89Fw+xVBndrsbS3xbtbqB+akdB06q dD7Hgd1hL+Ih5gy8rqevY3CxKyj9w7F5/G7MVlf2ZsxtUUdeGPS45QTqZtXsLcl/U6lj HbMuemZa+J1RtrhOcmnBRDucjf2YGeungUxlkO15OdELLLTnticszLaih/NkneYYrpC5 9tVNbJ1+3J/ybDzjaeiAhMxgj92Bp8Vs2LtgY8N607Eg5VrkAe1atFZVrys4eRYzXBlP er7A== 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:dmarc-filter:arc-authentication-results; bh=cjh4KEUku3a6nl52hX2NFnB3eftI3pMH47+4VbY/8hg=; b=fnG/4MEO2tt7Qzwtz8Cvhe7h4CGl8uDdVjZmJv7HwfGI+LwlIYOdDX5pmK7A0bq7IJ l+qoyb5OB6n9YfdLbZwhRkto+9kqda2nGs2yR7JXRFyUZalWRTLKniphF2HnOEypVgt5 Iye6oM4g25qc43tLdz9x5qux6fpKEegZiN1rEfJy3NlbiHBfPLF4QuwSFQdSmLx8AtXR Jb9aBKGqpvPHTPLInNxBZ3iXoPLZkSgEVUlGa4XSvhUDVblc0FSv8AYDOFRdb0EE2Xoh Q4Yw5xQio2eEPwxkYuaEs5pW0ty76o+HmxFDkpazYunSzQRMzhNBeoA5sIR4Jt68HC6o uZxA== 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 n12si1200915pgs.536.2018.01.19.10.58.25; Fri, 19 Jan 2018 10:58:39 -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 S1756227AbeASS5r (ORCPT + 99 others); Fri, 19 Jan 2018 13:57:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:54016 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756158AbeASS5l (ORCPT ); Fri, 19 Jan 2018 13:57:41 -0500 Received: from localhost (unknown [69.55.156.246]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 6780121456; Fri, 19 Jan 2018 18:57:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6780121456 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 12:57:39 -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: <20180119185739.GA5317@bhelgaas-glaptop.roam.corp.google.com> References: <20180119093906.27670-1-niklas.cassel@axis.com> <20180119111859.GA24300@red-moon> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180119111859.GA24300@red-moon> 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 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. This build problem is in my "next" branch (not in Linus' tree yet), and I will pick this up in some form for the v4.16 merge window, but I'm not 100% sure about the approach yet. We compile pci-dra7xx.c if either CONFIG_PCI_DRA7XX_HOST or CONFIG_PCI_DRA7XX_EP (or both) are set. There's actually quite a bit of code there that is specific to either _HOST or _EP. The reference to pci_irqd_intx_xlate() is a small piece of that. So we compile the whole file when only one of _HOST and _EP is set, and I guess we implicitly rely on gcc to eliminate the unused code. I wonder if there would be anything to be gained by instead adding "#ifdef CONFIG_PCI_DRA7XX_HOST" and "#ifdef CONFIG_PCI_DRA7XX_EP" around the appropriate pieces. That's a little bit ugly, but the ugliness does have some value in that it makes it more explicit which pieces go where, and it might be an incentive to group the host-related pieces and the endpoint-related pieces. I don't know if that avenue would be fruitful, and even if it were, there's probably not time to do it before the v4.16 merge window, so I guess I'll probably merge this patch as-is. It does have the disadvantage that we export pci_irqd_intx_xlate() to the world, most of which doesn't need it. > > --- > > include/linux/pci.h | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/include/linux/pci.h b/include/linux/pci.h > > index 83299833a6ce..41c676a011f4 100644 > > --- a/include/linux/pci.h > > +++ b/include/linux/pci.h > > @@ -1675,6 +1675,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 */ > > -- > > 2.14.2 > >