From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 14D14C28CC2 for ; Fri, 31 May 2019 14:34:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EC3CF26AB4 for ; Fri, 31 May 2019 14:34:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726969AbfEaOeU (ORCPT ); Fri, 31 May 2019 10:34:20 -0400 Received: from mx2.suse.de ([195.135.220.15]:32830 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726559AbfEaOeS (ORCPT ); Fri, 31 May 2019 10:34:18 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 851CDAF79; Fri, 31 May 2019 14:34:17 +0000 (UTC) Date: Fri, 31 May 2019 16:34:17 +0200 Message-ID: From: Takashi Iwai To: YueHaibing Cc: , , , , , , Subject: Re: [PATCH] ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error In-Reply-To: <20190531142526.12712-1-yuehaibing@huawei.com> References: <20190531142526.12712-1-yuehaibing@huawei.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/25.3 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 31 May 2019 16:25:26 +0200, YueHaibing wrote: > > while building without PCI: > > sound/soc/sof/intel/hda.o: In function `hda_dsp_probe': > hda.c:(.text+0x79c): undefined reference to `pci_ioremap_bar' > hda.c:(.text+0x79c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `pci_ioremap_bar' > hda.c:(.text+0x7c4): undefined reference to `pci_ioremap_bar' > hda.c:(.text+0x7c4): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `pci_ioremap_bar' > > Reported-by: Hulk Robot > Fixes: e13ef82a9ab8 ("ASoC: SOF: add COMPILE_TEST for PCI options") > Signed-off-by: YueHaibing > --- > sound/soc/sof/intel/hda.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/sound/soc/sof/intel/hda.c b/sound/soc/sof/intel/hda.c > index 68db2ac..c1703c4 100644 > --- a/sound/soc/sof/intel/hda.c > +++ b/sound/soc/sof/intel/hda.c > @@ -231,7 +231,9 @@ static int hda_init(struct snd_sof_dev *sdev) > > /* initialise hdac bus */ > bus->addr = pci_resource_start(pci, 0); > +#if IS_ENABLED(CONFIG_PCI) > bus->remap_addr = pci_ioremap_bar(pci, 0); > +#endif > if (!bus->remap_addr) { > dev_err(bus->dev, "error: ioremap error\n"); > return -ENXIO; > @@ -458,7 +460,9 @@ int hda_dsp_probe(struct snd_sof_dev *sdev) > goto hdac_bus_unmap; > > /* DSP base */ > +#if IS_ENABLED(CONFIG_PCI) > sdev->bar[HDA_DSP_BAR] = pci_ioremap_bar(pci, HDA_DSP_BAR); > +#endif > if (!sdev->bar[HDA_DSP_BAR]) { > dev_err(sdev->dev, "error: ioremap error\n"); > ret = -ENXIO; IMO, this should be better addressed by fixing in linux/pci.h instead, something like below (totally untested). thanks, Takashi --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2005,8 +2005,19 @@ static inline void pci_mmcfg_late_init(void) { } int pci_ext_cfg_avail(void); +#ifdef CONFIG_PCI void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); void __iomem *pci_ioremap_wc_bar(struct pci_dev *pdev, int bar); +#else +static inline void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar) +{ + return NULL; +} +static inline void __iomem *pci_ioremap_wc_bar(struct pci_dev *pdev, int bar) +{ + return NULL; +} +#endif #ifdef CONFIG_PCI_IOV int pci_iov_virtfn_bus(struct pci_dev *dev, int id);