Skip to contentSkip to conversation

DMA: several drivers depend on HAS_IOMEM

PATCH In review Randy Dunlap 4 participants 12 messages May 22, 2021 – May 31, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover DMA: several drivers depend on HAS_IOMEM

A few drivers in drivers/dma/ use iomap(), ioremap(), devm_ioremap(), etc. Building these drivers when CONFIG_HAS_IOMEM is not set results in build errors, so make these drivers depend on HAS_IOMEM.

Cc Stefan Roese <[email protected]>
Cc Vinod Koul <[email protected]>
Cc Sinan Kaya <[email protected]>
Cc Green Wan <[email protected]>
Cc Hyun Kwon <[email protected]>
Cc Tejas Upadhyay <[email protected]>
Cc Michal Simek <[email protected]>
Cc Laurent Pinchart <[email protected]>

[PATCH 1/4] DMA: ALTERA_MSGDMA depends on HAS_IOMEM [PATCH 2/4] DMA: QCOM_HIDMA_MGMT depends on HAS_IOMEM [PATCH 3/4] DMA: SF_PDMA depends on HAS_IOMEM [PATCH 4/4] DMA: XILINX_ZYNQMP_DPDMA depends on HAS_IOMEM

 Kconfig |    4 ++++
 1 file changed, 4 insertions(+)
#1 lore raw

PATCH 1/4 DMA: ALTERA_MSGDMA depends on HAS_IOMEM

When CONFIG_HAS_IOMEM is not set/enabled, certain 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.

Repairs this build error:
s390-linux-ld: drivers/dma/altera-msgdma.o: in function `request_and_map':
altera-msgdma.c:(.text+0x14b0): undefined reference to `devm_ioremap'

Fixes a85c6f1b2921 ("dmaengine: Add driver for Altera / Intel mSGDMA IP core")
Cc Stefan Roese <[email protected]>
Cc Vinod Koul <[email protected]>
---
 drivers/dma/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/dma/Kconfig +1 -0
@@ -59,6 +59,7 @@ config DMA_OF
 #devices
 config ALTERA_MSGDMA
 	tristate "Altera / Intel mSGDMA Engine"
+	depends on HAS_IOMEM
 	select DMA_ENGINE
 	help
 	  Enable support for Altera / Intel mSGDMA controller.
Reviewed-by on v1 1/4
#2 lore raw

Re: [PATCH 1/4] DMA: ALTERA_MSGDMA depends on HAS_IOMEM

Quoted 10 lines · Randy Dunlap

When CONFIG_HAS_IOMEM is not set/enabled, certain 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.

Repairs this build error:
s390-linux-ld: drivers/dma/altera-msgdma.o: in function `request_and_map':
altera-msgdma.c:(.text+0x14b0): undefined reference to `devm_ioremap'

Quoted 6 lines
Fixes a85c6f1b2921 ("dmaengine: Add driver for Altera / Intel mSGDMA IP core")
Cc Stefan Roese <[email protected]>
Cc Vinod Koul <[email protected]>

Thanks,
Stefan

Quoted 8 lines
---
  drivers/dma/Kconfig |    1 +
  1 file changed, 1 insertion(+)

drivers/dma/Kconfig config DMA_OF · line 65

Quoted 7 lines
drivers/dma/Kconfig +1 -0
@@ -59,6 +59,7 @@ config DMA_OF
  #devices
  config ALTERA_MSGDMA
  	tristate "Altera / Intel mSGDMA Engine"
+	depends on HAS_IOMEM
  	select DMA_ENGINE
  	help
  	  Enable support for Altera / Intel mSGDMA controller.

Viele Grüße,
Stefan

Signature · 3 lines
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: [email protected]
#3 lore raw

PATCH 2/4 DMA: QCOM_HIDMA_MGMT depends on HAS_IOMEM

In reply to Randy Dunlap

When CONFIG_HAS_IOMEM is not set/enabled, certain 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.

