Re: [PATCH v2 3/9] ASoC: amd: raven: Use devm_pm_runtime_enable()
From: Mukunda,Vijendar
Date: Fri Dec 04 2026 - 06:53:34 EST
On 12/4/26 16:46, phucduc.bui@xxxxxxxxx wrote:
From: bui duc phuc <phucduc.bui@xxxxxxxxx>The kernel patch convention is "Changes since v2:" not "Changes in v2:".
Use devm_pm_runtime_enable() to automatically disable runtime PM
when the device is removed, allowing the remove callback to be
removed.
Signed-off-by: bui duc phuc <phucduc.bui@xxxxxxxxx>
---
Changes in v2:
- Enable runtime PM before registering IRQs and components.
- Restore mmACP_EXTERNAL_INTR_ENB in probe functions.
See Documentation/process/submitting-patches.rst.
The parent PCI driver's acp_init() already writes this register and
sound/soc/amd/raven/acp3x-pcm-dma.c | 41 +++++++++++++++--------------
1 file changed, 21 insertions(+), 20 deletions(-)
diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c
index 700c0ca20e18..1555157d8316 100644
--- a/sound/soc/amd/raven/acp3x-pcm-dma.c
+++ b/sound/soc/amd/raven/acp3x-pcm-dma.c
@@ -408,33 +408,35 @@ static int acp3x_audio_probe(struct platform_device *pdev)
adata->i2s_irq = status;
dev_set_drvdata(&pdev->dev, adata);
- status = devm_snd_soc_register_component(&pdev->dev,
- &acp3x_i2s_component,
- NULL, 0);
- if (status) {
- dev_err(&pdev->dev, "Fail to register acp i2s component\n");
- return -ENODEV;
- }
- status = devm_request_irq(&pdev->dev, adata->i2s_irq, i2s_irq_handler,
- irqflags, "ACP3x_I2S_IRQ", adata);
- if (status) {
- dev_err(&pdev->dev, "ACP3x I2S IRQ request failed\n");
- return -ENODEV;
- }
pm_runtime_set_autosuspend_delay(&pdev->dev, 2000);
pm_runtime_use_autosuspend(&pdev->dev);
pm_runtime_mark_last_busy(&pdev->dev);
pm_runtime_set_active(&pdev->dev);
- pm_runtime_enable(&pdev->dev);
+ status = devm_pm_runtime_enable(&pdev->dev);
+ if (status)
+ return status;
+
+ status = devm_request_irq(&pdev->dev, adata->i2s_irq, i2s_irq_handler,
+ irqflags, "ACP3x_I2S_IRQ", adata);
+ if (status) {
+ dev_err(&pdev->dev, "ACP3x I2S IRQ request failed\n");
+ return -ENODEV;
+ }
+
+ rv_writel(1, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB);
re-enabling it in probe is redundant. Drop this change.
+This is a pre-existing bug but since this patch touches both error
+ status = devm_snd_soc_register_component(&pdev->dev,
+ &acp3x_i2s_component,
+ NULL, 0);
+ if (status) {
+ dev_err(&pdev->dev, "Fail to register acp i2s component\n");
+ return -ENODEV;
paths, please fix it here: return status instead of -ENODEV.
Returning a hardcoded -ENODEV throws away the real error from
devm_request_irq() / devm_snd_soc_register_component() and makes
failures harder to diagnose.
+ }
+
return 0;
}
-static void acp3x_audio_remove(struct platform_device *pdev)
-{
- pm_runtime_disable(&pdev->dev);
-}
-
static int acp3x_resume(struct device *dev)
{
struct i2s_dev_data *adata;
@@ -517,7 +519,6 @@ static const struct dev_pm_ops acp3x_pm_ops = {
static struct platform_driver acp3x_dma_driver = {
.probe = acp3x_audio_probe,
- .remove = acp3x_audio_remove,
.driver = {
.name = "acp3x_rv_i2s_dma",
.pm = &acp3x_pm_ops,