From: Shawn Lin <shawn.lin@rock-chips.com>
To: BeaCox <0xbeac@gmail.com>
Cc: shawn.lin@rock-chips.com, linux-mmc@vger.kernel.org,
linux-kernel@vger.kernel.org,
Jaehoon Chung <jh80.chung@samsung.com>,
Ulf Hansson <ulfh@kernel.org>
Subject: Re: [RFC PATCH v2 2/2] mmc: dw_mmc: cancel the watchdog timer on remove
Date: Mon, 2 Nov 2026 10:33:52 +0800 [thread overview]
Message-ID: <f4313b18-4ce2-4a1c-ab03-512da50191f5@rock-chips.com> (raw)
In-Reply-To: <20261102022924.51343-3-0xbeac@gmail.com>
在 2026/11/02 星期一 10:29, BeaCox 写道:
> 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.
>
Thanks for this fix,
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
> Fixes: ce0043b9a302 ("mmc: dw_mmc: add central watchdog and convert CTO onto it")
> Signed-off-by: BeaCox <0xbeac@gmail.com>
> ---
> 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);
prev parent reply other threads:[~2026-11-02 2:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-01 6:37 [RFC PATCH] mmc: dw_mmc: disable bh_work and stop timers " BeaCox
2026-11-01 10:43 ` Shawn Lin
2026-11-02 2:26 ` BeaCox
2026-11-02 2:32 ` Shawn Lin
2026-11-02 2:29 ` [RFC PATCH v2 0/2] mmc: dw_mmc: fix teardown races " BeaCox
2026-11-02 2:29 ` [RFC PATCH v2 1/2] mmc: dw_mmc: drain bh_work on host removal BeaCox
2026-11-02 2:34 ` Shawn Lin
2026-11-02 2:29 ` [RFC PATCH v2 2/2] mmc: dw_mmc: cancel the watchdog timer on remove BeaCox
2026-11-02 2:33 ` Shawn Lin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=f4313b18-4ce2-4a1c-ab03-512da50191f5@rock-chips.com \
--to=shawn.lin@rock-chips.com \
--cc=0xbeac@gmail.com \
--cc=jh80.chung@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulfh@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®