From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Frank.Li@oss.nxp.com
Cc: "Andi Shyti" <andi.shyti@kernel.org>,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
"Magnus Damm" <magnus.damm@gmail.com>,
"Sumit Semwal" <sumit.semwal@linaro.org>,
"Christian König" <christian.koenig@amd.com>,
"Philipp Stanner" <phasta@kernel.org>,
"open list:RENESAS R-CAR I2C DRIVERS"
<linux-renesas-soc@vger.kernel.org>,
"open list:I2C SUBSYSTEM HOST DRIVERS"
<linux-i2c@vger.kernel.org>,
"open list" <linux-kernel@vger.kernel.org>,
"open list:DMA BUFFER SHARING
FRAMEWORK:Keyword:bdma_(?:buf|fence|resv)b"
<linux-media@vger.kernel.org>,
"open list:DMA BUFFER SHARING
FRAMEWORK:Keyword:bdma_(?:buf|fence|resv)b"
<dri-devel@lists.freedesktop.org>,
"moderated list:DMA BUFFER SHARING
FRAMEWORK:Keyword:bdma_(?:buf|fence|resv)b"
<linaro-mm-sig@lists.linaro.org>,
imx@lists.linux.dev, vkoul@kernel.org,
"Frank Li" <Frank.Li@nxp.com>
Subject: Re: [PATCH 1/1] i2c: use dmaengine_get_dma_device() instead of chan->device->dev
Date: Wed, 4 Nov 2026 14:56:14 +0200 [thread overview]
Message-ID: <ausraZs-y811IzYi@shikoro> (raw)
In-Reply-To: <20261103212655.1774644-1-Frank.Li@oss.nxp.com>
[-- Attachment #1: Type: text/plain, Size: 1168 bytes --]
Hi Frank,
On Tue, Nov 03, 2026 at 04:26:54PM -0500, Frank.Li@oss.nxp.com wrote:
> From: Frank Li <Frank.Li@nxp.com>
>
> Replace direct dma_chan::device::dev access with the proper
> dmaengine_get_dma_device() for consumer API.
>
> chan->device->dev is not always the device used for DMA mapping. Some DMA
> engines support per-channel IOMMU mappings, so different channels may use
> different DMA devices. dmaengine_get_dma_device() returns the correct
> device for each channel.
>
> This also prepares for making the DMA engine provider data structures
> private. DMA consumers should not access DMA engine internals directly.
Thanks for this, looks useful.
> - dma_addr = dma_map_single(chan->device->dev, buf, len, dir);
> - if (dma_mapping_error(chan->device->dev, dma_addr)) {
> + dma_addr = dma_map_single(dmaengine_get_dma_device(chan), buf, len, dir);
> + if (dma_mapping_error(dmaengine_get_dma_device(chan), dma_addr)) {
> dev_dbg(dev, "dma map failed, using PIO\n");
I think we should populate a dma_dev-variable here and reuse it instead
of calling dmaengine_get_dma_device() twice.
Happy hacking,
Wolfram
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2026-11-04 12:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-03 21:26 Frank.Li
2026-11-04 12:56 ` Wolfram Sang [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=ausraZs-y811IzYi@shikoro \
--to=wsa+renesas@sang-engineering.com \
--cc=Frank.Li@nxp.com \
--cc=Frank.Li@oss.nxp.com \
--cc=andi.shyti@kernel.org \
--cc=christian.koenig@amd.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=geert+renesas@glider.be \
--cc=imx@lists.linux.dev \
--cc=linaro-mm-sig@lists.linaro.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--cc=phasta@kernel.org \
--cc=sumit.semwal@linaro.org \
--cc=vkoul@kernel.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®