Linux Sound subsystem development
 help / color / mirror / Atom feed
* [PATCH 0/6] ASoC: fix error and remove paths in several drivers
@ 2026-12-01 19:23 Arina Kharlamova via B4 Relay
  2026-12-01 19:23 ` [PATCH 1/6] ASoC: bcm: bcm63xx-pcm-whistler: Fix dma_desc leak and double free Arina Kharlamova via B4 Relay
                   ` (5 more replies)
  0 siblings, 6 replies; 8+ messages in thread
From: Arina Kharlamova via B4 Relay @ 2026-12-01 19:23 UTC (permalink / raw)
  To: Mark Brown, Jaroslav Kysela, Takashi Iwai, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Shawn Guo, Heiko Stuebner,
	Sugar Zhang, Thierry Reding, Jonathan Hunter, Sameer Pujar,
	Liam Girdwood
  Cc: linux-sound, patches, imx, linux-arm-kernel, linux-rockchip,
	linux-tegra, Wentao Liang, Arina Kharlamova

Fixes for resources that are freed twice, left registered or not
released on probe failure and unbind, in bcm63xx-pcm-whistler,
wm8903, mxs-saif, rockchip_pdm and tegra210_ahub.

I found this with spec2patch. I model-checked the probe and remove paths
of the driver with CBMC against formal specifications of the kernel APIs
it calls. The specifications are checked against the kernel source, and
some of them are proved in Rocq against a transcription of the kernel
code. I also checked lock usage separately. With the help of an AI
coding assistant (Claude); I reviewed the analysis and the fix.
Compile-tested only, not tested on hardware.

The mxs-saif patch also covers the error path fixed by Wentao
Liang's patch; only one of the two is needed:
https://lore.kernel.org/all/20261104024048.1508618-1-vulab@iscas.ac.cn/

To: Liam Girdwood <lgirdwood@gmail.com>

---
Arina Kharlamova (6):
      ASoC: bcm: bcm63xx-pcm-whistler: Fix dma_desc leak and double free
      ASoC: wm8903: Use devm_gpiochip_add_data() to add the GPIO chip
      ASoC: wm8903: Free the IRQ when component registration fails
      ASoC: mxs-saif: Use devm helpers to register mclk
      ASoC: rockchip: rockchip_pdm: Fix unbalanced clk disable in remove
      ASoC: tegra: tegra210_ahub: Depopulate child devices on remove

 sound/soc/bcm/bcm63xx-pcm-whistler.c |  5 +++++
 sound/soc/codecs/wm8903.c            | 17 +++++------------
 sound/soc/mxs/mxs-saif.c             | 21 ++++++++++-----------
 sound/soc/rockchip/rockchip_pdm.c    |  1 -
 sound/soc/tegra/tegra210_ahub.c      |  1 +
 5 files changed, 21 insertions(+), 24 deletions(-)
---
base-commit: 20ee6031645dbed8ddf8f4833edf415f3760607f
change-id: 20261201-s2p-asoc-misc-3c5eeb91dc7a

Best regards,
--  
Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH 1/6] ASoC: bcm: bcm63xx-pcm-whistler: Fix dma_desc leak and double free
  2026-12-01 19:23 [PATCH 0/6] ASoC: fix error and remove paths in several drivers Arina Kharlamova via B4 Relay
@ 2026-12-01 19:23 ` Arina Kharlamova via B4 Relay
  2026-12-01 19:23 ` [PATCH 2/6] ASoC: wm8903: Use devm_gpiochip_add_data() to add the GPIO chip Arina Kharlamova via B4 Relay
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Arina Kharlamova via B4 Relay @ 2026-12-01 19:23 UTC (permalink / raw)
  To: Mark Brown, Jaroslav Kysela, Takashi Iwai, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Shawn Guo, Heiko Stuebner,
	Sugar Zhang, Thierry Reding, Jonathan Hunter, Sameer Pujar,
	Liam Girdwood
  Cc: linux-sound, patches, imx, linux-arm-kernel, linux-rockchip,
	linux-tegra, Wentao Liang, Arina Kharlamova

From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>

bcm63xx_pcm_hw_params() allocates a new i2s_dma_desc on every call and
stores it as the DMA data of the CPU DAI. The PCM core allows
hw_params to be called again in the SETUP and PREPARED states without
a hw_free in between, so the descriptor from the previous call is
overwritten and leaked.

