Re: [PATCH 4/4] DMA: XILINX_ZYNQMP_DPDMA depends on HAS_IOMEM

From: Randy Dunlap
Date: Sat May 22 2021 - 21:53:16 EST


On 5/22/21 5:20 PM, Laurent Pinchart wrote:
> Hi Randy,
>
> Thank you for the patch.
>
> On Fri, May 21, 2021 at 07:13:13PM -0700, Randy Dunlap wrote:
>> When CONFIG_HAS_IOMEM is not set/enabled, most iomap() family
>> functions [including ioremap(), devm_ioremap(), etc.] are not
>> available.
>> Drivers that use these functions should depend on HAS_IOMEM so that
>> they do not cause build errors.
>>
>> Cures this build error:
>> s390-linux-ld: drivers/dma/xilinx/xilinx_dpdma.o: in function `xilinx_dpdma_probe':
>> xilinx_dpdma.c:(.text+0x336a): undefined reference to `devm_platform_ioremap_resource'
>
> I've previously posted
> https://lore.kernel.org/dmaengine/20210520152420.23986-2-laurent.pinchart@xxxxxxxxxxxxxxxx/T/#u
> which fixes the same issue (plus an additional one).

Hi Laurent,

I didn't add a dependency on OF because OF header files _mostly_
have stubs so that they work when OF is enabled or disabled.

I did find a problem in <linux/of_address.h> where it could end up
without having a stub. I will post a patch for that soon.
I'm currently doing lots of randconfig builds on it.

Thanks.

>> Fixes: 7cbb0c63de3fc ("dmaengine: xilinx: dpdma: Add the Xilinx DisplayPort DMA engine driver")
>> Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
>> Reported-by: kernel test robot <lkp@xxxxxxxxx>
>> Cc: Vinod Koul <vkoul@xxxxxxxxxx>
>> CC: dmaengine@xxxxxxxxxxxxxxx
>> Cc: Hyun Kwon <hyun.kwon@xxxxxxxxxx>
>> Cc: Tejas Upadhyay <tejasu@xxxxxxxxxx>
>> Cc: Michal Simek <michal.simek@xxxxxxxxxx>
>> Cc: Laurent Pinchart <laurent.pinchart@xxxxxxxxxxxxxxxx>
>> ---
>> drivers/dma/Kconfig | 1 +
>> 1 file changed, 1 insertion(+)
>>
>> --- linux-next-20210521.orig/drivers/dma/Kconfig
>> +++ linux-next-20210521/drivers/dma/Kconfig
>> @@ -702,6 +702,7 @@ config XILINX_ZYNQMP_DMA
>>
>> config XILINX_ZYNQMP_DPDMA
>> tristate "Xilinx DPDMA Engine"
>> + depends on HAS_IOMEM
>> select DMA_ENGINE
>> select DMA_VIRTUAL_CHANNELS
>> help
>


--
~Randy