From: Kaiwei Liu <kaiwei.liu@unisoc.com>
To: Vinod Koul <vkoul@kernel.org>, Orson Zhai <orsonzhai@gmail.com>,
Baolin Wang <baolin.wang@linux.alibaba.com>,
Chunyan Zhang <zhang.lyra@gmail.com>
Cc: <dmaengine@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
kaiwei liu <liukaiwei086@gmail.com>,
Wenming Wu <wenming.wu@unisoc.com>
Subject: [PATCH V2 1/2] dmaengine: sprd: delete enable operation in probe
Date: Fri, 22 Dec 2023 19:27:14 +0800 [thread overview]
Message-ID: <20231222112714.9660-1-kaiwei.liu@unisoc.com> (raw)
From: "kaiwei.liu" <kaiwei.liu@unisoc.com>
In the probe of dma, it will allocate device memory and do some
initalization settings. All operations are only at the software
level. Furthermore, The current dma driver is applicable to two
DMA devices in different power domain. For some scenes, one of
the domain is power off and when you probe, enable the dma with
the domain power off may cause crash.
For example, one case is for audio co-processor and DMA serves for
it, dma's power domain is off during initialization since audio is
not used at that time, so we can not read/write DMA's register for
this kind of cases.
Signed-off-by: kaiwei.liu <kaiwei.liu@unisoc.com>
---
Change in V2:
-Fix typo in subject line
-Fix patches disjoint error
-modify commit message
-move pm_runtime_enable function before dma_async_device_register
---
drivers/dma/sprd-dma.c | 13 ++-----------
1 file changed, 2 insertions(+), 11 deletions(-)
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 3f54ff37c5e0..cb48731d70b2 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -1203,16 +1203,9 @@ static int sprd_dma_probe(struct platform_device *pdev)
}
platform_set_drvdata(pdev, sdev);
- ret = sprd_dma_enable(sdev);
- if (ret)
- return ret;
- pm_runtime_set_active(&pdev->dev);
pm_runtime_enable(&pdev->dev);
-
- ret = pm_runtime_get_sync(&pdev->dev);
- if (ret < 0)
- goto err_rpm;
+ pm_runtime_get_noresume(&pdev->dev);
ret = dma_async_device_register(&sdev->dma_dev);
if (ret < 0) {
@@ -1226,7 +1219,7 @@ static int sprd_dma_probe(struct platform_device *pdev)
if (ret)
goto err_of_register;
- pm_runtime_put(&pdev->dev);
+ pm_runtime_put_noidle(&pdev->dev);
return 0;
err_of_register:
@@ -1234,8 +1227,6 @@ static int sprd_dma_probe(struct platform_device *pdev)
err_register:
pm_runtime_put_noidle(&pdev->dev);
pm_runtime_disable(&pdev->dev);
-err_rpm:
- sprd_dma_disable(sdev);
return ret;
}
--
2.17.1
reply other threads:[~2023-12-22 11:28 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20231222112714.9660-1-kaiwei.liu@unisoc.com \
--to=kaiwei.liu@unisoc.com \
--cc=baolin.wang@linux.alibaba.com \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liukaiwei086@gmail.com \
--cc=orsonzhai@gmail.com \
--cc=vkoul@kernel.org \
--cc=wenming.wu@unisoc.com \
--cc=zhang.lyra@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
all inboxes | Powered by JetHome®