* [PATCH] dma-buf: Make DMABUF_DEBUG default to y on DEBUG_KERNEL kernels
@ 2026-09-07 2:00 Karl Mehltretter
2026-09-07 2:05 ` sashiko-bot
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Karl Mehltretter @ 2026-09-07 2:00 UTC (permalink / raw)
To: Sumit Semwal, Christian König
Cc: Karl Mehltretter, linux-media, dri-devel, linaro-mm-sig
Commit 646013f513f3 ("dma-buf: enable DMABUF_DEBUG by default on DEBUG
kernels") changed the default of DMABUF_DEBUG to "y if DEBUG", but no
Kconfig symbol DEBUG exists, so the option has had no default since.
Use DEBUG_KERNEL, the Kconfig symbol for a debug kernel.
Fixes: 646013f513f3 ("dma-buf: enable DMABUF_DEBUG by default on DEBUG kernels")
Assisted-by: LLM
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
---
This enables the dma-buf debug checks on every CONFIG_DEBUG_KERNEL
configuration, which is what 646013f513f3 set out to do. If that is too
broad today, the alternative is to restore the previous
"default y if DMA_API_DEBUG".
drivers/dma-buf/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma-buf/Kconfig b/drivers/dma-buf/Kconfig
index 7efc0f0d0712..e4f078a326a4 100644
--- a/drivers/dma-buf/Kconfig
+++ b/drivers/dma-buf/Kconfig
@@ -43,7 +43,7 @@ config UDMABUF
config DMABUF_DEBUG
bool "DMA-BUF debug checks"
depends on DMA_SHARED_BUFFER
- default y if DEBUG
+ default y if DEBUG_KERNEL
help
This option enables additional checks for DMA-BUF importers and
exporters. Specifically it validates that importers do not peek at the
base-commit: 986c24e0fe44f844b44d365b71ce831947f50298
--
2.53.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] dma-buf: Make DMABUF_DEBUG default to y on DEBUG_KERNEL kernels
2026-09-07 2:00 [PATCH] dma-buf: Make DMABUF_DEBUG default to y on DEBUG_KERNEL kernels Karl Mehltretter
@ 2026-09-07 2:05 ` sashiko-bot
2026-09-11 10:03 ` Christian König
2026-09-28 19:28 ` Diederik de Haas
2 siblings, 0 replies; 6+ messages in thread
From: sashiko-bot @ 2026-09-07 2:05 UTC (permalink / raw)
To: Karl Mehltretter; +Cc: dri-devel, media-ci
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] Using DEBUG_KERNEL as a default trigger for DMABUF_DEBUG unintentionally enables performance-degrading debug checks on production kernels.
--
commit 35e36d45a9285f1874efd2a5212588eb662aa118
Author: Karl Mehltretter <kmehltretter@gmail.com>
dma-buf: Make DMABUF_DEBUG default to y on DEBUG_KERNEL kernels
This commit replaces the non-existent DEBUG Kconfig symbol with DEBUG_KERNEL
to ensure DMA-BUF debug checks are enabled on debug kernels.
> diff --git a/drivers/dma-buf/Kconfig b/drivers/dma-buf/Kconfig
> index 7efc0f0d07126..e4f078a326a41 100644
> --- a/drivers/dma-buf/Kconfig
> +++ b/drivers/dma-buf/Kconfig
> @@ -43,7 +43,7 @@ config UDMABUF
> config DMABUF_DEBUG
> bool "DMA-BUF debug checks"
> depends on DMA_SHARED_BUFFER
> - default y if DEBUG
> + default y if DEBUG_KERNEL
[Severity: Medium]
Will tying this default to DEBUG_KERNEL unintentionally cause a performance
regression on production kernels?
Because DEBUG_KERNEL is a top-level menu toggle enabled in virtually all
production configurations and standard distributions, DMABUF_DEBUG will now
be universally enabled by default.
This introduces unnecessary dynamic heap allocations and scatterlist copying
in dma_buf_map_attachment() via dma_buf_wrap_sg_table() during frequent map
and unmap operations.
Could this be tied to a more specific debugging option instead to prevent
this regression on production systems?
> help
> This option enables additional checks for DMA-BUF importers and
> exporters. Specifically it validates that importers do not peek at the
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260907020015.24719-1-kmehltretter@gmail.com?part=1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] dma-buf: Make DMABUF_DEBUG default to y on DEBUG_KERNEL kernels
2026-09-07 2:00 [PATCH] dma-buf: Make DMABUF_DEBUG default to y on DEBUG_KERNEL kernels Karl Mehltretter
2026-09-07 2:05 ` sashiko-bot
@ 2026-09-11 10:03 ` Christian König
2026-09-28 19:28 ` Diederik de Haas
2 siblings, 0 replies; 6+ messages in thread
From: Christian König @ 2026-09-11 10:03 UTC (permalink / raw)
To: Karl Mehltretter, Sumit Semwal; +Cc: linux-media, dri-devel, linaro-mm-sig
On 9/7/26 04:00, Karl Mehltretter wrote:
> Commit 646013f513f3 ("dma-buf: enable DMABUF_DEBUG by default on DEBUG
> kernels") changed the default of DMABUF_DEBUG to "y if DEBUG", but no
> Kconfig symbol DEBUG exists, so the option has had no default since.
>
> Use DEBUG_KERNEL, the Kconfig symbol for a debug kernel.
>
> Fixes: 646013f513f3 ("dma-buf: enable DMABUF_DEBUG by default on DEBUG kernels")
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Reviewed and pushed to drm-misc-fixes.
Thanks,
Christian.
> ---
> This enables the dma-buf debug checks on every CONFIG_DEBUG_KERNEL
> configuration, which is what 646013f513f3 set out to do. If that is too
> broad today, the alternative is to restore the previous
> "default y if DMA_API_DEBUG".
>
> drivers/dma-buf/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma-buf/Kconfig b/drivers/dma-buf/Kconfig
> index 7efc0f0d0712..e4f078a326a4 100644
> --- a/drivers/dma-buf/Kconfig
> +++ b/drivers/dma-buf/Kconfig
> @@ -43,7 +43,7 @@ config UDMABUF
> config DMABUF_DEBUG
> bool "DMA-BUF debug checks"
> depends on DMA_SHARED_BUFFER
> - default y if DEBUG
> + default y if DEBUG_KERNEL
> help
> This option enables additional checks for DMA-BUF importers and
> exporters. Specifically it validates that importers do not peek at the
>
> base-commit: 986c24e0fe44f844b44d365b71ce831947f50298
> --
> 2.53.0
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] dma-buf: Make DMABUF_DEBUG default to y on DEBUG_KERNEL kernels
2026-09-07 2:00 [PATCH] dma-buf: Make DMABUF_DEBUG default to y on DEBUG_KERNEL kernels Karl Mehltretter
@ 2026-09-28 19:28 ` Diederik de Haas
2026-09-11 10:03 ` Christian König
2026-09-28 19:28 ` Diederik de Haas
2 siblings, 0 replies; 6+ messages in thread
From: Diederik de Haas @ 2026-09-28 19:28 UTC (permalink / raw)
To: Karl Mehltretter, Sumit Semwal, Christian König
Cc: linux-media, dri-devel, linaro-mm-sig, Sandy Huang,
Heiko Stübner, Andy Yan, linux-rockchip, Detlev Casanova,
Jonas Karlman
On Mon Sep 7, 2026 at 4:00 AM CEST, Karl Mehltretter wrote:
> Commit 646013f513f3 ("dma-buf: enable DMABUF_DEBUG by default on DEBUG
> kernels") changed the default of DMABUF_DEBUG to "y if DEBUG", but no
> Kconfig symbol DEBUG exists, so the option has had no default since.
>
> Use DEBUG_KERNEL, the Kconfig symbol for a debug kernel.
I wondered why since 7.3-rc4 when playing videos I got a WHOLE lot of the
following error messages, which weren't there with 7.3-rc3:
[drm:rockchip_gem_iommu_map [rockchipdrm]] *ERROR* failed to map buffer: size=0 request_size=3956736
[drm:rockchip_gem_prime_import_sg_table [rockchipdrm]] *ERROR* failed to import sg table: -12
Both come from ``drivers/gpu/drm/rockchip/rockchip_drm_gem.c``.
The value of request_size varies sometimes; I see ``request_size=8294400``
the most. When playing a video (with mpv with v4l2request functionality, but
I think that doesn't matter), I see a whole bunch of these errors and then
it stays 'silent', but I get another stream of them when I resize the window
(ie I'm toggling between windowed and full-screen).
It doesn't take long before dmesg only consists of these errors.
The 'playing video' is likely important; when I just start sway I don't see
those errors. It's only when I start a video that those pop up.
My kernel (config) is based on Debian's and that has ``DEBUG_KERNEL=y`` at
least since 2008 and due to this patch/commit, ``DMABUF_DEBUG`` got turned on.
When I explicitly disable ``DMABUF_DEBUG``, I no longer see those errors.
Whether that fixes or just hides a problem, I'll leave that for others to
decide.
> Fixes: 646013f513f3 ("dma-buf: enable DMABUF_DEBUG by default on DEBUG kernels")
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
> ---
> This enables the dma-buf debug checks on every CONFIG_DEBUG_KERNEL
> configuration, which is what 646013f513f3 set out to do. If that is too
> broad today, the alternative is to restore the previous
> "default y if DMA_API_DEBUG".
My 0.02:
That change landed in 7.0-rc1 albeit it didn't have the effect it intended
to achieve. An -rc1 version seems like the right version to land such a change.
I'm not in favor of this just popping up in 7.3-rc4 while -rc3 did NOT have
that affect. With an -rc1 you'd expect major changes, but in this case I
accidentally stumbled upon it while trying out something else.
Cheers,
Diederik
> drivers/dma-buf/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma-buf/Kconfig b/drivers/dma-buf/Kconfig
> index 7efc0f0d0712..e4f078a326a4 100644
> --- a/drivers/dma-buf/Kconfig
> +++ b/drivers/dma-buf/Kconfig
> @@ -43,7 +43,7 @@ config UDMABUF
> config DMABUF_DEBUG
> bool "DMA-BUF debug checks"
> depends on DMA_SHARED_BUFFER
> - default y if DEBUG
> + default y if DEBUG_KERNEL
> help
> This option enables additional checks for DMA-BUF importers and
> exporters. Specifically it validates that importers do not peek at the
>
> base-commit: 986c24e0fe44f844b44d365b71ce831947f50298
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] dma-buf: Make DMABUF_DEBUG default to y on DEBUG_KERNEL kernels
@ 2026-09-28 19:28 ` Diederik de Haas
0 siblings, 0 replies; 6+ messages in thread
From: Diederik de Haas @ 2026-09-28 19:28 UTC (permalink / raw)
To: Karl Mehltretter, Sumit Semwal, Christian König
Cc: linux-media, dri-devel, linaro-mm-sig, Sandy Huang,
Heiko Stübner, Andy Yan, linux-rockchip, Detlev Casanova,
Jonas Karlman
On Mon Sep 7, 2026 at 4:00 AM CEST, Karl Mehltretter wrote:
> Commit 646013f513f3 ("dma-buf: enable DMABUF_DEBUG by default on DEBUG
> kernels") changed the default of DMABUF_DEBUG to "y if DEBUG", but no
> Kconfig symbol DEBUG exists, so the option has had no default since.
>
> Use DEBUG_KERNEL, the Kconfig symbol for a debug kernel.
I wondered why since 7.3-rc4 when playing videos I got a WHOLE lot of the
following error messages, which weren't there with 7.3-rc3:
[drm:rockchip_gem_iommu_map [rockchipdrm]] *ERROR* failed to map buffer: size=0 request_size=3956736
[drm:rockchip_gem_prime_import_sg_table [rockchipdrm]] *ERROR* failed to import sg table: -12
Both come from ``drivers/gpu/drm/rockchip/rockchip_drm_gem.c``.
The value of request_size varies sometimes; I see ``request_size=8294400``
the most. When playing a video (with mpv with v4l2request functionality, but
I think that doesn't matter), I see a whole bunch of these errors and then
it stays 'silent', but I get another stream of them when I resize the window
(ie I'm toggling between windowed and full-screen).
It doesn't take long before dmesg only consists of these errors.
The 'playing video' is likely important; when I just start sway I don't see
those errors. It's only when I start a video that those pop up.
My kernel (config) is based on Debian's and that has ``DEBUG_KERNEL=y`` at
least since 2008 and due to this patch/commit, ``DMABUF_DEBUG`` got turned on.
When I explicitly disable ``DMABUF_DEBUG``, I no longer see those errors.
Whether that fixes or just hides a problem, I'll leave that for others to
decide.
> Fixes: 646013f513f3 ("dma-buf: enable DMABUF_DEBUG by default on DEBUG kernels")
> Assisted-by: LLM
> Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
> ---
> This enables the dma-buf debug checks on every CONFIG_DEBUG_KERNEL
> configuration, which is what 646013f513f3 set out to do. If that is too
> broad today, the alternative is to restore the previous
> "default y if DMA_API_DEBUG".
My 0.02:
That change landed in 7.0-rc1 albeit it didn't have the effect it intended
to achieve. An -rc1 version seems like the right version to land such a change.
I'm not in favor of this just popping up in 7.3-rc4 while -rc3 did NOT have
that affect. With an -rc1 you'd expect major changes, but in this case I
accidentally stumbled upon it while trying out something else.
Cheers,
Diederik
> drivers/dma-buf/Kconfig | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/dma-buf/Kconfig b/drivers/dma-buf/Kconfig
> index 7efc0f0d0712..e4f078a326a4 100644
> --- a/drivers/dma-buf/Kconfig
> +++ b/drivers/dma-buf/Kconfig
> @@ -43,7 +43,7 @@ config UDMABUF
> config DMABUF_DEBUG
> bool "DMA-BUF debug checks"
> depends on DMA_SHARED_BUFFER
> - default y if DEBUG
> + default y if DEBUG_KERNEL
> help
> This option enables additional checks for DMA-BUF importers and
> exporters. Specifically it validates that importers do not peek at the
>
> base-commit: 986c24e0fe44f844b44d365b71ce831947f50298
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] dma-buf: Make DMABUF_DEBUG default to y on DEBUG_KERNEL kernels
2026-09-28 19:28 ` Diederik de Haas
(?)
@ 2026-10-05 9:05 ` Diederik de Haas
-1 siblings, 0 replies; 6+ messages in thread
From: Diederik de Haas @ 2026-10-05 9:05 UTC (permalink / raw)
To: linux-rockchip
On Mon Sep 28, 2026 at 9:28 PM CEST, Diederik de Haas wrote:
> On Mon Sep 7, 2026 at 4:00 AM CEST, Karl Mehltretter wrote:
>> Commit 646013f513f3 ("dma-buf: enable DMABUF_DEBUG by default on DEBUG
>> kernels") changed the default of DMABUF_DEBUG to "y if DEBUG", but no
>> Kconfig symbol DEBUG exists, so the option has had no default since.
>>
>> Use DEBUG_KERNEL, the Kconfig symbol for a debug kernel.
>
> I wondered why since 7.3-rc4 when playing videos I got a WHOLE lot of the
> following error messages, which weren't there with 7.3-rc3:
>
> [drm:rockchip_gem_iommu_map [rockchipdrm]] *ERROR* failed to map buffer: size=0 request_size=3956736
> [drm:rockchip_gem_prime_import_sg_table [rockchipdrm]] *ERROR* failed to import sg table: -12
>
> Both come from ``drivers/gpu/drm/rockchip/rockchip_drm_gem.c``.
>
> ...
>
> When I explicitly disable ``DMABUF_DEBUG``, I no longer see those errors.
>
> Whether that fixes or just hides a problem, I'll leave that for others to
> decide.
It seems it hides the problem. Follow up with more context/links:
https://lore.kernel.org/all/20261005064133.7305-1-kmehltretter@gmail.com/
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2026-10-05 9:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-07 2:00 [PATCH] dma-buf: Make DMABUF_DEBUG default to y on DEBUG_KERNEL kernels Karl Mehltretter
2026-09-07 2:05 ` sashiko-bot
2026-09-11 10:03 ` Christian König
2026-09-28 19:28 ` Diederik de Haas
2026-09-28 19:28 ` Diederik de Haas
2026-10-05 9:05 ` Diederik de Haas
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.