* [PATCH -next] mmc: atmel-mci: Add missing clk_disable_unprepare()
@ 2025-02-25 2:28 Gu Bowen
2025-02-28 18:39 ` Aubin Constans
2025-03-12 11:24 ` Ulf Hansson
0 siblings, 2 replies; 3+ messages in thread
From: Gu Bowen @ 2025-02-25 2:28 UTC (permalink / raw)
To: aubin.constans, ulf.hansson
Cc: nicolas.ferre, alexandre.belloni, claudiu.beznea,
ludovic.desroches, linux-mmc, linux-arm-kernel, linux-kernel,
wangweiyang2
The error path when atmci_configure_dma() set dma fails in atmci driver
does not correctly disable the clock.
Add the missing clk_disable_unprepare() to the error path for pair with
clk_prepare_enable().
Fixes: 467e081d23e6 ("mmc: atmel-mci: use probe deferring if dma controller is not ready yet")
Signed-off-by: Gu Bowen <gubowen5@huawei.com>
---
drivers/mmc/host/atmel-mci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index fc360902729d..24fffc702a94 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -2499,8 +2499,10 @@ static int atmci_probe(struct platform_device *pdev)
/* Get MCI capabilities and set operations according to it */
atmci_get_cap(host);
ret = atmci_configure_dma(host);
- if (ret == -EPROBE_DEFER)
+ if (ret == -EPROBE_DEFER) {
+ clk_disable_unprepare(host->mck);
goto err_dma_probe_defer;
+ }
if (ret == 0) {
host->prepare_data = &atmci_prepare_data_dma;
host->submit_data = &atmci_submit_data_dma;
--
2.25.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH -next] mmc: atmel-mci: Add missing clk_disable_unprepare()
2025-02-25 2:28 [PATCH -next] mmc: atmel-mci: Add missing clk_disable_unprepare() Gu Bowen
@ 2025-02-28 18:39 ` Aubin Constans
2025-03-12 11:24 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Aubin Constans @ 2025-02-28 18:39 UTC (permalink / raw)
To: Gu Bowen, ulf.hansson
Cc: nicolas.ferre, alexandre.belloni, claudiu.beznea,
ludovic.desroches, linux-mmc, linux-arm-kernel, linux-kernel,
wangweiyang2
On 25/02/2025 03:28, Gu Bowen wrote:
> The error path when atmci_configure_dma() set dma fails in atmci driver
> does not correctly disable the clock.
> Add the missing clk_disable_unprepare() to the error path for pair with
> clk_prepare_enable().
>
> Fixes: 467e081d23e6 ("mmc: atmel-mci: use probe deferring if dma controller is not ready yet")
> Signed-off-by: Gu Bowen <gubowen5@huawei.com>
Acked-by: Aubin Constans <aubin.constans@microchip.com>
> ---
> drivers/mmc/host/atmel-mci.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index fc360902729d..24fffc702a94 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -2499,8 +2499,10 @@ static int atmci_probe(struct platform_device *pdev)
> /* Get MCI capabilities and set operations according to it */
> atmci_get_cap(host);
> ret = atmci_configure_dma(host);
> - if (ret == -EPROBE_DEFER)
> + if (ret == -EPROBE_DEFER) {
> + clk_disable_unprepare(host->mck);
> goto err_dma_probe_defer;
> + }
> if (ret == 0) {
> host->prepare_data = &atmci_prepare_data_dma;
> host->submit_data = &atmci_submit_data_dma;
> --
> 2.25.1
>
Thank you for having identified and fixed this.
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH -next] mmc: atmel-mci: Add missing clk_disable_unprepare()
2025-02-25 2:28 [PATCH -next] mmc: atmel-mci: Add missing clk_disable_unprepare() Gu Bowen
2025-02-28 18:39 ` Aubin Constans
@ 2025-03-12 11:24 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2025-03-12 11:24 UTC (permalink / raw)
To: Gu Bowen
Cc: aubin.constans, nicolas.ferre, alexandre.belloni, claudiu.beznea,
ludovic.desroches, linux-mmc, linux-arm-kernel, linux-kernel,
wangweiyang2
On Tue, 25 Feb 2025 at 03:18, Gu Bowen <gubowen5@huawei.com> wrote:
>
> The error path when atmci_configure_dma() set dma fails in atmci driver
> does not correctly disable the clock.
> Add the missing clk_disable_unprepare() to the error path for pair with
> clk_prepare_enable().
>
> Fixes: 467e081d23e6 ("mmc: atmel-mci: use probe deferring if dma controller is not ready yet")
> Signed-off-by: Gu Bowen <gubowen5@huawei.com>
Applied for fixes and by adding a stable tag, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/host/atmel-mci.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index fc360902729d..24fffc702a94 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -2499,8 +2499,10 @@ static int atmci_probe(struct platform_device *pdev)
> /* Get MCI capabilities and set operations according to it */
> atmci_get_cap(host);
> ret = atmci_configure_dma(host);
> - if (ret == -EPROBE_DEFER)
> + if (ret == -EPROBE_DEFER) {
> + clk_disable_unprepare(host->mck);
> goto err_dma_probe_defer;
> + }
> if (ret == 0) {
> host->prepare_data = &atmci_prepare_data_dma;
> host->submit_data = &atmci_submit_data_dma;
> --
> 2.25.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-03-12 11:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-25 2:28 [PATCH -next] mmc: atmel-mci: Add missing clk_disable_unprepare() Gu Bowen
2025-02-28 18:39 ` Aubin Constans
2025-03-12 11:24 ` Ulf Hansson
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox