Re: [RFC PATCH v2 2/2] mmc: dw_mmc: cancel the watchdog timer on remove

From: Ulf Hansson

Date: Tue Nov 10 2026 - 09:46:37 EST


On Mon, Nov 2, 2026 at 3:29 AM BeaCox <0xbeac@xxxxxxxxx> wrote:
>
> The central watchdog added for command and data timeout handling is
> armed while a request is in flight and is only stopped when the
> completion is delivered. If the host is removed with a request still
> in flight, the timer can expire after the controller has been disabled
> and its callback reads the controller registers and the host state.
>
> Cancel the timer after bh_work has been disabled, so that a work item
> that is still running cannot rearm it after the cancellation.
>
> Fixes: ce0043b9a302 ("mmc: dw_mmc: add central watchdog and convert CTO onto it")
> Signed-off-by: BeaCox <0xbeac@xxxxxxxxx>

Applied for next, thanks!

Kind regards
Uffe


> ---
> drivers/mmc/host/dw_mmc.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 5b47643..dc3beab 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -3410,6 +3410,7 @@ void dw_mci_remove(struct dw_mci *host)
> /* Stop the work before the timer that it can rearm. */
> disable_work_sync(&host->bh_work);
> dw_mci_stop_fault_timer(host);
> + hrtimer_cancel(&host->wd_timer);
>
> /* disable clock to CIU */
> mci_writel(host, CLKENA, 0);
> --
> 2.43.0
>