From: Leon Romanovsky <leon@kernel.org>
To: Sai Sree Kartheek Adivi <s-adivi@ti.com>
Cc: m.szyprowski@samsung.com, robin.murphy@arm.com,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org,
vigneshr@ti.com
Subject: Re: [PATCH] dma/pool: respect __GFP_NOWARN in dma_alloc_from_pool()
Date: Mon, 12 Jan 2026 10:18:25 +0200 [thread overview]
Message-ID: <20260112081825.GC14378@unreal> (raw)
In-Reply-To: <20260111014150.2411570-1-s-adivi@ti.com>
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
>
>
prev parent reply other threads:[~2026-01-12 8:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
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 message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260112081825.GC14378@unreal \
--to=leon@kernel.org \
--cc=iommu@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.com \
--cc=s-adivi@ti.com \
--cc=vigneshr@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox