diff mbox series

media: staging: tegra-vde: Fix build error

Message ID 20190725024129.22664-1-yuehaibing@huawei.com
State Deferred
Headers show
Series media: staging: tegra-vde: Fix build error | expand

Commit Message

Yue Haibing July 25, 2019, 2:41 a.m. UTC
If IOMMU_SUPPORT is not set, and COMPILE_TEST is y,
IOMMU_IOVA may be set to m. So building will fails:

drivers/staging/media/tegra-vde/iommu.o: In function `tegra_vde_iommu_map':
iommu.c:(.text+0x41): undefined reference to `alloc_iova'
iommu.c:(.text+0x56): undefined reference to `__free_iova'

Select IOMMU_IOVA while COMPILE_TEST is set to fix this.

Reported-by: Hulk Robot <hulkci@huawei.com>
Suggested-by: Dmitry Osipenko <digetx@gmail.com>
Fixes: b301f8de1925 ("media: staging: media: tegra-vde: Add IOMMU support")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
---
 drivers/staging/media/tegra-vde/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dmitry Osipenko July 25, 2019, 7:19 a.m. UTC | #1
25.07.2019 5:41, YueHaibing пишет:
> If IOMMU_SUPPORT is not set, and COMPILE_TEST is y,
> IOMMU_IOVA may be set to m. So building will fails:
> 
> drivers/staging/media/tegra-vde/iommu.o: In function `tegra_vde_iommu_map':
> iommu.c:(.text+0x41): undefined reference to `alloc_iova'
> iommu.c:(.text+0x56): undefined reference to `__free_iova'
> 
> Select IOMMU_IOVA while COMPILE_TEST is set to fix this.
> 
> Reported-by: Hulk Robot <hulkci@huawei.com>
> Suggested-by: Dmitry Osipenko <digetx@gmail.com>
> Fixes: b301f8de1925 ("media: staging: media: tegra-vde: Add IOMMU support")
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/staging/media/tegra-vde/Kconfig | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/tegra-vde/Kconfig b/drivers/staging/media/tegra-vde/Kconfig
> index 2e7f644..ba49ea5 100644
> --- a/drivers/staging/media/tegra-vde/Kconfig
> +++ b/drivers/staging/media/tegra-vde/Kconfig
> @@ -3,7 +3,7 @@ config TEGRA_VDE
>  	tristate "NVIDIA Tegra Video Decoder Engine driver"
>  	depends on ARCH_TEGRA || COMPILE_TEST
>  	select DMA_SHARED_BUFFER
> -	select IOMMU_IOVA if IOMMU_SUPPORT
> +	select IOMMU_IOVA if (IOMMU_SUPPORT || COMPILE_TEST)
>  	select SRAM
>  	help
>  	    Say Y here to enable support for the NVIDIA Tegra video decoder
> 

This results in missing the case of compile-testing !IOMMU_IOVA for the
driver, but probably that's not a big deal.