bcm63xx_pcm_hw_free() frees the descriptor but leaves the pointer in
the DAI. hw_free can run again without a new allocation, for example
when snd_pcm_hw_params() fails in snd_pcm_hw_refine() and calls the
hw_free op from its error path. The stale pointer is then passed to
kfree() a second time.

Keep the existing descriptor when hw_params is called again, and clear
the DAI DMA data after the descriptor has been freed.

Fixes: 88eb404ccc3e ("ASoC: brcm: Add DSL/PON SoC audio driver")
Signed-off-by: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
---
 sound/soc/bcm/bcm63xx-pcm-whistler.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sound/soc/bcm/bcm63xx-pcm-whistler.c b/sound/soc/bcm/bcm63xx-pcm-whistler.c
index a40f6bed69c6..3449525dfaf7 100644
--- a/sound/soc/bcm/bcm63xx-pcm-whistler.c
+++ b/sound/soc/bcm/bcm63xx-pcm-whistler.c
@@ -48,6 +48,10 @@ static int bcm63xx_pcm_hw_params(struct snd_soc_component *component,
 	struct i2s_dma_desc *dma_desc;
 	struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream);
 
+	dma_desc = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
+	if (dma_desc)
+		return 0;
+
 	dma_desc = kzalloc_obj(*dma_desc, GFP_NOWAIT);
 	if (!dma_desc)
 		return -ENOMEM;
@@ -65,6 +69,7 @@ static int bcm63xx_pcm_hw_free(struct snd_soc_component *component,
 
 	dma_desc = snd_soc_dai_get_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream);
 	kfree(dma_desc);
+	snd_soc_dai_set_dma_data(snd_soc_rtd_to_cpu(rtd, 0), substream, NULL);
 
 	return 0;
 }

