Skip to contentSkip to conversation

dma-buf: Add missing dependencies on DMA_SHARED_BUFFER

PATCH In review Geert Uytterhoeven 2 participants 5 messages Sep 2, 2021 – Sep 3, 2021

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

cover dma-buf: Add missing dependencies on DMA_SHARED_BUFFER

Hi Sumit, Christian,

This patch series adds missing dependencies on DMA_SHARED_BUFFER to various options of DMA-BUF, and drops a bogus select.

As drivers/dma-buf/Kconfig contains interleaved options that select or depend on DMA_SHARED_BUFFER, they can't be wrapped inside a big "if DMA_SHARED_BUFFER / endif" block.

Thanks!

Geert Uytterhoeven (3):
dma-buf: DMABUF_MOVE_NOTIFY should depend on DMA_SHARED_BUFFER
dma-buf: DMABUF_DEBUG should depend on DMA_SHARED_BUFFER
dma-buf: DMABUF_SYSFS_STATS should depend on DMA_SHARED_BUFFER

 drivers/dma-buf/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 12 lines
2.25.1

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
							    -- Linus Torvalds
#1 lore raw

PATCH 1/3 dma-buf: DMABUF_MOVE_NOTIFY should depend on DMA_SHARED_BUFFER

Move notify between drivers is an option of DMA-BUF. Enabling DMABUF_MOVE_NOTIFY without DMA_SHARED_BUFFER does not have any impact, as drivers/dma-buf/ is not entered during the build when DMA_SHARED_BUFFER is disabled.

Fixes bb42df4662a44765 ("dma-buf: add dynamic DMA-buf handling v15")
---
 drivers/dma-buf/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/dma-buf/Kconfig +1 -0
index 9561e3d2d4285d55..de5a17c40a33d336 100644
@@ -42,6 +42,7 @@ config UDMABUF
 config DMABUF_MOVE_NOTIFY
 	bool "Move notify between drivers (EXPERIMENTAL)"
 	default n
+	depends on DMA_SHARED_BUFFER
 	help
 	  Don't pin buffers if the dynamic DMA-buf interface is available on
 	  both the exporter as well as the importer. This fixes a security
Signature · 1 line
2.25.1
#2 lore raw

PATCH 2/3 dma-buf: DMABUF_DEBUG should depend on DMA_SHARED_BUFFER

In reply to Geert Uytterhoeven

DMA-BUF debug checks are an option of DMA-BUF. Enabling DMABUF_DEBUG without DMA_SHARED_BUFFER does not have any impact, as drivers/dma-buf/ is not entered during the build when DMA_SHARED_BUFFER is disabled.

Fixes 84335675f2223cbd ("dma-buf: Add debug option")
---
 drivers/dma-buf/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/dma-buf/Kconfig +1 -0
index de5a17c40a33d336..d53782f4f51b54f7 100644
@@ -53,6 +53,7 @@ config DMABUF_MOVE_NOTIFY
 
 config DMABUF_DEBUG
 	bool "DMA-BUF debug checks"
+	depends on DMA_SHARED_BUFFER
 	default y if DMA_API_DEBUG
 	help
 	  This option enables additional checks for DMA-BUF importers and
Signature · 1 line
2.25.1
#3 lore raw

PATCH 3/3 dma-buf: DMABUF_SYSFS_STATS should depend on DMA_SHARED_BUFFER

In reply to Geert Uytterhoeven

DMA-BUF sysfs statistics are an option of DMA-BUF. It does not make much sense to bother the user with a question about DMA-BUF sysfs statistics if DMA-BUF itself is not enabled. Worse, enabling the statistics enables the feature.

Fixes bdb8d06dfefd666d ("dmabuf: Add the capability to expose DMA-BUF stats in sysfs")
---
 drivers/dma-buf/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma-buf/Kconfig +1 -1
index d53782f4f51b54f7..541efe01abc7c432 100644
@@ -76,7 +76,7 @@ menuconfig DMABUF_HEAPS
 
 menuconfig DMABUF_SYSFS_STATS
 	bool "DMA-BUF sysfs statistics"
-	select DMA_SHARED_BUFFER
+	depends on DMA_SHARED_BUFFER
 	help
 	   Choose this option to enable DMA-BUF sysfs statistics
 	   in location /sys/kernel/dmabuf/buffers.
Signature · 1 line
2.25.1
maintainer
#4 lore raw
In reply to Geert Uytterhoeven

Hello Geert,

Quoted 9 lines · Geert Uytterhoeven

Hi Sumit, Christian,

This patch series adds missing dependencies on DMA_SHARED_BUFFER to various options of DMA-BUF, and drops a bogus select.

As drivers/dma-buf/Kconfig contains interleaved options that select or depend on DMA_SHARED_BUFFER, they can't be wrapped inside a big "if DMA_SHARED_BUFFER / endif" block.

Thanks for catching these issues and the patch-set. LGTM!

I'll apply them over.

Quoted 16 lines

Thanks!

Geert Uytterhoeven (3):
dma-buf: DMABUF_MOVE_NOTIFY should depend on DMA_SHARED_BUFFER
dma-buf: DMABUF_DEBUG should depend on DMA_SHARED_BUFFER
dma-buf: DMABUF_SYSFS_STATS should depend on DMA_SHARED_BUFFER

 drivers/dma-buf/Kconfig | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--
2.25.1

Gr{oetje,eeting}s,

Quoted 8 lines

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds

Best,
Sumit.