From: Sean Anderson <sean.anderson@linux.dev>
To: Donggeun Yoo <donggeunyoo.kernel@gmail.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>,
Robin Murphy <robin.murphy@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
iommu@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dma-mapping: don't trace the DMA address when the allocation fails
Date: Sat, 5 Sep 2026 14:37:05 -0400 [thread overview]
Message-ID: <b36f40ac-cd77-a480-d558-139334334b16@linux.dev> (raw)
In-Reply-To: <20260905172650.158565-1-donggeunyoo.kernel@gmail.com>
On 9/5/26 13:26, Donggeun Yoo wrote:
> On 9/5/26 08:57, Sean Anderson wrote:
>> I don't understand what you mean. We are literally in an if-statement
>> that checks whether the allocation succeeded.
>
> That if checks whether the device has a coherent pool, not whether the
> allocation out of it worked. dma_alloc_from_dev_coherent():
>
> * Returns 0 if dma_alloc_coherent should continue with allocating from
> * generic memory areas, or !0 if dma_alloc_coherent should return @ret.
>
> It returns 1 as soon as it finds a pool; __dma_alloc_from_coherent()
> stores NULL in @ret and leaves *dma_handle alone when the request is
> larger than the pool or the pool is full. The third paragraph of the
> commit message says this.
>
> The second hunk is under no condition at all: dma_direct_alloc(),
> iommu_dma_alloc() and ops->alloc() return NULL on failure, and the trace
> below the if/else chain runs either way.
Ah, I see what you mean. TBH I would just do something like
cpu_handle ? *dma_handle : NULL
to make it clear what we're doing
--Sean
next prev parent reply other threads:[~2026-09-05 18:37 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-05 7:19 Donggeun Yoo
2026-09-05 12:57 ` Sean Anderson
2026-09-05 17:26 ` Donggeun Yoo
2026-09-05 18:37 ` Sean Anderson [this message]
2026-09-05 19:16 ` Donggeun Yoo
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=b36f40ac-cd77-a480-d558-139334334b16@linux.dev \
--to=sean.anderson@linux.dev \
--cc=donggeunyoo.kernel@gmail.com \
--cc=iommu@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.com \
--cc=rostedt@goodmis.org \
/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
all inboxes | Powered by JetHome®