Acked-by: Dmitry Osipenko <digetx@gmail.com>
Arnd Bergmann Sept. 20, 2019, 7:32 p.m. UTC | #2
On Thu, Jul 25, 2019 at 2:24 PM Dmitry Osipenko <digetx@gmail.com> wrote:
>
> 25.07.2019 5:41, YueHaibing пишет:
> > If IOMMU_SUPPORT is not set, and COMPILE_TEST is y,
> > IOMMU_IOVA may be set to m. So building will fails:
> >
> > drivers/staging/media/tegra-vde/iommu.o: In function `tegra_vde_iommu_map':
> > iommu.c:(.text+0x41): undefined reference to `alloc_iova'
> > iommu.c:(.text+0x56): undefined reference to `__free_iova'
> >
> > Select IOMMU_IOVA while COMPILE_TEST is set to fix this.

> > @@ -3,7 +3,7 @@ config TEGRA_VDE
> >       tristate "NVIDIA Tegra Video Decoder Engine driver"
> >       depends on ARCH_TEGRA || COMPILE_TEST
> >       select DMA_SHARED_BUFFER
> > -     select IOMMU_IOVA if IOMMU_SUPPORT
> > +     select IOMMU_IOVA if (IOMMU_SUPPORT || COMPILE_TEST)
> >       select SRAM
> >       help
> >           Say Y here to enable support for the NVIDIA Tegra video decoder
> >
>
> This results in missing the case of compile-testing !IOMMU_IOVA for the
> driver, but probably that's not a big deal.
>
> Acked-by: Dmitry Osipenko <digetx@gmail.com>

I don't know what happened here, but the patch from YueHaibing caused this
error for me, which is very much like the problem it was meant to fix:

drivers/gpu/host1x/dev.o: In function `host1x_probe':
dev.c:(.text+0x1734): undefined reference to `put_iova_domain'
dev.c:(.text+0x1744): undefined reference to `iova_cache_put'
drivers/gpu/host1x/dev.o: In function `host1x_remove':
dev.c:(.text+0x1894): undefined reference to `put_iova_domain'
dev.c:(.text+0x1898): undefined reference to `iova_cache_put'
drivers/gpu/host1x/cdma.o: In function `host1x_cdma_init':
cdma.c:(.text+0x5d0): undefined reference to `alloc_iova'
cdma.c:(.text+0x61c): undefined reference to `__free_iova'
drivers/gpu/host1x/cdma.o: In function `host1x_cdma_deinit':
cdma.c:(.text+0x6c8): undefined reference to `free_iova'
drivers/gpu/host1x/job.o: In function `host1x_job_pin':
job.c:(.text+0x514): undefined reference to `alloc_iova'
job.c:(.text+0x528): undefined reference to `__free_iova'
drivers/gpu/host1x/job.o: In function `host1x_job_unpin':
job.c:(.text+0x5bc): undefined reference to `free_iova'

After reverthing commit 6b2265975239 ("media: staging:
tegra-vde: Fix build error"), I can no longer reproduce the
issue.

       Arnd
Dmitry Osipenko Sept. 20, 2019, 10:26 p.m. UTC | #3
20.09.2019 22:32, Arnd Bergmann пишет:
> On Thu, Jul 25, 2019 at 2:24 PM Dmitry Osipenko <digetx@gmail.com> wrote:
>>
>> 25.07.2019 5:41, YueHaibing пишет:
>>> If IOMMU_SUPPORT is not set, and COMPILE_TEST is y,
>>> IOMMU_IOVA may be set to m. So building will fails:
>>>
>>> drivers/staging/media/tegra-vde/iommu.o: In function `tegra_vde_iommu_map':
>>> iommu.c:(.text+0x41): undefined reference to `alloc_iova'
>>> iommu.c:(.text+0x56): undefined reference to `__free_iova'
>>>
>>> Select IOMMU_IOVA while COMPILE_TEST is set to fix this.
> 
>>> @@ -3,7 +3,7 @@ config TEGRA_VDE
>>>       tristate "NVIDIA Tegra Video Decoder Engine driver"
>>>       depends on ARCH_TEGRA || COMPILE_TEST
>>>       select DMA_SHARED_BUFFER
>>> -     select IOMMU_IOVA if IOMMU_SUPPORT
>>> +     select IOMMU_IOVA if (IOMMU_SUPPORT || COMPILE_TEST)
>>>       select SRAM
>>>       help
>>>           Say Y here to enable support for the NVIDIA Tegra video decoder
>>>
>>
>> This results in missing the case of compile-testing !IOMMU_IOVA for the
>> driver, but probably that's not a big deal.
>>
>> Acked-by: Dmitry Osipenko <digetx@gmail.com>
> 
> I don't know what happened here, but the patch from YueHaibing caused this
> error for me, which is very much like the problem it was meant to fix:
> 
> drivers/gpu/host1x/dev.o: In function `host1x_probe':
> dev.c:(.text+0x1734): undefined reference to `put_iova_domain'
> dev.c:(.text+0x1744): undefined reference to `iova_cache_put'
> drivers/gpu/host1x/dev.o: In function `host1x_remove':
> dev.c:(.text+0x1894): undefined reference to `put_iova_domain'
> dev.c:(.text+0x1898): undefined reference to `iova_cache_put'
> drivers/gpu/host1x/cdma.o: In function `host1x_cdma_init':
> cdma.c:(.text+0x5d0): undefined reference to `alloc_iova'
> cdma.c:(.text+0x61c): undefined reference to `__free_iova'
> drivers/gpu/host1x/cdma.o: In function `host1x_cdma_deinit':
> cdma.c:(.text+0x6c8): undefined reference to `free_iova'
> drivers/gpu/host1x/job.o: In function `host1x_job_pin':
> job.c:(.text+0x514): undefined reference to `alloc_iova'
> job.c:(.text+0x528): undefined reference to `__free_iova'
> drivers/gpu/host1x/job.o: In function `host1x_job_unpin':
> job.c:(.text+0x5bc): undefined reference to `free_iova'
> 
> After reverthing commit 6b2265975239 ("media: staging:
> tegra-vde: Fix build error"), I can no longer reproduce the
> issue.

There is a follow up here: https://patchwork.ozlabs.org/patch/1153176/
diff mbox series

Patch

diff --git a/drivers/staging/media/tegra-vde/Kconfig b/drivers/staging/media/tegra-vde/Kconfig
index 2e7f644..ba49ea5 100644
--- a/drivers/staging/media/tegra-vde/Kconfig
+++ b/drivers/staging/media/tegra-vde/Kconfig
@@ -3,7 +3,7 @@  config TEGRA_VDE
 	tristate "NVIDIA Tegra Video Decoder Engine driver"
 	depends on ARCH_TEGRA || COMPILE_TEST
 	select DMA_SHARED_BUFFER
-	select IOMMU_IOVA if IOMMU_SUPPORT
+	select IOMMU_IOVA if (IOMMU_SUPPORT || COMPILE_TEST)
 	select SRAM
 	help
 	    Say Y here to enable support for the NVIDIA Tegra video decoder