Rectifies these build errors:
s390-linux-ld: drivers/dma/qcom/hidma_mgmt.o: in function `hidma_mgmt_probe':
hidma_mgmt.c:(.text+0x780): undefined reference to `devm_ioremap_resource'
s390-linux-ld: drivers/dma/qcom/hidma_mgmt.o: in function `hidma_mgmt_init':
hidma_mgmt.c:(.init.text+0x126): undefined reference to `of_address_to_resource'
s390-linux-ld: hidma_mgmt.c:(.init.text+0x16e): undefined reference to `of_address_to_resource'

Fixes 67a2003e0607 ("dmaengine: add Qualcomm Technologies HIDMA channel driver")
Cc Sinan Kaya <[email protected]>
Cc Vinod Koul <[email protected]>
---
 drivers/dma/qcom/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/dma/qcom/Kconfig +1 -0
@@ -33,6 +33,7 @@ config QCOM_GPI_DMA
 
 config QCOM_HIDMA_MGMT
 	tristate "Qualcomm Technologies HIDMA Management support"
+	depends on HAS_IOMEM
 	select DMA_ENGINE
 	help
 	  Enable support for the Qualcomm Technologies HIDMA Management.
#4 lore raw

PATCH 3/4 DMA: SF_PDMA depends on HAS_IOMEM

In reply to Randy Dunlap

When CONFIG_HAS_IOMEM is not set/enabled, certain 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.

Mends this build error:
s390-linux-ld: drivers/dma/sf-pdma/sf-pdma.o: in function `sf_pdma_probe':
sf-pdma.c:(.text+0x1668): undefined reference to `devm_ioremap_resource'

Fixes 6973886ad58e ("dmaengine: sf-pdma: add platform DMA support for HiFive Unleashed A00")
Cc Green Wan <[email protected]>
Cc Vinod Koul <[email protected]>
---
 drivers/dma/sf-pdma/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/dma/sf-pdma/Kconfig +1 -0
@@ -1,5 +1,6 @@
 config SF_PDMA
 	tristate "Sifive PDMA controller driver"
+	depends on HAS_IOMEM
 	select DMA_ENGINE
 	select DMA_VIRTUAL_CHANNELS
 	help
#5 lore raw

PATCH 4/4 DMA: XILINX_ZYNQMP_DPDMA depends on HAS_IOMEM

In reply to Randy Dunlap

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'

Fixes 7cbb0c63de3fc ("dmaengine: xilinx: dpdma: Add the Xilinx DisplayPort DMA engine driver")
Cc Vinod Koul <[email protected]>
Cc Hyun Kwon <[email protected]>
Cc Tejas Upadhyay <[email protected]>
Cc Michal Simek <[email protected]>
Cc Laurent Pinchart <[email protected]>
---
 drivers/dma/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/dma/Kconfig +1 -0
@@ -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
#6 lore raw

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

Hi Randy,

Thank you for the patch.

Quoted 9 lines · Randy Dunlap

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/[email protected]/T/#u
which fixes the same issue (plus an additional one).

Quoted 23 lines
Fixes 7cbb0c63de3fc ("dmaengine: xilinx: dpdma: Add the Xilinx DisplayPort DMA engine driver")
Cc Vinod Koul <[email protected]>
Cc Hyun Kwon <[email protected]>
Cc Tejas Upadhyay <[email protected]>
Cc Michal Simek <[email protected]>
Cc Laurent Pinchart <[email protected]>
---
 drivers/dma/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/dma/Kconfig +1 -0
@@ -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
Signature · 3 lines
Regards,

Laurent Pinchart
#7 lore raw

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

Quoted 11 lines · Laurent Pinchart

Hi Randy,

Thank you for the patch.

Quoted 6 lines · Randy Dunlap

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.

Quoted 7 lines
Quoted 3 lines

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/[email protected]/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.

Quoted 24 lines
Quoted 23 lines
Fixes 7cbb0c63de3fc ("dmaengine: xilinx: dpdma: Add the Xilinx DisplayPort DMA engine driver")
Cc Vinod Koul <[email protected]>
Cc Hyun Kwon <[email protected]>
Cc Tejas Upadhyay <[email protected]>
Cc Michal Simek <[email protected]>
Cc Laurent Pinchart <[email protected]>
---
 drivers/dma/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/dma/Kconfig +1 -0
@@ -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
Signature · 1 line
~Randy
Reviewed-by
#8 lore raw

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

Hi Randy,

Quoted 16 lines · Randy Dunlap
Quoted 7 lines · Laurent Pinchart
Quoted 6 lines · Randy Dunlap

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.

Quoted 7 lines
Quoted 3 lines

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/[email protected]/T/#u
which fixes the same issue (plus an additional one).

Quoted 8 lines

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.

I'm fine with eithe approach, but the patch you've posted to address the of_address.h issue has an issue itself.

If Vinod would prefer merging this patch instead of mine,

Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Fixes 7cbb0c63de3fc ("dmaengine: xilinx: dpdma: Add the Xilinx DisplayPort DMA engine driver")
Cc Vinod Koul <[email protected]>
Cc Hyun Kwon <[email protected]>
Cc Tejas Upadhyay <[email protected]>
Cc Michal Simek <[email protected]>
Cc Laurent Pinchart <[email protected]>
---
 drivers/dma/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/dma/Kconfig +1 -0
@@ -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
Signature · 3 lines
Regards,

Laurent Pinchart
#9 lore raw

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

Quoted 24 lines · Laurent Pinchart

Hi Randy,

Quoted 21 lines · Randy Dunlap
Quoted 7 lines · Laurent Pinchart
Quoted 6 lines · Randy Dunlap

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.

Quoted 7 lines
Quoted 3 lines

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/[email protected]/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.

Quoted 6 lines
Quoted 3 lines

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.

I'm fine with eithe approach, but the patch you've posted to address the of_address.h issue has an issue itself.

I'm also fine with either patch.
I'm reworking the of_address.h patch now.

Thanks.

Quoted 28 lines

If Vinod would prefer merging this patch instead of mine,

Quoted 23 lines
Quoted 23 lines
Quoted 23 lines
Fixes 7cbb0c63de3fc ("dmaengine: xilinx: dpdma: Add the Xilinx DisplayPort DMA engine driver")
Cc Vinod Koul <[email protected]>
Cc Hyun Kwon <[email protected]>
Cc Tejas Upadhyay <[email protected]>
Cc Michal Simek <[email protected]>
Cc Laurent Pinchart <[email protected]>
---
 drivers/dma/Kconfig |    1 +
 1 file changed, 1 insertion(+)
drivers/dma/Kconfig +1 -0
@@ -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
Signature · 1 line
~Randy
maintainer
#10 lore raw

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

Quoted 29 lines · Randy Dunlap
Quoted 28 lines · Laurent Pinchart

Hi Randy,

Quoted 24 lines · Randy Dunlap
Quoted 7 lines · Laurent Pinchart
Quoted 6 lines · Randy Dunlap

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.

Quoted 7 lines
Quoted 3 lines

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/[email protected]/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.

Quoted 5 lines
Quoted 2 lines

I'm fine with eithe approach, but the patch you've posted to address the of_address.h issue has an issue itself.

I'm also fine with either patch.
I'm reworking the of_address.h patch now.

Back from vacation and clearing inbox... I have already applied Laurents patch for this...

Thanks

Signature · 1 line
~Vinod
maintainer
#11 lore raw
In reply to Randy Dunlap
Quoted 3 lines · Randy Dunlap

A few drivers in drivers/dma/ use iomap(), ioremap(), devm_ioremap(), etc. Building these drivers when CONFIG_HAS_IOMEM is not set results in build errors, so make these drivers depend on HAS_IOMEM.

Applied 1-3, thanks

Also susbsystem tag is "dmanengine:" I have fixed that up while applying

Signature · 1 line
~Vinod