From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Runyu Xiao <runyu.xiao@seu.edu.cn>, Ulf Hansson <ulfh@kernel.org>,
Sasha Levin <sashal@kernel.org>
Subject: [PATCH 5.15.y] mmc: omap: synchronize clock timer before disabling fclk
Date: Tue, 24 Nov 2026 13:17:29 -0500 [thread overview]
Message-ID: <20261124181654.2305018-1-sashal@kernel.org> (raw)
In-Reply-To: <2026112429-handgun-idealist-1f47@gregkh>
From: Runyu Xiao <runyu.xiao@seu.edu.cn>
[ Upstream commit c931c51681e33b24bc8d65c6df35b70e1827daa2 ]
mmc_omap_select_slot() removes clk_timer with timer_delete() before
switching slots and changing the functional clock state. timer_delete()
only removes a pending timer and does not wait for a callback that is
already running.
If mmc_omap_clk_timer() is already running, it can therefore call
mmc_omap_fclk_enable() while the request or slot-switch path changes the
same clock state. During host removal, the same window can overlap the
final clock shutdown.
Use timer_delete_sync() so the callback has completed before slot switching
or changing the functional clock state. Keep the timer restartable for
normal request handling.
Fixes: 0807a9b5739a ("MMC: OMAP: Lazy clock shutdown")
Cc: stable@vger.kernel.org
Signed-off-by: Runyu Xiao <runyu.xiao@seu.edu.cn>
Signed-off-by: Ulf Hansson <ulfh@kernel.org>
[ sashal: Replaced timer_delete()/timer_delete_sync() calls with the older del_timer()/del_timer_sync() API names. ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/mmc/host/omap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/mmc/host/omap.c b/drivers/mmc/host/omap.c
index ecf2a68d0e846..5871eb4afad65 100644
--- a/drivers/mmc/host/omap.c
+++ b/drivers/mmc/host/omap.c
@@ -210,7 +210,7 @@ static void mmc_omap_select_slot(struct mmc_omap_slot *slot, int claimed)
host->mmc = slot->mmc;
spin_unlock_irqrestore(&host->slot_lock, flags);
no_claim:
- del_timer(&host->clk_timer);
+ del_timer_sync(&host->clk_timer);
if (host->current_slot != slot || !claimed)
mmc_omap_fclk_offdelay(host->current_slot);
@@ -264,7 +264,7 @@ static void mmc_omap_release_slot(struct mmc_omap_slot *slot, int clk_enabled)
/* Keeps clock running for at least 8 cycles on valid freq */
mod_timer(&host->clk_timer, jiffies + HZ/10);
else {
- del_timer(&host->clk_timer);
+ del_timer_sync(&host->clk_timer);
mmc_omap_fclk_offdelay(slot);
mmc_omap_fclk_enable(host, 0);
}
--
2.53.0
prev parent reply other threads:[~2026-11-24 18:17 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 15:11 FAILED: patch "[PATCH] mmc: omap: synchronize clock timer before disabling fclk" failed to apply to 5.15-stable tree gregkh
2026-11-24 18:17 ` Sasha Levin [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=20261124181654.2305018-1-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=runyu.xiao@seu.edu.cn \
--cc=stable@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