-- 
Git-157)



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/6] ASoC: wm8903: Use devm_gpiochip_add_data() to add the GPIO chip
  2026-12-01 19:23 [PATCH 0/6] ASoC: fix error and remove paths in several drivers Arina Kharlamova via B4 Relay
  2026-12-01 19:23 ` [PATCH 1/6] ASoC: bcm: bcm63xx-pcm-whistler: Fix dma_desc leak and double free Arina Kharlamova via B4 Relay
@ 2026-12-01 19:23 ` Arina Kharlamova via B4 Relay
  2026-12-01 19:23 ` [PATCH 3/6] ASoC: wm8903: Free the IRQ when component registration fails Arina Kharlamova via B4 Relay
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Arina Kharlamova via B4 Relay @ 2026-12-01 19:23 UTC (permalink / raw)
  To: Mark Brown, Jaroslav Kysela, Takashi Iwai, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Shawn Guo, Heiko Stuebner,
	Sugar Zhang, Thierry Reding, Jonathan Hunter, Sameer Pujar,
	Liam Girdwood
  Cc: linux-sound, patches, imx, linux-arm-kernel, linux-rockchip,
	linux-tegra, Wentao Liang, Arina Kharlamova

From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>

wm8903_i2c_probe() adds the GPIO chip and can still fail after that,
when the interrupt cannot be requested or the component cannot be
registered. The error path only disables the regulators, so the chip
stays registered while devres frees the wm8903_priv structure that
contains it.

wm8903_init_gpio() also only logs a failure of gpiochip_add_data(), and
wm8903_i2c_remove() calls gpiochip_remove() regardless.

Add the chip with devm_gpiochip_add_data(). It is then removed on probe
failure and on unbind, before the regmap and the driver data are
released, and only if it was added.

Fixes: 0bf79ef2c303 ("ASoC: wm8903: init GPIOs during I2C probe not codec probe")
Fixes: 7cfe56172ac1 ("ASoC: wm8903: Expose GPIOs through gpiolib")
Signed-off-by: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
---
 sound/soc/codecs/wm8903.c | 12 +-----------
 1 file changed, 1 insertion(+), 11 deletions(-)

diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index 065499f33d21..d47799209727 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -1891,23 +1891,14 @@ static void wm8903_init_gpio(struct wm8903_priv *wm8903)
 	else
 		wm8903->gpio_chip.base = -1;
 
-	ret = gpiochip_add_data(&wm8903->gpio_chip, wm8903);
+	ret = devm_gpiochip_add_data(wm8903->dev, &wm8903->gpio_chip, wm8903);
 	if (ret != 0)
 		dev_err(wm8903->dev, "Failed to add GPIOs: %d\n", ret);
 }
-
-static void wm8903_free_gpio(struct wm8903_priv *wm8903)
-{
-	gpiochip_remove(&wm8903->gpio_chip);
-}
 #else
 static void wm8903_init_gpio(struct wm8903_priv *wm8903)
 {
 }
-
-static void wm8903_free_gpio(struct wm8903_priv *wm8903)
-{
-}
 #endif
 
 static const struct snd_soc_component_driver soc_component_dev_wm8903 = {
@@ -2221,7 +2212,6 @@ static void wm8903_i2c_remove(struct i2c_client *client)
 			       wm8903->supplies);
 	if (client->irq)
 		free_irq(client->irq, wm8903);
-	wm8903_free_gpio(wm8903);
 }
 
 static const struct of_device_id wm8903_of_match[] = {

-- 
Git-157)



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/6] ASoC: wm8903: Free the IRQ when component registration fails
  2026-12-01 19:23 [PATCH 0/6] ASoC: fix error and remove paths in several drivers Arina Kharlamova via B4 Relay
  2026-12-01 19:23 ` [PATCH 1/6] ASoC: bcm: bcm63xx-pcm-whistler: Fix dma_desc leak and double free Arina Kharlamova via B4 Relay
  2026-12-01 19:23 ` [PATCH 2/6] ASoC: wm8903: Use devm_gpiochip_add_data() to add the GPIO chip Arina Kharlamova via B4 Relay
@ 2026-12-01 19:23 ` Arina Kharlamova via B4 Relay
  2026-12-01 19:23 ` [PATCH 4/6] ASoC: mxs-saif: Use devm helpers to register mclk Arina Kharlamova via B4 Relay
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 8+ messages in thread
From: Arina Kharlamova via B4 Relay @ 2026-12-01 19:23 UTC (permalink / raw)
  To: Mark Brown, Jaroslav Kysela, Takashi Iwai, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Shawn Guo, Heiko Stuebner,
	Sugar Zhang, Thierry Reding, Jonathan Hunter, Sameer Pujar,
	Liam Girdwood
  Cc: linux-sound, patches, imx, linux-arm-kernel, linux-rockchip,
	linux-tegra, Wentao Liang, Arina Kharlamova

From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>

wm8903_i2c_probe() requests the interrupt with wm8903 as dev_id before
it registers the component. If devm_snd_soc_register_component()
fails, the error path only disables the regulators. The interrupt
stays requested while wm8903, which is devm allocated, is freed.

Free the interrupt on that error path.

Fixes: b7c95d9146c8 ("ASoC: wm8903: Move interrupt request to I2C probe")
Signed-off-by: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
---
 sound/soc/codecs/wm8903.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/sound/soc/codecs/wm8903.c b/sound/soc/codecs/wm8903.c
index d47799209727..9f988e217bbf 100644
--- a/sound/soc/codecs/wm8903.c
+++ b/sound/soc/codecs/wm8903.c
@@ -2195,9 +2195,12 @@ static int wm8903_i2c_probe(struct i2c_client *i2c)
 	ret = devm_snd_soc_register_component(&i2c->dev,
 			&soc_component_dev_wm8903, &wm8903_dai, 1);
 	if (ret != 0)
-		goto err;
+		goto err_irq;
 
 	return 0;
+err_irq:
+	if (i2c->irq)
+		free_irq(i2c->irq, wm8903);
 err:
 	regulator_bulk_disable(ARRAY_SIZE(wm8903->supplies),
 			       wm8903->supplies);

-- 
Git-157)



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 4/6] ASoC: mxs-saif: Use devm helpers to register mclk
  2026-12-01 19:23 [PATCH 0/6] ASoC: fix error and remove paths in several drivers Arina Kharlamova via B4 Relay
                   ` (2 preceding siblings ...)
  2026-12-01 19:23 ` [PATCH 3/6] ASoC: wm8903: Free the IRQ when component registration fails Arina Kharlamova via B4 Relay
@ 2026-12-01 19:23 ` Arina Kharlamova via B4 Relay
  2026-12-01 19:32   ` sashiko-bot
  2026-12-01 19:23 ` [PATCH 5/6] ASoC: rockchip: rockchip_pdm: Fix unbalanced clk disable in remove Arina Kharlamova via B4 Relay
  2026-12-01 19:23 ` [PATCH 6/6] ASoC: tegra: tegra210_ahub: Depopulate child devices on remove Arina Kharlamova via B4 Relay
  5 siblings, 1 reply; 8+ messages in thread
From: Arina Kharlamova via B4 Relay @ 2026-12-01 19:23 UTC (permalink / raw)
  To: Mark Brown, Jaroslav Kysela, Takashi Iwai, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Shawn Guo, Heiko Stuebner,
	Sugar Zhang, Thierry Reding, Jonathan Hunter, Sameer Pujar,
	Liam Girdwood
  Cc: linux-sound, patches, imx, linux-arm-kernel, linux-rockchip,
	linux-tegra, Wentao Liang, Arina Kharlamova

From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>

mxs_saif_mclk_init() registers the "mxs_saif_mclk" divider and an OF
clock provider for it, and nothing unregisters them. The divider uses
saif->base + SAIF_CTRL as its register and saif->base is mapped with
devm_platform_ioremap_resource(). When probe fails later, for example
with -EPROBE_DEFER from the DMA PCM registration, or the driver is
unbound, the clock stays registered and points into a mapping that is
gone.

On the next probe clk_register_divider() returns -EEXIST, which
mxs_saif_mclk_init() treats as success, so the clock keeps the old
register address.

Register the divider with devm_clk_hw_register_divider() and the
provider with devm_of_clk_add_hw_provider(). Both are then removed
before the register mapping when the driver is unbound or probe fails.

Fixes: 7c9e6150f2e7 ("ASoC: mxs: register saif mclk to clock framework")
---
This also covers the error path fixed by Wentao Liang's patch; only one
of the two is needed:
https://lore.kernel.org/all/20261104024048.1508618-1-vulab@iscas.ac.cn/

Signed-off-by: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
---
 sound/soc/mxs/mxs-saif.c | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c
index abdead349a4d..d6aaf200c9aa 100644
--- a/sound/soc/mxs/mxs-saif.c
+++ b/sound/soc/mxs/mxs-saif.c
@@ -765,24 +765,23 @@ static irqreturn_t mxs_saif_irq(int irq, void *dev_id)
 static int mxs_saif_mclk_init(struct platform_device *pdev)
 {
 	struct mxs_saif *saif = platform_get_drvdata(pdev);
-	struct device_node *np = pdev->dev.of_node;
-	struct clk *clk;
+	struct clk_hw *hw;
 	int ret;
 
-	clk = clk_register_divider(&pdev->dev, "mxs_saif_mclk",
-				   __clk_get_name(saif->clk), 0,
-				   saif->base + SAIF_CTRL,
-				   BP_SAIF_CTRL_BITCLK_MULT_RATE, 3,
-				   0, NULL);
-	if (IS_ERR(clk)) {
-		ret = PTR_ERR(clk);
+	hw = devm_clk_hw_register_divider(&pdev->dev, "mxs_saif_mclk",
+					  __clk_get_name(saif->clk), 0,
+					  saif->base + SAIF_CTRL,
+					  BP_SAIF_CTRL_BITCLK_MULT_RATE, 3,
+					  0, NULL);
+	if (IS_ERR(hw)) {
+		ret = PTR_ERR(hw);
 		if (ret == -EEXIST)
 			return 0;
 		dev_err(&pdev->dev, "failed to register mclk: %d\n", ret);
-		return PTR_ERR(clk);
+		return PTR_ERR(hw);
 	}
 
-	ret = of_clk_add_provider(np, of_clk_src_simple_get, clk);
+	ret = devm_of_clk_add_hw_provider(&pdev->dev, of_clk_hw_simple_get, hw);
 	if (ret)
 		return ret;
 

-- 
Git-157)



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 5/6] ASoC: rockchip: rockchip_pdm: Fix unbalanced clk disable in remove
  2026-12-01 19:23 [PATCH 0/6] ASoC: fix error and remove paths in several drivers Arina Kharlamova via B4 Relay
                   ` (3 preceding siblings ...)
  2026-12-01 19:23 ` [PATCH 4/6] ASoC: mxs-saif: Use devm helpers to register mclk Arina Kharlamova via B4 Relay
@ 2026-12-01 19:23 ` Arina Kharlamova via B4 Relay
  2026-12-01 19:23 ` [PATCH 6/6] ASoC: tegra: tegra210_ahub: Depopulate child devices on remove Arina Kharlamova via B4 Relay
  5 siblings, 0 replies; 8+ messages in thread
From: Arina Kharlamova via B4 Relay @ 2026-12-01 19:23 UTC (permalink / raw)
  To: Mark Brown, Jaroslav Kysela, Takashi Iwai, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Shawn Guo, Heiko Stuebner,
	Sugar Zhang, Thierry Reding, Jonathan Hunter, Sameer Pujar,
	Liam Girdwood
  Cc: linux-sound, patches, imx, linux-arm-kernel, linux-rockchip,
	linux-tegra, Wentao Liang, Arina Kharlamova

From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>

pdm->clk is enabled only by rockchip_pdm_runtime_resume() and disabled
by rockchip_pdm_runtime_suspend(). rockchip_pdm_remove() disables
runtime PM, calls rockchip_pdm_runtime_suspend() by hand if the device
is not suspended yet, and then calls clk_disable_unprepare(pdm->clk)
once more. The driver holds no enable on that clock at this point, so
every unbind disables and unprepares it one time too many. The clk core
warns that the clock is already disabled and already unprepared, unless
another consumer still has it enabled.

Drop the extra call. The clk_disable_unprepare(pdm->hclk) that follows
stays because it pairs with the clk_prepare_enable() in
rockchip_pdm_probe().

Fixes: fc05a5b22253 ("ASoC: rockchip: add support for pdm controller")
Signed-off-by: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
---
 sound/soc/rockchip/rockchip_pdm.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/sound/soc/rockchip/rockchip_pdm.c b/sound/soc/rockchip/rockchip_pdm.c
index a0a89f5bddd9..cc057b47b4d0 100644
--- a/sound/soc/rockchip/rockchip_pdm.c
+++ b/sound/soc/rockchip/rockchip_pdm.c
@@ -670,7 +670,6 @@ static void rockchip_pdm_remove(struct platform_device *pdev)
 	if (!pm_runtime_status_suspended(&pdev->dev))
 		rockchip_pdm_runtime_suspend(&pdev->dev);
 
-	clk_disable_unprepare(pdm->clk);
 	clk_disable_unprepare(pdm->hclk);
 }
 

-- 
Git-157)



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 6/6] ASoC: tegra: tegra210_ahub: Depopulate child devices on remove
  2026-12-01 19:23 [PATCH 0/6] ASoC: fix error and remove paths in several drivers Arina Kharlamova via B4 Relay
                   ` (4 preceding siblings ...)
  2026-12-01 19:23 ` [PATCH 5/6] ASoC: rockchip: rockchip_pdm: Fix unbalanced clk disable in remove Arina Kharlamova via B4 Relay
@ 2026-12-01 19:23 ` Arina Kharlamova via B4 Relay
  5 siblings, 0 replies; 8+ messages in thread
