linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error
@ 2019-05-31 14:25 YueHaibing
  2019-05-31 14:34 ` Takashi Iwai
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: YueHaibing @ 2019-05-31 14:25 UTC (permalink / raw)
  To: lgirdwood, broonie, perex, tiwai, pierre-louis.bossart, yingjiang.zhu
  Cc: linux-kernel, alsa-devel, YueHaibing

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 <hulkci@huawei.com>
Fixes: e13ef82a9ab8 ("ASoC: SOF: add COMPILE_TEST for PCI options")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 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;
-- 
2.7.4



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error
  2019-05-31 14:25 [PATCH] ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error YueHaibing
@ 2019-05-31 14:34 ` Takashi Iwai
  2019-05-31 18:44   ` [alsa-devel] " Pierre-Louis Bossart
  2019-05-31 17:24 ` Pierre-Louis Bossart
  2019-06-04 14:58 ` Applied "ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error" to the asoc tree Mark Brown
  2 siblings, 1 reply; 5+ messages in thread
From: Takashi Iwai @ 2019-05-31 14:34 UTC (permalink / raw)
  To: YueHaibing
  Cc: lgirdwood, broonie, pierre-louis.bossart, yingjiang.zhu, perex,
	alsa-devel, linux-kernel

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 <hulkci@huawei.com>
> Fixes: e13ef82a9ab8 ("ASoC: SOF: add COMPILE_TEST for PCI options")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  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);

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error
  2019-05-31 14:25 [PATCH] ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error YueHaibing
  2019-05-31 14:34 ` Takashi Iwai
@ 2019-05-31 17:24 ` Pierre-Louis Bossart
  2019-06-04 14:58 ` Applied "ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error" to the asoc tree Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2019-05-31 17:24 UTC (permalink / raw)
  To: YueHaibing, lgirdwood, broonie, perex, tiwai, yingjiang.zhu
  Cc: linux-kernel, alsa-devel

On 5/31/19 9:25 AM, 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 <hulkci@huawei.com>
> Fixes: e13ef82a9ab8 ("ASoC: SOF: add COMPILE_TEST for PCI options")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>

Gah, my bad. My cross-compilation script assumed sound was enabled with 
defconfig but it's not in all cases, thanks for the fix.

Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>


> ---
>   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;
> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [alsa-devel] [PATCH] ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error
  2019-05-31 14:34 ` Takashi Iwai
@ 2019-05-31 18:44   ` Pierre-Louis Bossart
  0 siblings, 0 replies; 5+ messages in thread
From: Pierre-Louis Bossart @ 2019-05-31 18:44 UTC (permalink / raw)
  To: Takashi Iwai, YueHaibing
  Cc: alsa-devel, linux-kernel, lgirdwood, broonie, yingjiang.zhu



On 5/31/19 9:34 AM, Takashi Iwai wrote:
> 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 <hulkci@huawei.com>
>> Fixes: e13ef82a9ab8 ("ASoC: SOF: add COMPILE_TEST for PCI options")
>> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
>> ---
>>   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).

Indeed. I wanted to first enable COMPILE_TEST for SOF and do a PCI 
cleanup in a second stage. It might take a while to synchronize those 
changes and check if there are additional functions needed by others.

> 
> 
> 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);
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Applied "ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error" to the asoc tree
  2019-05-31 14:25 [PATCH] ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error YueHaibing
  2019-05-31 14:34 ` Takashi Iwai
  2019-05-31 17:24 ` Pierre-Louis Bossart
@ 2019-06-04 14:58 ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2019-06-04 14:58 UTC (permalink / raw)
  To: YueHaibing
  Cc: alsa-devel, broonie, Hulk Robot, lgirdwood, linux-kernel,
	Mark Brown, perex, pierre-louis.bossart, Pierre-Louis Bossart,
	tiwai, yingjiang.zhu

The patch

   ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error

has been applied to the asoc tree at

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.2

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.  

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark

From ad169f9f0dbb531cd68db921b351ccafcf684ae4 Mon Sep 17 00:00:00 2001
From: YueHaibing <yuehaibing@huawei.com>
Date: Fri, 31 May 2019 22:25:26 +0800
Subject: [PATCH] ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error

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 <hulkci@huawei.com>
Fixes: e13ef82a9ab8 ("ASoC: SOF: add COMPILE_TEST for PCI options")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 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 8f5c68861bbc..9e2e0f21524e 100644
--- a/sound/soc/sof/intel/hda.c
+++ b/sound/soc/sof/intel/hda.c
@@ -227,7 +227,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;
@@ -454,7 +456,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;
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-06-04 14:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-31 14:25 [PATCH] ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error YueHaibing
2019-05-31 14:34 ` Takashi Iwai
2019-05-31 18:44   ` [alsa-devel] " Pierre-Louis Bossart
2019-05-31 17:24 ` Pierre-Louis Bossart
2019-06-04 14:58 ` Applied "ASoC: SOF: Intel: hda: Fix COMPILE_TEST build error" to the asoc tree Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).