From: Andrei-Edward Popa <andrei.popa105@yahoo.com>
To: robin.murphy@arm.com, m.szyprowski@samsung.com, hch@infradead.org
Cc: andrei.popa105@yahoo.com, iommu@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dma-remap: fix dma_common_find_pages() page lookup for offsets
Date: Mon, 15 Dec 2025 22:49:55 +0200 [thread overview]
Message-ID: <20251215204956.20659-1-andrei.popa105@yahoo.com> (raw)
In-Reply-To: 1d552f40-74b3-4c6d-874d-508ecb0e75d2@arm.com
Hi Christoph, Marek, Robin,
Thanks for the detailed explanations, that clarified things a lot.
I now understand that dma_mmap_attrs() expects cpu_addr to be the exact
pointer returned by dma_alloc_attrs(), and that subdividing an allocation
(e.g. via gen_pool) requires the driver to keep track of offsets and
adjust the mmap parameters accordingly before calling into the DMA API.
My patch was effectively trying to make dma_common_find_pages() accept
offset cpu_addr values implicitly, which would change the DMA API
semantics and mask driver bugs rather than fixing them in the driver
itself.
Given this, I agree that the correct fix is in the driver using the API,
not in dma-remap, and I’ll drop this patch.
Thanks again for taking the time to explain the intended usage and
constraints of the DMA mmap helpers.
Best regards,
Andrei
next prev parent reply other threads:[~2025-12-15 20:50 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20251212200914.138310-1-andrei.popa105.ref@yahoo.com>
2025-12-12 20:09 ` Andrei-Edward Popa
2025-12-15 5:57 ` Christoph Hellwig
2025-12-15 8:13 ` Marek Szyprowski
2025-12-15 11:31 ` Robin Murphy
2025-12-15 20:49 ` Andrei-Edward Popa [this message]
2025-12-15 10:52 ` Robin Murphy
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=20251215204956.20659-1-andrei.popa105@yahoo.com \
--to=andrei.popa105@yahoo.com \
--cc=hch@infradead.org \
--cc=iommu@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=m.szyprowski@samsung.com \
--cc=robin.murphy@arm.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
all inboxes | Powered by JetHome®