From: Arina Kharlamova via B4 Relay @ 2026-12-01 19:23 UTC (permalink / raw)
  To: Mark Brown, Jaroslav Kysela, Takashi Iwai, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Shawn Guo, Heiko Stuebner,
	Sugar Zhang, Thierry Reding, Jonathan Hunter, Sameer Pujar,
	Liam Girdwood
  Cc: linux-sound, patches, imx, linux-arm-kernel, linux-rockchip,
	linux-tegra, Wentao Liang, Arina Kharlamova

From: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>

tegra_ahub_probe() creates the AHUB child devices with
of_platform_populate(), but tegra_ahub_remove() only disables runtime
PM. The children stay registered and bound to their drivers after the
AHUB driver is unbound. They also keep using the AHUB as their parent
while its runtime PM is disabled, and a later probe of the AHUB does
not create them again.

Call of_platform_depopulate() in tegra_ahub_remove() before runtime PM
of the AHUB device is disabled, as tegra30_ahub does.

Fixes: 16e1bcc2caf4 ("ASoC: tegra: Add Tegra210 based AHUB driver")
Signed-off-by: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>
---
 sound/soc/tegra/tegra210_ahub.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/sound/soc/tegra/tegra210_ahub.c b/sound/soc/tegra/tegra210_ahub.c
