From: Frank Li <Frank.li@oss.nxp.com>
To: "Ulf Hansson" <ulfh@kernel.org>,
"Aubin Constans" <aubin.constans@microchip.com>,
"Nicolas Ferre" <nicolas.ferre@microchip.com>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
"Paul Cercueil" <paul@crapouillou.net>,
"Russell King" <linux@armlinux.org.uk>,
"Frank Li" <Frank.Li@nxp.com>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"Aaro Koskinen" <aaro.koskinen@iki.fi>,
"Andreas Färber" <afaerber@suse.de>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Wolfram Sang" <wsa+renesas@sang-engineering.com>,
"Jesper Nilsson" <jesper.nilsson@axis.com>,
"Lars Persson" <lars.persson@axis.com>,
"Arnd Bergmann" <arnd@arndb.de>,
"Johan Hovold" <johan@kernel.org>, "Ge Gordon" <gordon.ge@bst.ai>,
"Vinod Koul" <vkoul@kernel.org>,
"Albert Yang" <yangzh0906@thundersoft.com>,
"Jared Kangas" <jkangas@redhat.com>,
"Brian Masney" <bmasney@redhat.com>,
"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
"Linus Walleij" <linusw@kernel.org>,
"Fan Wu" <fanwu01@zju.edu.cn>, "Rosen Penev" <rosenp@gmail.com>,
"Pengpeng Hou" <pengpeng@iscas.ac.cn>,
"Marco Crivellari" <marco.crivellari@suse.com>,
"Pedro Demarchi Gomes" <pedrodemargomes@gmail.com>,
"Zhan Xusheng" <zhanxusheng1024@gmail.com>,
"Pan Chuang" <panchuang@vivo.com>,
"Khalid Aziz" <khalid@kernel.org>,
"Ethan Nelson-Moore" <enelsonmoore@gmail.com>,
"Rakuram Eswaran" <rakuram.e96@gmail.com>,
"Takashi Sakamoto" <o-takashi@sakamocchi.jp>,
"Runyu Xiao" <runyu.xiao@seu.edu.cn>,
"Matthew Wilcox (Oracle)" <willy@infradead.org>,
"Uwe Kleine-König" <u.kleine-koenig@baylibre.com>,
"open list:MULTIMEDIA CARD (MMC),
SECURE DIGITAL (SD) AND..." <linux-mmc@vger.kernel.org>,
"open list" <linux-kernel@vger.kernel.org>,
"moderated list:ARM/Microchip (AT91) SoC support"
<linux-arm-kernel@lists.infradead.org>,
"open list:INGENIC JZ47xx SoCs" <linux-mips@vger.kernel.org>,
"open list:ARM/FREESCALE IMX / MXC / LAYERSCAPE ARM ARCHIT..."
<imx@lists.linux.dev>,
"open list:OMAP MMC SUPPORT" <linux-omap@vger.kernel.org>,
"moderated list:ARM/ACTIONS SEMI ARCHITECTURE"
<linux-actions@lists.infradead.org>,
"open list:TMIO/SDHI MMC DRIVER"
<linux-renesas-soc@vger.kernel.org>,
"open list:ARM/ARTPEC MACHINE SUPPORT"
<linux-arm-kernel@axis.com>
Subject: Re: [PATCH v4 1/1] mmc: use dmaengine_get_dma_device() instead of chan->device->dev
Date: Wed, 23 Sep 2026 14:50:06 -0400 [thread overview]
Message-ID: <arQfXjYbtNhv9__S@lizhi-Precision-Tower-5810> (raw)
In-Reply-To: <20260923184612.3583132-1-Frank.Li@oss.nxp.com>
On Wed, Sep 23, 2026 at 02:45:47PM -0400, 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.
>
> mxs-mmc.c wrong use mmc host device when do DMA map. Fix it by use
> dmaengine_get_dma_device().
>
> Assisted-by: LLM
> Reviewed-by: Linus Walleij <linusw@kernel.org>
> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Reviewed-by: Vinod Koul <vkoul@kernel.org>
> Signed-off-by: Frank Li <Frank.Li@nxp.com>
> ---
> Change in v4
> - Fix miss "R" at Reviewed-by tags.
> - Fix error path unmap dev at mxs-mmc.c (sashakio reported)
> - move dmaengine_get_dma_device(host->dma) after mxcmci_use_dma() to avoid
> defer host->dma if use pio mode (sashakio reported)
>
> Change in v3
> - add Linus Walleij and Vinod Koul's review by tags
> - Add missed omap and mxs-mmc.c (sashakio reported)
>
> Change in v2
> - find more place, which use device->dev for dma mapping. This time should
> clean all.
> - Reviewed-by: Linus Walleij <linusw@kernel.org>
>
> Cc: imx@lists.linux.dev
> Cc: vkoul@kernel.org
> ---
> drivers/mmc/host/Kconfig | 2 +-
Please forget this version, I make misstake to include a debug code, sorry
for annoise.
Frank
next parent reply other threads:[~2026-09-23 18:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20260923184612.3583132-1-Frank.Li@oss.nxp.com>
2026-09-23 18:50 ` Frank Li [this message]
2026-09-23 18:57 ` [PATCH v4 1/1] mmc: use dmaengine_get_dma_device() instead of chan->device->dev Arnd Bergmann
2026-09-23 19:33 ` Frank Li
2026-09-23 21:40 ` Frank Li
2026-09-23 23:01 ` Arnd Bergmann
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=arQfXjYbtNhv9__S@lizhi-Precision-Tower-5810 \
--to=frank.li@oss.nxp.com \
--cc=Frank.Li@nxp.com \
--cc=aaro.koskinen@iki.fi \
--cc=afaerber@suse.de \
--cc=alexandre.belloni@bootlin.com \
--cc=arnd@arndb.de \
--cc=aubin.constans@microchip.com \
--cc=bmasney@redhat.com \
--cc=claudiu.beznea@tuxon.dev \
--cc=enelsonmoore@gmail.com \
--cc=fanwu01@zju.edu.cn \
--cc=festevam@gmail.com \
--cc=gordon.ge@bst.ai \
--cc=imx@lists.linux.dev \
--cc=jesper.nilsson@axis.com \
--cc=jkangas@redhat.com \
--cc=johan@kernel.org \
--cc=kernel@pengutronix.de \
--cc=khalid@kernel.org \
--cc=lars.persson@axis.com \
--cc=linusw@kernel.org \
--cc=linux-actions@lists.infradead.org \
--cc=linux-arm-kernel@axis.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mani@kernel.org \
--cc=marco.crivellari@suse.com \
--cc=martin.blumenstingl@googlemail.com \
--cc=nicolas.ferre@microchip.com \
--cc=o-takashi@sakamocchi.jp \
--cc=panchuang@vivo.com \
--cc=paul@crapouillou.net \
--cc=pedrodemargomes@gmail.com \
--cc=pengpeng@iscas.ac.cn \
--cc=rakuram.e96@gmail.com \
--cc=rosenp@gmail.com \
--cc=runyu.xiao@seu.edu.cn \
--cc=s.hauer@pengutronix.de \
--cc=u.kleine-koenig@baylibre.com \
--cc=ulfh@kernel.org \
--cc=vkoul@kernel.org \
--cc=willy@infradead.org \
--cc=wsa+renesas@sang-engineering.com \
--cc=yangzh0906@thundersoft.com \
--cc=zhanxusheng1024@gmail.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