diff mbox series

[v2] mmc: mtk-sd: disable wakeup in .remove() and in the error path of .probe()

Message ID 20241203023442.2434018-1-joe@pf.is.s.u-tokyo.ac.jp
State New
Headers show
Series [v2] mmc: mtk-sd: disable wakeup in .remove() and in the error path of .probe() | expand

Commit Message

Joe Hattori Dec. 3, 2024, 2:34 a.m. UTC
Current implementation leaves pdev->dev as a wakeup source. Add a
device_init_wakeup(&pdev->dev, false) call in the .remove() function and
in the error path of the .probe() function.

Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
Fixes: 527f36f5efa4 ("mmc: mediatek: add support for SDIO eint wakup IRQ")
---
 drivers/mmc/host/mtk-sd.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Ulf Hansson Dec. 10, 2024, 4:09 p.m. UTC | #1
On Tue, 3 Dec 2024 at 03:34, Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp> wrote:
>
> Current implementation leaves pdev->dev as a wakeup source. Add a
> device_init_wakeup(&pdev->dev, false) call in the .remove() function and
> in the error path of the .probe() function.
>
> Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
> Fixes: 527f36f5efa4 ("mmc: mediatek: add support for SDIO eint wakup IRQ")

Applied for fixes and by adding a stable tag, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/mtk-sd.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
> index efb0d2d5716b..af445d3f8e2a 100644
> --- a/drivers/mmc/host/mtk-sd.c
> +++ b/drivers/mmc/host/mtk-sd.c
> @@ -3070,6 +3070,7 @@ static int msdc_drv_probe(struct platform_device *pdev)
>         msdc_gate_clock(host);
>         platform_set_drvdata(pdev, NULL);
>  release_mem:
> +       device_init_wakeup(&pdev->dev, false);
>         if (host->dma.gpd)
>                 dma_free_coherent(&pdev->dev,
>                         2 * sizeof(struct mt_gpdma_desc),
> @@ -3103,6 +3104,7 @@ static void msdc_drv_remove(struct platform_device *pdev)
>                         host->dma.gpd, host->dma.gpd_addr);
>         dma_free_coherent(&pdev->dev, MAX_BD_NUM * sizeof(struct mt_bdma_desc),
>                           host->dma.bd, host->dma.bd_addr);
> +       device_init_wakeup(&pdev->dev, false);
>  }
>
>  static void msdc_save_reg(struct msdc_host *host)
> --
> 2.34.1
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/mtk-sd.c b/drivers/mmc/host/mtk-sd.c
index efb0d2d5716b..af445d3f8e2a 100644
--- a/drivers/mmc/host/mtk-sd.c
+++ b/drivers/mmc/host/mtk-sd.c
@@ -3070,6 +3070,7 @@  static int msdc_drv_probe(struct platform_device *pdev)
 	msdc_gate_clock(host);
 	platform_set_drvdata(pdev, NULL);
 release_mem:
+	device_init_wakeup(&pdev->dev, false);
 	if (host->dma.gpd)
 		dma_free_coherent(&pdev->dev,
 			2 * sizeof(struct mt_gpdma_desc),
@@ -3103,6 +3104,7 @@  static void msdc_drv_remove(struct platform_device *pdev)
 			host->dma.gpd, host->dma.gpd_addr);
 	dma_free_coherent(&pdev->dev, MAX_BD_NUM * sizeof(struct mt_bdma_desc),
 			  host->dma.bd, host->dma.bd_addr);
+	device_init_wakeup(&pdev->dev, false);
 }
 
 static void msdc_save_reg(struct msdc_host *host)