index 3deaa599f53a..c2fffdf5e0ce 100644
--- a/sound/soc/tegra/tegra210_ahub.c
+++ b/sound/soc/tegra/tegra210_ahub.c
@@ -2654,6 +2654,7 @@ static int tegra_ahub_probe(struct platform_device *pdev)
 
 static void tegra_ahub_remove(struct platform_device *pdev)
 {
+	of_platform_depopulate(&pdev->dev);
 	pm_runtime_disable(&pdev->dev);
 }
 

-- 
Git-157)



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 4/6] ASoC: mxs-saif: Use devm helpers to register mclk
  2026-12-01 19:23 ` [PATCH 4/6] ASoC: mxs-saif: Use devm helpers to register mclk Arina Kharlamova via B4 Relay
@ 2026-12-01 19:32   ` sashiko-bot
  0 siblings, 0 replies; 8+ messages in thread
From: sashiko-bot @ 2026-12-01 19:32 UTC (permalink / raw)
  To: Arina Kharlamova; +Cc: linux-sound, imx, Frank.Li

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] ASoC: mxs-saif: missing Signed-off-by trailer above ---
  separator
--

commit 5021fc1fda76b542f9e9ddbe9928d5a2500e70f7
Author: Arina Kharlamova <arina.kharlamova@mbzuai.ac.ae>

