From: Joy Zou <joy.zou@oss.nxp.com>
To: Frank Li <Frank.Li@nxp.com>, Vinod Koul <vkoul@kernel.org>,
Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Cc: Joy Zou <joy.zou@oss.nxp.com>, Frank Li <Frank.Li@kernel.org>,
imx@lists.linux.dev, dmaengine@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v8 4/5] dmaengine: mcf-edma: enable runtime PM for eDMA engine and channel
Date: Wed, 25 Nov 2026 18:58:58 +0800 [thread overview]
Message-ID: <20261125-b4-edma-runtime-opt-mo-v8-4-81345a3bfb52@oss.nxp.com> (raw)
In-Reply-To: <20261125-b4-edma-runtime-opt-mo-v8-0-81345a3bfb52@oss.nxp.com>
The common fsl_edma_alloc_chan_resources() implementation
supports runtime PM and relies on it when allocating channel
resources.
Enable runtime PM for the eDMA engine and its channel devices
to ensure that runtime PM operations work correctly when
CONFIG_PM is enabled.
This patch has only been build-tested.
Signed-off-by: Joy Zou <joy.zou@oss.nxp.com>
---
Changes in v8:
- Add a new patch to prevent fsl_edma_alloc_chan_resources()
from failing when CONFIG_PM is enabled.
---
drivers/dma/mcf-edma-main.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/drivers/dma/mcf-edma-main.c b/drivers/dma/mcf-edma-main.c
index 9e1c6400c77b..b1b94639d4cc 100644
--- a/drivers/dma/mcf-edma-main.c
+++ b/drivers/dma/mcf-edma-main.c
@@ -8,6 +8,7 @@
#include <linux/dmaengine.h>
#include <linux/platform_device.h>
#include <linux/platform_data/dma-mcf-edma.h>
+#include <linux/pm_runtime.h>
#include "fsl-edma-common.h"
@@ -192,7 +193,9 @@ static int mcf_edma_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&mcf_edma->dma_dev.channels);
for (i = 0; i < mcf_edma->n_chans; i++) {
struct fsl_edma_chan *mcf_chan = &mcf_edma->chans[i];
+ struct device *chan_dev;
+ chan_dev = &mcf_chan->vchan.chan.dev->device;
mcf_chan->edma = mcf_edma;
mcf_chan->srcid = i;
mcf_chan->dma_dir = DMA_NONE;
@@ -201,6 +204,10 @@ static int mcf_edma_probe(struct platform_device *pdev)
mcf_chan->tcd = mcf_edma->membase + EDMA_TCD
+ i * sizeof(struct fsl_edma_hw_tcd);
edma_write_tcdreg(mcf_chan, cpu_to_le32(0), csr);
+ ret = devm_pm_runtime_enable(chan_dev);
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret,
+ "Can't enable eDMA channel PM runtime!\n");
}
iowrite32(~0, regs->inth);
@@ -240,6 +247,10 @@ static int mcf_edma_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, mcf_edma);
+ ret = devm_pm_runtime_enable(&pdev->dev);
+ if (ret)
+ return dev_err_probe(&pdev->dev, ret, "Can't enable eDMA engine PM runtime!\n");
+
ret = dma_async_device_register(&mcf_edma->dma_dev);
if (ret) {
dev_err(&pdev->dev,
--
2.34.1
next prev parent reply other threads:[~2026-11-25 10:55 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-25 10:58 [PATCH v8 0/5] add runtime suspend/resume support joy.zou
2026-11-25 10:58 ` [PATCH v8 1/5] dmaengine: fsl-edma: use devm_clk_get_optional_enabled() for channel clock joy.zou
2026-11-25 10:58 ` [PATCH v8 2/5] dmaengine: fsl-edma: use devm_clk_get_optional() for DMA engine clock joy.zou
2026-11-25 10:58 ` [PATCH v8 3/5] dmaengine: fsl-edma: convert DMAMUX clock handling to bulk clock API joy.zou
2026-11-25 10:58 ` Joy Zou [this message]
2026-11-25 10:58 ` [PATCH v8 5/5] dmaengine: fsl-edma: add runtime suspend/resume support Joy Zou
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=20261125-b4-edma-runtime-opt-mo-v8-4-81345a3bfb52@oss.nxp.com \
--to=joy.zou@oss.nxp.com \
--cc=Frank.Li@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=dmaengine@vger.kernel.org \
--cc=imx@lists.linux.dev \
--cc=joe@pf.is.s.u-tokyo.ac.jp \
--cc=linux-kernel@vger.kernel.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®