* [PATCH] dma/pool: respect __GFP_NOWARN in dma_alloc_from_pool()
@ 2026-01-11 1:41 Sai Sree Kartheek Adivi
2026-01-12 8:18 ` Leon Romanovsky
0 siblings, 1 reply; 2+ messages in thread
From: Sai Sree Kartheek Adivi @ 2026-01-11 1:41 UTC (permalink / raw)
To: m.szyprowski, robin.murphy, iommu, linux-kernel; +Cc: vigneshr
Currently, dma_alloc_from_pool() unconditionally warns and dumps a stack
trace when an allocation fails.
This prevents callers from using the __GFP_NOWARN flag to suppress error
messages, breaking the expectation that this flag will silence
allocation failure logs.
Align dma_pool behaviour with other core allocators by checking for
__GFP_NOWARN before issuing the warning.
Fixes: 9420139f516d ("dma-pool: fix coherent pool allocations for IOMMU mappings")
Signed-off-by: Sai Sree Kartheek Adivi <s-adivi@ti.com>
---
kernel/dma/pool.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c
index 26392badc36b..40dc2ab9915f 100644
--- a/kernel/dma/pool.c
+++ b/kernel/dma/pool.c
@@ -276,7 +276,8 @@ struct page *dma_alloc_from_pool(struct device *dev, size_t size,
return page;
}
- WARN(1, "Failed to get suitable pool for %s\n", dev_name(dev));
+ if (!(gfp & __GFP_NOWARN))
+ WARN(1, "Failed to get suitable pool for %s\n", dev_name(dev));
return NULL;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] dma/pool: respect __GFP_NOWARN in dma_alloc_from_pool()
2026-01-11 1:41 [PATCH] dma/pool: respect __GFP_NOWARN in dma_alloc_from_pool() Sai Sree Kartheek Adivi
@ 2026-01-12 8:18 ` Leon Romanovsky
0 siblings, 0 replies; 2+ messages in thread
From: Leon Romanovsky @ 2026-01-12 8:18 UTC (permalink / raw)
To: Sai Sree Kartheek Adivi
Cc: m.szyprowski, robin.murphy, iommu, linux-kernel, vigneshr
On Sun, Jan 11, 2026 at 07:11:50AM +0530, Sai Sree Kartheek Adivi wrote:
> Currently, dma_alloc_from_pool() unconditionally warns and dumps a stack
> trace when an allocation fails.
>
> This prevents callers from using the __GFP_NOWARN flag to suppress error
> messages, breaking the expectation that this flag will silence
> allocation failure logs.
>
> Align dma_pool behaviour with other core allocators by checking for
> __GFP_NOWARN before issuing the warning.
>
> Fixes: 9420139f516d ("dma-pool: fix coherent pool allocations for IOMMU mappings")
> Signed-off-by: Sai Sree Kartheek Adivi <s-adivi@ti.com>
> ---
> kernel/dma/pool.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/dma/pool.c b/kernel/dma/pool.c
> index 26392badc36b..40dc2ab9915f 100644
> --- a/kernel/dma/pool.c
> +++ b/kernel/dma/pool.c
> @@ -276,7 +276,8 @@ struct page *dma_alloc_from_pool(struct device *dev, size_t size,
> return page;
> }
>
> - WARN(1, "Failed to get suitable pool for %s\n", dev_name(dev));
> + if (!(gfp & __GFP_NOWARN))
> + WARN(1, "Failed to get suitable pool for %s\n", dev_name(dev));
WARN(!(gfp & __GFP_NOWARN), "Failed to get suitable pool for %s\n", dev_name(dev));
Thanks
> return NULL;
> }
>
> --
> 2.34.1
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-01-12 8:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-11 1:41 [PATCH] dma/pool: respect __GFP_NOWARN in dma_alloc_from_pool() Sai Sree Kartheek Adivi
2026-01-12 8:18 ` Leon Romanovsky
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.