> ASoC: mxs-saif: Use devm helpers to register mclk
>
> mxs_saif_mclk_init() registers the "mxs_saif_mclk" divider and an OF
> clock provider for it, and nothing unregisters them. The divider uses
> saif->base + SAIF_CTRL as its register and saif->base is mapped with
> devm_platform_ioremap_resource(). When probe fails later, for example
> with -EPROBE_DEFER from the DMA PCM registration, or the driver is
> unbound, the clock stays registered and points into a mapping that is
> gone.
>
> On the next probe clk_register_divider() returns -EEXIST, which
> mxs_saif_mclk_init() treats as success, so the clock keeps the old
> register address.
>
> Register the divider with devm_clk_hw_register_divider() and the
> provider with devm_of_clk_add_hw_provider(). Both are then removed
> before the register mapping when the driver is unbound or probe fails.
>
> Fixes: 7c9e6150f2e7 ("ASoC: mxs: register saif mclk to clock framework")

[Severity: High]
The Signed-off-by trailer was placed below the first "---" separator line
in the patch, so git am strips it from the commit message.  It should be
moved above the "---" separator right after the Fixes trailer.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261201-s2p-asoc-misc-v1-0-eda774714731@mbzuai.ac.ae?part=4

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2026-12-01 19:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 19:23 [PATCH 0/6] ASoC: fix error and remove paths in several drivers Arina Kharlamova via B4 Relay
2026-12-01 19:23 ` [PATCH 1/6] ASoC: bcm: bcm63xx-pcm-whistler: Fix dma_desc leak and double free Arina Kharlamova via B4 Relay
2026-12-01 19:23 ` [PATCH 2/6] ASoC: wm8903: Use devm_gpiochip_add_data() to add the GPIO chip Arina Kharlamova via B4 Relay
2026-12-01 19:23 ` [PATCH 3/6] ASoC: wm8903: Free the IRQ when component registration fails Arina Kharlamova via B4 Relay
2026-12-01 19:23 ` [PATCH 4/6] ASoC: mxs-saif: Use devm helpers to register mclk Arina Kharlamova via B4 Relay
2026-12-01 19:32   ` sashiko-bot
2026-12-01 19:23 ` [PATCH 5/6] ASoC: rockchip: rockchip_pdm: Fix unbalanced clk disable in remove Arina Kharlamova via B4 Relay
2026-12-01 19:23 ` [PATCH 6/6] ASoC: tegra: tegra210_ahub: Depopulate child devices on remove Arina Kharlamova via B4 Relay

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox