* [PATCH v2 1/9] ASoC: amd: ps: Use devm_pm_runtime_enable()
2026-12-04 11:16 [PATCH v2 0/9] ASoC: amd: Use devm_pm_runtime_enable() phucduc.bui
@ 2026-12-04 11:16 ` phucduc.bui
2026-12-04 11:16 ` [PATCH v2 2/9] ASoC: amd: ps: Simplify component registration phucduc.bui
` (8 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: phucduc.bui @ 2026-12-04 11:16 UTC (permalink / raw)
To: Mark Brown, Vijendar Mukunda, Venkata Prasad Potturu,
Syed Saba Kareem
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Kuninori Morimoto, wangdicheng, Chris Bainbridge, linux-sound,
linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Use devm_pm_runtime_enable() in the PDM and SoundWire DMA drivers
to automatically disable runtime PM when the devices are removed.
This allows removing their remove callbacks.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Enable runtime PM before registering components.
sound/soc/amd/ps/ps-pdm-dma.c | 21 ++++++++++-----------
sound/soc/amd/ps/ps-sdw-dma.c | 21 ++++++++++-----------
2 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/sound/soc/amd/ps/ps-pdm-dma.c b/sound/soc/amd/ps/ps-pdm-dma.c
index 359ca10b9ba4..6e2e08c097a0 100644
--- a/sound/soc/amd/ps/ps-pdm-dma.c
+++ b/sound/soc/amd/ps/ps-pdm-dma.c
@@ -388,6 +388,15 @@ static int acp63_pdm_audio_probe(struct platform_device *pdev)
adata->capture_stream = NULL;
adata->acp_lock = &acp_data->acp_lock;
dev_set_drvdata(&pdev->dev, adata);
+
+ pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS);
+ pm_runtime_use_autosuspend(&pdev->dev);
+ pm_runtime_mark_last_busy(&pdev->dev);
+ pm_runtime_set_active(&pdev->dev);
+ status = devm_pm_runtime_enable(&pdev->dev);
+ if (status)
+ return status;
+
status = devm_snd_soc_register_component(&pdev->dev,
&acp63_pdm_component,
&acp63_pdm_dai_driver, 1);
@@ -396,17 +405,8 @@ static int acp63_pdm_audio_probe(struct platform_device *pdev)
return -ENODEV;
}
- pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS);
- pm_runtime_use_autosuspend(&pdev->dev);
- pm_runtime_mark_last_busy(&pdev->dev);
- pm_runtime_set_active(&pdev->dev);
- pm_runtime_enable(&pdev->dev);
- return 0;
-}
-static void acp63_pdm_audio_remove(struct platform_device *pdev)
-{
- pm_runtime_disable(&pdev->dev);
+ return 0;
}
static int acp63_pdm_resume(struct device *dev)
@@ -455,7 +455,6 @@ static const struct dev_pm_ops acp63_pdm_pm_ops = {
static struct platform_driver acp63_pdm_dma_driver = {
.probe = acp63_pdm_audio_probe,
- .remove = acp63_pdm_audio_remove,
.driver = {
.name = "acp_ps_pdm_dma",
.pm = pm_ptr(&acp63_pdm_pm_ops),
diff --git a/sound/soc/amd/ps/ps-sdw-dma.c b/sound/soc/amd/ps/ps-sdw-dma.c
index 6c510e6d9a18..6b78b2d49b12 100644
--- a/sound/soc/amd/ps/ps-sdw-dma.c
+++ b/sound/soc/amd/ps/ps-sdw-dma.c
@@ -672,6 +672,15 @@ static int acp63_sdw_platform_probe(struct platform_device *pdev)
sdw_data->acp_lock = &acp_data->acp_lock;
sdw_data->acp_rev = acp_data->acp_rev;
dev_set_drvdata(&pdev->dev, sdw_data);
+
+ pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS);
+ pm_runtime_use_autosuspend(&pdev->dev);
+ pm_runtime_mark_last_busy(&pdev->dev);
+ pm_runtime_set_active(&pdev->dev);
+ status = devm_pm_runtime_enable(&pdev->dev);
+ if (status)
+ return status;
+
status = devm_snd_soc_register_component(&pdev->dev,
&acp63_sdw_component,
NULL, 0);
@@ -679,17 +688,8 @@ static int acp63_sdw_platform_probe(struct platform_device *pdev)
dev_err(&pdev->dev, "Fail to register sdw dma component\n");
return status;
}
- pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS);
- pm_runtime_use_autosuspend(&pdev->dev);
- pm_runtime_mark_last_busy(&pdev->dev);
- pm_runtime_set_active(&pdev->dev);
- pm_runtime_enable(&pdev->dev);
- return 0;
-}
-static void acp63_sdw_platform_remove(struct platform_device *pdev)
-{
- pm_runtime_disable(&pdev->dev);
+ return 0;
}
static int acp63_restore_sdw_dma_config(struct sdw_dma_dev_data *sdw_data)
@@ -795,7 +795,6 @@ static const struct dev_pm_ops acp63_pm_ops = {
static struct platform_driver acp63_sdw_dma_driver = {
.probe = acp63_sdw_platform_probe,
- .remove = acp63_sdw_platform_remove,
.driver = {
.name = "amd_ps_sdw_dma",
.pm = pm_ptr(&acp63_pm_ops),
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 2/9] ASoC: amd: ps: Simplify component registration
2026-12-04 11:16 [PATCH v2 0/9] ASoC: amd: Use devm_pm_runtime_enable() phucduc.bui
2026-12-04 11:16 ` [PATCH v2 1/9] ASoC: amd: ps: " phucduc.bui
@ 2026-12-04 11:16 ` phucduc.bui
2026-12-04 11:16 ` [PATCH v2 3/9] ASoC: amd: raven: Use devm_pm_runtime_enable() phucduc.bui
` (7 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: phucduc.bui @ 2026-12-04 11:16 UTC (permalink / raw)
To: Mark Brown, Vijendar Mukunda, Venkata Prasad Potturu,
Syed Saba Kareem
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Kuninori Morimoto, wangdicheng, Chris Bainbridge, linux-sound,
linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Return the result of devm_snd_soc_register_component() directly
in both PDM and SoundWire DMA probe functions.
This also preserves the original error code in the PDM driver
instead of converting it to -ENODEV.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/amd/ps/ps-pdm-dma.c | 13 +++----------
sound/soc/amd/ps/ps-sdw-dma.c | 12 +++---------
2 files changed, 6 insertions(+), 19 deletions(-)
diff --git a/sound/soc/amd/ps/ps-pdm-dma.c b/sound/soc/amd/ps/ps-pdm-dma.c
index 6e2e08c097a0..bb5e79c6f519 100644
--- a/sound/soc/amd/ps/ps-pdm-dma.c
+++ b/sound/soc/amd/ps/ps-pdm-dma.c
@@ -397,16 +397,9 @@ static int acp63_pdm_audio_probe(struct platform_device *pdev)
if (status)
return status;
- status = devm_snd_soc_register_component(&pdev->dev,
- &acp63_pdm_component,
- &acp63_pdm_dai_driver, 1);
- if (status) {
- dev_err(&pdev->dev, "Fail to register acp pdm dai\n");
-
- return -ENODEV;
- }
-
- return 0;
+ return devm_snd_soc_register_component(&pdev->dev,
+ &acp63_pdm_component,
+ &acp63_pdm_dai_driver, 1);
}
static int acp63_pdm_resume(struct device *dev)
diff --git a/sound/soc/amd/ps/ps-sdw-dma.c b/sound/soc/amd/ps/ps-sdw-dma.c
index 6b78b2d49b12..94f5264d5c89 100644
--- a/sound/soc/amd/ps/ps-sdw-dma.c
+++ b/sound/soc/amd/ps/ps-sdw-dma.c
@@ -681,15 +681,9 @@ static int acp63_sdw_platform_probe(struct platform_device *pdev)
if (status)
return status;
- status = devm_snd_soc_register_component(&pdev->dev,
- &acp63_sdw_component,
- NULL, 0);
- if (status) {
- dev_err(&pdev->dev, "Fail to register sdw dma component\n");
- return status;
- }
-
- return 0;
+ return devm_snd_soc_register_component(&pdev->dev,
+ &acp63_sdw_component,
+ NULL, 0);
}
static int acp63_restore_sdw_dma_config(struct sdw_dma_dev_data *sdw_data)
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 3/9] ASoC: amd: raven: Use devm_pm_runtime_enable()
2026-12-04 11:16 [PATCH v2 0/9] ASoC: amd: Use devm_pm_runtime_enable() phucduc.bui
2026-12-04 11:16 ` [PATCH v2 1/9] ASoC: amd: ps: " phucduc.bui
2026-12-04 11:16 ` [PATCH v2 2/9] ASoC: amd: ps: Simplify component registration phucduc.bui
@ 2026-12-04 11:16 ` phucduc.bui
2026-12-04 11:38 ` sashiko-bot
2026-12-04 11:52 ` Mukunda,Vijendar
2026-12-04 11:16 ` [PATCH v2 4/9] ASoC: amd: raven: Preserve probe error codes phucduc.bui
` (6 subsequent siblings)
9 siblings, 2 replies; 15+ messages in thread
From: phucduc.bui @ 2026-12-04 11:16 UTC (permalink / raw)
To: Mark Brown, Vijendar Mukunda, Venkata Prasad Potturu,
Syed Saba Kareem
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Kuninori Morimoto, wangdicheng, Chris Bainbridge, linux-sound,
linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
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@gmail.com>
---
Changes in v2:
- Enable runtime PM before registering IRQs and components.
- Restore mmACP_EXTERNAL_INTR_ENB in probe functions.
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);
+
+ 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;
+ }
+
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,
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 3/9] ASoC: amd: raven: Use devm_pm_runtime_enable()
2026-12-04 11:16 ` [PATCH v2 3/9] ASoC: amd: raven: Use devm_pm_runtime_enable() phucduc.bui
@ 2026-12-04 11:38 ` sashiko-bot
2026-12-04 11:52 ` Mukunda,Vijendar
1 sibling, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-12-04 11:38 UTC (permalink / raw)
To: phucduc.bui; +Cc: linux-sound
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] ASoC: amd: raven: UAF in i2s_irq_handler() due to
probe/devres reordering
- [Low] ASoC: amd: raven: commit message omits probe reordering and MMIO
write
--
commit bfce84f5994b14173f5fe0980ac3f19b7b299695
Author: bui duc phuc <phucduc.bui@gmail.com>
> ASoC: amd: raven: Use devm_pm_runtime_enable()
>
> 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@gmail.com>
[Severity: Low]
Should the commit message also describe the probe reordering and the new
mmACP_EXTERNAL_INTR_ENB write?
The patch moves runtime PM setup and devm_request_irq() ahead of
devm_snd_soc_register_component(), and adds a write to
mmACP_EXTERNAL_INTR_ENB in acp3x_audio_probe(). These are only noted
after the --- separator, which is stripped when the patch is applied.
> diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c
> index 700c0ca20e181..1555157d8316c 100644
> --- a/sound/soc/amd/raven/acp3x-pcm-dma.c
> +++ b/sound/soc/amd/raven/acp3x-pcm-dma.c
> @@ -408,6 +408,24 @@ static int acp3x_audio_probe(struct platform_device *pdev)
> adata->i2s_irq = status;
>
> dev_set_drvdata(&pdev->dev, adata);
> +
> + 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);
> + 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);
> +
> status = devm_snd_soc_register_component(&pdev->dev,
> &acp3x_i2s_component,
> NULL, 0);
[Severity: Medium]
Can moving devm_request_irq() before devm_snd_soc_register_component()
cause a use-after-free of struct snd_pcm_substream during driver unbind?
Devres unwinds in LIFO order, so devm_component_release() now runs before
devm_irq_release() calls free_irq(). acp3x_dma_close() clears the stream
pointers without locking or calling synchronize_irq(), leaving an
in-flight i2s_irq_handler() with a stale substream pointer:
CPU0 CPU1
devres_release_all()
devm_component_release()
snd_soc_component_unregister()
...
acp3x_dma_close()
i2s_irq_handler()
reads rv_i2s_data->play_stream
adata->play_stream = NULL
snd_card_free()
...
kfree(substream)
snd_pcm_period_elapsed(play_stream)
<-- use-after-free
devm_irq_release()
free_irq()
Keeping devm_request_irq() after devm_snd_soc_register_component()
ensures free_irq() synchronizes i2s_irq_handler() before the component
and its PCM substreams are torn down.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204111644.63432-1-phucduc.bui@gmail.com?part=3
^ permalink raw reply [flat|nested] 15+ messages in thread* Re: [PATCH v2 3/9] ASoC: amd: raven: Use devm_pm_runtime_enable()
2026-12-04 11:16 ` [PATCH v2 3/9] ASoC: amd: raven: Use devm_pm_runtime_enable() phucduc.bui
2026-12-04 11:38 ` sashiko-bot
@ 2026-12-04 11:52 ` Mukunda,Vijendar
1 sibling, 0 replies; 15+ messages in thread
From: Mukunda,Vijendar @ 2026-12-04 11:52 UTC (permalink / raw)
To: phucduc.bui, Mark Brown, Venkata Prasad Potturu, Syed Saba Kareem
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Kuninori Morimoto, wangdicheng, Chris Bainbridge, linux-sound,
linux-kernel
On 12/4/26 16:46, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> 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@gmail.com>
> ---
>
> Changes in v2:
> - Enable runtime PM before registering IRQs and components.
> - Restore mmACP_EXTERNAL_INTR_ENB in probe functions.
The kernel patch convention is "Changes since v2:" not "Changes in v2:".
See Documentation/process/submitting-patches.rst.
>
> 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);
The parent PCI driver's acp_init() already writes this register and
re-enabling it in probe is redundant. Drop this change.
> +
> + 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;
This is a pre-existing bug but since this patch touches both error
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,
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 4/9] ASoC: amd: raven: Preserve probe error codes
2026-12-04 11:16 [PATCH v2 0/9] ASoC: amd: Use devm_pm_runtime_enable() phucduc.bui
` (2 preceding siblings ...)
2026-12-04 11:16 ` [PATCH v2 3/9] ASoC: amd: raven: Use devm_pm_runtime_enable() phucduc.bui
@ 2026-12-04 11:16 ` phucduc.bui
2026-12-04 11:16 ` [PATCH v2 5/9] ASoC: amd: renoir: Use devm_pm_runtime_enable() phucduc.bui
` (5 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: phucduc.bui @ 2026-12-04 11:16 UTC (permalink / raw)
To: Mark Brown, Vijendar Mukunda, Venkata Prasad Potturu,
Syed Saba Kareem
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Kuninori Morimoto, wangdicheng, Chris Bainbridge, linux-sound,
linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Return the original error codes from devm_request_irq() and
devm_snd_soc_register_component() instead of converting them
to -ENODEV.
Remove the redundant error messages.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/amd/raven/acp3x-pcm-dma.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/sound/soc/amd/raven/acp3x-pcm-dma.c b/sound/soc/amd/raven/acp3x-pcm-dma.c
index 1555157d8316..6842b7cd22ef 100644
--- a/sound/soc/amd/raven/acp3x-pcm-dma.c
+++ b/sound/soc/amd/raven/acp3x-pcm-dma.c
@@ -419,20 +419,16 @@ static int acp3x_audio_probe(struct platform_device *pdev)
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;
- }
+ if (status)
+ return status;
rv_writel(1, adata->acp3x_base + mmACP_EXTERNAL_INTR_ENB);
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;
- }
+ if (status)
+ return status;
return 0;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 5/9] ASoC: amd: renoir: Use devm_pm_runtime_enable()
2026-12-04 11:16 [PATCH v2 0/9] ASoC: amd: Use devm_pm_runtime_enable() phucduc.bui
` (3 preceding siblings ...)
2026-12-04 11:16 ` [PATCH v2 4/9] ASoC: amd: raven: Preserve probe error codes phucduc.bui
@ 2026-12-04 11:16 ` phucduc.bui
2026-12-04 11:45 ` sashiko-bot
2026-12-04 11:16 ` [PATCH v2 6/9] ASoC: amd: renoir: Preserve probe error codes phucduc.bui
` (4 subsequent siblings)
9 siblings, 1 reply; 15+ messages in thread
From: phucduc.bui @ 2026-12-04 11:16 UTC (permalink / raw)
To: Mark Brown, Vijendar Mukunda, Venkata Prasad Potturu,
Syed Saba Kareem
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Kuninori Morimoto, wangdicheng, Chris Bainbridge, linux-sound,
linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Use devm_pm_runtime_enable() in the PDM DMA driver to automatically
disable runtime PM when the device is removed.
This allows removing the remove callback.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Enable runtime PM before registering IRQs and components.
sound/soc/amd/renoir/acp3x-pdm-dma.c | 40 ++++++++++++++--------------
1 file changed, 20 insertions(+), 20 deletions(-)
diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c
index bea1208f1702..84ee9b931858 100644
--- a/sound/soc/amd/renoir/acp3x-pdm-dma.c
+++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c
@@ -422,33 +422,34 @@ static int acp_pdm_audio_probe(struct platform_device *pdev)
adata->capture_stream = NULL;
dev_set_drvdata(&pdev->dev, adata);
- status = devm_snd_soc_register_component(&pdev->dev,
- &acp_pdm_component,
- &acp_pdm_dai_driver, 1);
- if (status) {
- dev_err(&pdev->dev, "Fail to register acp pdm dai\n");
- return -ENODEV;
- }
- status = devm_request_irq(&pdev->dev, adata->pdm_irq, pdm_irq_handler,
- irqflags, "ACP_PDM_IRQ", adata);
- if (status) {
- dev_err(&pdev->dev, "ACP PDM IRQ request failed\n");
- return -ENODEV;
- }
pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS);
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->pdm_irq, pdm_irq_handler,
+ irqflags, "ACP_PDM_IRQ", adata);
+ if (status) {
+ dev_err(&pdev->dev, "ACP PDM IRQ request failed\n");
+ return -ENODEV;
+ }
+
+ status = devm_snd_soc_register_component(&pdev->dev,
+ &acp_pdm_component,
+ &acp_pdm_dai_driver, 1);
+ if (status) {
+ dev_err(&pdev->dev, "Fail to register acp pdm dai\n");
+
+ return -ENODEV;
+ }
+
return 0;
}
-static void acp_pdm_audio_remove(struct platform_device *pdev)
-{
- pm_runtime_disable(&pdev->dev);
-}
-
static int acp_pdm_resume(struct device *dev)
{
struct pdm_dev_data *adata;
@@ -497,7 +498,6 @@ static const struct dev_pm_ops acp_pdm_pm_ops = {
static struct platform_driver acp_pdm_dma_driver = {
.probe = acp_pdm_audio_probe,
- .remove = acp_pdm_audio_remove,
.driver = {
.name = "acp_rn_pdm_dma",
.pm = &acp_pdm_pm_ops,
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 5/9] ASoC: amd: renoir: Use devm_pm_runtime_enable()
2026-12-04 11:16 ` [PATCH v2 5/9] ASoC: amd: renoir: Use devm_pm_runtime_enable() phucduc.bui
@ 2026-12-04 11:45 ` sashiko-bot
0 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-12-04 11:45 UTC (permalink / raw)
To: phucduc.bui; +Cc: linux-sound
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] ASoC: amd: renoir: substream UAF in pdm_irq_handler() on
removal
--
commit eccba3fd34658e843b5de01f724905ffd27bc16d
Author: bui duc phuc <phucduc.bui@gmail.com>
ASoC: amd: renoir: Use devm_pm_runtime_enable()
This commit switches acp_pdm_audio_probe() to devm_pm_runtime_enable(),
moves runtime PM and IRQ setup before registering the ASoC component,
and removes the remove callback.
> diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c
> index bea1208f1702a..84ee9b9318581 100644
> --- a/sound/soc/amd/renoir/acp3x-pdm-dma.c
> +++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c
> @@ -422,6 +422,22 @@ static int acp_pdm_audio_probe(struct platform_device *pdev)
> adata->capture_stream = NULL;
>
> dev_set_drvdata(&pdev->dev, adata);
> +
> + pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS);
> + pm_runtime_use_autosuspend(&pdev->dev);
> + pm_runtime_mark_last_busy(&pdev->dev);
> + pm_runtime_set_active(&pdev->dev);
> + status = devm_pm_runtime_enable(&pdev->dev);
> + if (status)
> + return status;
> +
> + status = devm_request_irq(&pdev->dev, adata->pdm_irq, pdm_irq_handler,
> + irqflags, "ACP_PDM_IRQ", adata);
> + if (status) {
> + dev_err(&pdev->dev, "ACP PDM IRQ request failed\n");
> + return -ENODEV;
> + }
> +
> status = devm_snd_soc_register_component(&pdev->dev,
> &acp_pdm_component,
> &acp_pdm_dai_driver, 1);
[Severity: Medium]
Can moving devm_request_irq() before devm_snd_soc_register_component()
cause a use-after-free of capture_stream in pdm_irq_handler() on device
removal?
Because devres actions run in LIFO order, devm_component_release() now
runs before devm_irq_release(). Unregistering the component tears down
the ALSA card and frees the PCM substreams via snd_card_free() ->
snd_pcm_free_stream() while pdm_irq_handler() is still active.
Neither snd_pcm_dev_disconnect() (acp_pdm_component has no .sync_stop
callback and card->sync_irq is unset) nor acp_pdm_dma_close() calls
synchronize_irq() to wait for an in-flight handler:
CPU0 (unbind / PCI remove) CPU1 (pdm_irq_handler)
acp_pdm_dma_close()
reads capture_stream (non-NULL)
adata->capture_stream = NULL
devm_component_release()
...
snd_card_free()
snd_pcm_free_stream()
kfree(substream)
snd_pcm_period_elapsed(capture_stream)
lock(&substream->self_group.lock)
<-- use-after-free
devm_irq_release()
free_irq()
Locking the freed substream in interrupt context can corrupt memory or
oops. Keeping devm_request_irq() after devm_snd_soc_register_component()
preserves the previous teardown order so free_irq() synchronizes against
in-flight handlers before the component is unregistered.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204111644.63432-1-phucduc.bui@gmail.com?part=5
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 6/9] ASoC: amd: renoir: Preserve probe error codes
2026-12-04 11:16 [PATCH v2 0/9] ASoC: amd: Use devm_pm_runtime_enable() phucduc.bui
` (4 preceding siblings ...)
2026-12-04 11:16 ` [PATCH v2 5/9] ASoC: amd: renoir: Use devm_pm_runtime_enable() phucduc.bui
@ 2026-12-04 11:16 ` phucduc.bui
2026-12-04 11:16 ` [PATCH v2 7/9] ASoC: amd: vangogh: Use devm_pm_runtime_enable() phucduc.bui
` (3 subsequent siblings)
9 siblings, 0 replies; 15+ messages in thread
From: phucduc.bui @ 2026-12-04 11:16 UTC (permalink / raw)
To: Mark Brown, Vijendar Mukunda, Venkata Prasad Potturu,
Syed Saba Kareem
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Kuninori Morimoto, wangdicheng, Chris Bainbridge, linux-sound,
linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Return the original error codes from devm_request_irq() and
devm_snd_soc_register_component() instead of converting them
to -ENODEV.
Also remove redundant error messages and simplify the probe
function's return path.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/amd/renoir/acp3x-pdm-dma.c | 19 +++++--------------
1 file changed, 5 insertions(+), 14 deletions(-)
diff --git a/sound/soc/amd/renoir/acp3x-pdm-dma.c b/sound/soc/amd/renoir/acp3x-pdm-dma.c
index 84ee9b931858..148b7e1f2c61 100644
--- a/sound/soc/amd/renoir/acp3x-pdm-dma.c
+++ b/sound/soc/amd/renoir/acp3x-pdm-dma.c
@@ -433,21 +433,12 @@ static int acp_pdm_audio_probe(struct platform_device *pdev)
status = devm_request_irq(&pdev->dev, adata->pdm_irq, pdm_irq_handler,
irqflags, "ACP_PDM_IRQ", adata);
- if (status) {
- dev_err(&pdev->dev, "ACP PDM IRQ request failed\n");
- return -ENODEV;
- }
+ if (status)
+ return status;
- status = devm_snd_soc_register_component(&pdev->dev,
- &acp_pdm_component,
- &acp_pdm_dai_driver, 1);
- if (status) {
- dev_err(&pdev->dev, "Fail to register acp pdm dai\n");
-
- return -ENODEV;
- }
-
- return 0;
+ return devm_snd_soc_register_component(&pdev->dev,
+ &acp_pdm_component,
+ &acp_pdm_dai_driver, 1);
}
static int acp_pdm_resume(struct device *dev)
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 7/9] ASoC: amd: vangogh: Use devm_pm_runtime_enable()
2026-12-04 11:16 [PATCH v2 0/9] ASoC: amd: Use devm_pm_runtime_enable() phucduc.bui
` (5 preceding siblings ...)
2026-12-04 11:16 ` [PATCH v2 6/9] ASoC: amd: renoir: Preserve probe error codes phucduc.bui
@ 2026-12-04 11:16 ` phucduc.bui
2026-12-04 11:52 ` sashiko-bot
2026-12-04 11:16 ` [PATCH v2 8/9] ASoC: amd: yc: " phucduc.bui
` (2 subsequent siblings)
9 siblings, 1 reply; 15+ messages in thread
From: phucduc.bui @ 2026-12-04 11:16 UTC (permalink / raw)
To: Mark Brown, Vijendar Mukunda, Venkata Prasad Potturu,
Syed Saba Kareem
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Kuninori Morimoto, wangdicheng, Chris Bainbridge, linux-sound,
linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Use devm_pm_runtime_enable() in the ACP5x PCM DMA driver to
automatically disable runtime PM when the device is removed.
This allows removing the remove callback.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Enable runtime PM before registering IRQs and components.
- Restore ACP_EXTERNAL_INTR_ENB in probe functions.
- Remove redundant error messages.
sound/soc/amd/vangogh/acp5x-pcm-dma.c | 34 +++++++++++----------------
1 file changed, 14 insertions(+), 20 deletions(-)
diff --git a/sound/soc/amd/vangogh/acp5x-pcm-dma.c b/sound/soc/amd/vangogh/acp5x-pcm-dma.c
index 8b09e66610b5..c6a247efe8cf 100644
--- a/sound/soc/amd/vangogh/acp5x-pcm-dma.c
+++ b/sound/soc/amd/vangogh/acp5x-pcm-dma.c
@@ -400,30 +400,25 @@ static int acp5x_audio_probe(struct platform_device *pdev)
adata->i2s_irq = status;
dev_set_drvdata(&pdev->dev, adata);
- status = devm_snd_soc_register_component(&pdev->dev,
- &acp5x_i2s_component,
- NULL, 0);
- if (status) {
- dev_err(&pdev->dev, "Fail to register acp i2s component\n");
- return status;
- }
- status = devm_request_irq(&pdev->dev, adata->i2s_irq, i2s_irq_handler,
- irqflags, "ACP5x_I2S_IRQ", adata);
- if (status) {
- dev_err(&pdev->dev, "ACP5x I2S IRQ request failed\n");
- return status;
- }
+
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);
- return 0;
-}
+ status = devm_pm_runtime_enable(&pdev->dev);
+ if (status)
+ return status;
-static void acp5x_audio_remove(struct platform_device *pdev)
-{
- pm_runtime_disable(&pdev->dev);
+ status = devm_request_irq(&pdev->dev, adata->i2s_irq, i2s_irq_handler,
+ irqflags, "ACP5x_I2S_IRQ", adata);
+ if (status)
+ return status;
+
+ acp_writel(1, adata->acp5x_base + ACP_EXTERNAL_INTR_ENB);
+
+ return devm_snd_soc_register_component(&pdev->dev,
+ &acp5x_i2s_component,
+ NULL, 0);
}
static int acp5x_pcm_resume(struct device *dev)
@@ -504,7 +499,6 @@ static const struct dev_pm_ops acp5x_pm_ops = {
static struct platform_driver acp5x_dma_driver = {
.probe = acp5x_audio_probe,
- .remove = acp5x_audio_remove,
.driver = {
.name = "acp5x_i2s_dma",
.pm = &acp5x_pm_ops,
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 7/9] ASoC: amd: vangogh: Use devm_pm_runtime_enable()
2026-12-04 11:16 ` [PATCH v2 7/9] ASoC: amd: vangogh: Use devm_pm_runtime_enable() phucduc.bui
@ 2026-12-04 11:52 ` sashiko-bot
0 siblings, 0 replies; 15+ messages in thread
From: sashiko-bot @ 2026-12-04 11:52 UTC (permalink / raw)
To: phucduc.bui; +Cc: linux-sound
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] ASoC: amd: vangogh: substream UAF on unbind from
devm_request_irq() reorder
- [Low] ASoC: amd: vangogh: commit message omits probe reordering and
register write
--
commit 48a79efdbd97c6a6e821890453d8f2abe6c27bae
Author: bui duc phuc <phucduc.bui@gmail.com>
> ASoC: amd: vangogh: Use devm_pm_runtime_enable()
>
> Use devm_pm_runtime_enable() in the ACP5x PCM DMA driver to
> automatically disable runtime PM when the device is removed.
>
> This allows removing the remove callback.
>
> Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
[Severity: Low]
Should the commit message also describe the other changes in
acp5x_audio_probe()? The patch reorders runtime PM, IRQ, and component
registration, adds a write to ACP_EXTERNAL_INTR_ENB, and drops the
dev_err() calls on failure.
Those changes are only listed below the --- separator, which is stripped
when applied, leaving the reason for reordering probe and restoring
ACP_EXTERNAL_INTR_ENB undocumented in git history.
> diff --git a/sound/soc/amd/vangogh/acp5x-pcm-dma.c b/sound/soc/amd/vangogh/acp5x-pcm-dma.c
> index 8b09e66610b52..c6a247efe8cfc 100644
> --- a/sound/soc/amd/vangogh/acp5x-pcm-dma.c
> +++ b/sound/soc/amd/vangogh/acp5x-pcm-dma.c
> @@ -400,30 +400,25 @@ static int acp5x_audio_probe(struct platform_device *pdev)
> adata->i2s_irq = status;
>
> dev_set_drvdata(&pdev->dev, adata);
> - status = devm_snd_soc_register_component(&pdev->dev,
> - &acp5x_i2s_component,
> - NULL, 0);
> - if (status) {
> - dev_err(&pdev->dev, "Fail to register acp i2s component\n");
> - return status;
> - }
> - status = devm_request_irq(&pdev->dev, adata->i2s_irq, i2s_irq_handler,
> - irqflags, "ACP5x_I2S_IRQ", adata);
> - if (status) {
> - dev_err(&pdev->dev, "ACP5x I2S IRQ request failed\n");
> - return status;
> - }
> +
> 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);
> - return 0;
> -}
> + status = devm_pm_runtime_enable(&pdev->dev);
> + if (status)
> + return status;
>
> -static void acp5x_audio_remove(struct platform_device *pdev)
> -{
> - pm_runtime_disable(&pdev->dev);
> + status = devm_request_irq(&pdev->dev, adata->i2s_irq, i2s_irq_handler,
> + irqflags, "ACP5x_I2S_IRQ", adata);
> + if (status)
> + return status;
> +
> + acp_writel(1, adata->acp5x_base + ACP_EXTERNAL_INTR_ENB);
> +
> + return devm_snd_soc_register_component(&pdev->dev,
> + &acp5x_i2s_component,
> + NULL, 0);
> }
[Severity: Medium]
Can moving devm_request_irq() ahead of devm_snd_soc_register_component()
cause a use-after-free of PCM substreams on device removal?
Because devres unwinds in LIFO order, devm_component_release() now runs
before devm_irq_release(). acp5x_i2s_component has no .sync_stop or
.remove callback, and acp5x_dma_close() clears the stream pointers without
locking or synchronize_irq(), so snd_card_free() frees the substreams
while i2s_irq_handler() is still active:
CPU0 CPU1
devres_release_all()
devm_component_release()
snd_soc_component_unregister()
...
i2s_irq_handler()
reads vg_i2s_data->play_stream
acp5x_dma_close()
adata->play_stream = NULL
snd_card_free()
kfree(substream)
snd_pcm_period_elapsed(play_stream)
<-- use-after-free
devm_irq_release()
free_irq()
Keeping devm_snd_soc_register_component() before devm_request_irq()
ensures free_irq() synchronizes and stops i2s_irq_handler() before the
component and its substreams are torn down.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261204111644.63432-1-phucduc.bui@gmail.com?part=7
^ permalink raw reply [flat|nested] 15+ messages in thread
* [PATCH v2 8/9] ASoC: amd: yc: Use devm_pm_runtime_enable()
2026-12-04 11:16 [PATCH v2 0/9] ASoC: amd: Use devm_pm_runtime_enable() phucduc.bui
` (6 preceding siblings ...)
2026-12-04 11:16 ` [PATCH v2 7/9] ASoC: amd: vangogh: Use devm_pm_runtime_enable() phucduc.bui
@ 2026-12-04 11:16 ` phucduc.bui
2026-12-04 11:16 ` [PATCH v2 9/9] ASoC: amd: yc: Simplify component registration phucduc.bui
2026-12-04 12:46 ` [PATCH v2 0/9] ASoC: amd: Use devm_pm_runtime_enable() Syed Saba Kareem
9 siblings, 0 replies; 15+ messages in thread
From: phucduc.bui @ 2026-12-04 11:16 UTC (permalink / raw)
To: Mark Brown, Vijendar Mukunda, Venkata Prasad Potturu,
Syed Saba Kareem
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Kuninori Morimoto, wangdicheng, Chris Bainbridge, linux-sound,
linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Use devm_pm_runtime_enable() in the ACP6x PDM DMA driver to
automatically disable runtime PM when the device is removed.
This allows removing the remove callback.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
Changes in v2:
- Enable runtime PM before registering components.
sound/soc/amd/yc/acp6x-pdm-dma.c | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
diff --git a/sound/soc/amd/yc/acp6x-pdm-dma.c b/sound/soc/amd/yc/acp6x-pdm-dma.c
index 3f8c73a1f182..99977b44bc9e 100644
--- a/sound/soc/amd/yc/acp6x-pdm-dma.c
+++ b/sound/soc/amd/yc/acp6x-pdm-dma.c
@@ -381,6 +381,15 @@ static int acp6x_pdm_audio_probe(struct platform_device *pdev)
adata->capture_stream = NULL;
dev_set_drvdata(&pdev->dev, adata);
+
+ pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS);
+ pm_runtime_use_autosuspend(&pdev->dev);
+ pm_runtime_mark_last_busy(&pdev->dev);
+ pm_runtime_set_active(&pdev->dev);
+ status = devm_pm_runtime_enable(&pdev->dev);
+ if (status)
+ return status;
+
status = devm_snd_soc_register_component(&pdev->dev,
&acp6x_pdm_component,
&acp6x_pdm_dai_driver, 1);
@@ -389,17 +398,8 @@ static int acp6x_pdm_audio_probe(struct platform_device *pdev)
return -ENODEV;
}
- pm_runtime_set_autosuspend_delay(&pdev->dev, ACP_SUSPEND_DELAY_MS);
- pm_runtime_use_autosuspend(&pdev->dev);
- pm_runtime_mark_last_busy(&pdev->dev);
- pm_runtime_set_active(&pdev->dev);
- pm_runtime_enable(&pdev->dev);
- return 0;
-}
-static void acp6x_pdm_audio_remove(struct platform_device *pdev)
-{
- pm_runtime_disable(&pdev->dev);
+ return 0;
}
static int acp6x_pdm_resume(struct device *dev)
@@ -448,7 +448,6 @@ static const struct dev_pm_ops acp6x_pdm_pm_ops = {
static struct platform_driver acp6x_pdm_dma_driver = {
.probe = acp6x_pdm_audio_probe,
- .remove = acp6x_pdm_audio_remove,
.driver = {
.name = "acp_yc_pdm_dma",
.pm = pm_ptr(&acp6x_pdm_pm_ops),
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* [PATCH v2 9/9] ASoC: amd: yc: Simplify component registration
2026-12-04 11:16 [PATCH v2 0/9] ASoC: amd: Use devm_pm_runtime_enable() phucduc.bui
` (7 preceding siblings ...)
2026-12-04 11:16 ` [PATCH v2 8/9] ASoC: amd: yc: " phucduc.bui
@ 2026-12-04 11:16 ` phucduc.bui
2026-12-04 12:46 ` [PATCH v2 0/9] ASoC: amd: Use devm_pm_runtime_enable() Syed Saba Kareem
9 siblings, 0 replies; 15+ messages in thread
From: phucduc.bui @ 2026-12-04 11:16 UTC (permalink / raw)
To: Mark Brown, Vijendar Mukunda, Venkata Prasad Potturu,
Syed Saba Kareem
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Kuninori Morimoto, wangdicheng, Chris Bainbridge, linux-sound,
linux-kernel, bui duc phuc
From: bui duc phuc <phucduc.bui@gmail.com>
Return the result of devm_snd_soc_register_component() directly
instead of checking and converting the error to -ENODEV.
Signed-off-by: bui duc phuc <phucduc.bui@gmail.com>
---
sound/soc/amd/yc/acp6x-pdm-dma.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/sound/soc/amd/yc/acp6x-pdm-dma.c b/sound/soc/amd/yc/acp6x-pdm-dma.c
index 99977b44bc9e..057ac5b35894 100644
--- a/sound/soc/amd/yc/acp6x-pdm-dma.c
+++ b/sound/soc/amd/yc/acp6x-pdm-dma.c
@@ -390,16 +390,9 @@ static int acp6x_pdm_audio_probe(struct platform_device *pdev)
if (status)
return status;
- status = devm_snd_soc_register_component(&pdev->dev,
- &acp6x_pdm_component,
- &acp6x_pdm_dai_driver, 1);
- if (status) {
- dev_err(&pdev->dev, "Fail to register acp pdm dai\n");
-
- return -ENODEV;
- }
-
- return 0;
+ return devm_snd_soc_register_component(&pdev->dev,
+ &acp6x_pdm_component,
+ &acp6x_pdm_dai_driver, 1);
}
static int acp6x_pdm_resume(struct device *dev)
--
2.43.0
^ permalink raw reply related [flat|nested] 15+ messages in thread* Re: [PATCH v2 0/9] ASoC: amd: Use devm_pm_runtime_enable()
2026-12-04 11:16 [PATCH v2 0/9] ASoC: amd: Use devm_pm_runtime_enable() phucduc.bui
` (8 preceding siblings ...)
2026-12-04 11:16 ` [PATCH v2 9/9] ASoC: amd: yc: Simplify component registration phucduc.bui
@ 2026-12-04 12:46 ` Syed Saba Kareem
9 siblings, 0 replies; 15+ messages in thread
From: Syed Saba Kareem @ 2026-12-04 12:46 UTC (permalink / raw)
To: phucduc.bui, Mark Brown, Vijendar Mukunda, Venkata Prasad Potturu
Cc: Liam Girdwood, Jaroslav Kysela, Takashi Iwai, Kees Cook,
Kuninori Morimoto, wangdicheng, Chris Bainbridge, linux-sound,
linux-kernel
On 12/4/26 16:46, phucduc.bui@gmail.com wrote:
> From: bui duc phuc <phucduc.bui@gmail.com>
>
> Hi all,
>
> Use devm_pm_runtime_enable() in AMD DMA drivers to
> automatically disable runtime PM when the devices are removed.
>
> This allows removing their remove callbacks.
Please address the comments from Sashiko and post a new revision.
We'll revision the updated patch from the AMD side.
>
> Link v1:
> https://lore.kernel.org/all/CAABR9nEtxzKfPEfD_ayUf5m8yMY67SEyH4fytz06UE4W1AZD2w@mail.gmail.com/
>
> Changes in v2:
> - Enable runtime PM before registering IRQs and components.
> - Restore ACP_EXTERNAL_INTR_ENB in Raven and Vangogh probe functions.
> - Preserve original error codes instead of converting them to -ENODEV.
> - Remove redundant error messages.
>
> Compile-tested only.
>
> Best regards,
> Phuc
>
> bui duc phuc (9):
> ASoC: amd: ps: Use devm_pm_runtime_enable()
> ASoC: amd: ps: Simplify component registration
> ASoC: amd: raven: Use devm_pm_runtime_enable()
> ASoC: amd: raven: Preserve probe error codes
> ASoC: amd: renoir: Use devm_pm_runtime_enable()
> ASoC: amd: renoir: Preserve probe error codes
> ASoC: amd: vangogh: Use devm_pm_runtime_enable()
> ASoC: amd: yc: Use devm_pm_runtime_enable()
> ASoC: amd: yc: Simplify component registration
>
> sound/soc/amd/ps/ps-pdm-dma.c | 20 +++++----------
> sound/soc/amd/ps/ps-sdw-dma.c | 21 +++++----------
> sound/soc/amd/raven/acp3x-pcm-dma.c | 37 ++++++++++++---------------
> sound/soc/amd/renoir/acp3x-pdm-dma.c | 31 ++++++++--------------
> sound/soc/amd/vangogh/acp5x-pcm-dma.c | 34 ++++++++++--------------
> sound/soc/amd/yc/acp6x-pdm-dma.c | 20 +++++----------
> 6 files changed, 61 insertions(+), 102 deletions(-
^ permalink raw reply [flat|nested] 15+ messages in thread