From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796388657; b=ajkd7IKKax5vLTE5m4XV0SYWEvM22nDS08mufxkTC3dWiBRsgz3k6J9yC7vx6SnEhZl6 FfSYcWqGemVgQEYaP8hEObcwlxx7viShLYnzcCfr1Q0ZGuZnDj03zeDWL/aytwg4DWbMI agTbzJ0imc/4WoIrcCXs/yu4RMwTL+l+Zskoa6XTsWCdWiZ7/0wvH+k+N2sMI3OYdK8f6 O74VZ0psIMrzj7FkTibmQ6b0RA04SXYjNhSNzru8X44vPFpeYpPwrwrPhqfHH3d9ebcqG mUUlyCh0Om70SOclTjocRkDpsD4ww+H+y+Kyo/9JxL25JpLCc501CVwngMCRfQ1h4gQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796388657; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=pBhwTytoiNuavB248FaqOQQqWoEuomlAjCspi3aKAYM=; b=zn8YpGHVX/UqePysHeOa/5AdJgqIKrvFyXBVJTTqPIdFz5gFYeuSppRJdOPX1Pf8W8mp BRLhgCTq4E6UIXFHN+sYu9JnqeuGUGqJpY+Cf1Od7op3Wxzp0GeUvoDLqp+fB4k7YRkNZ QPSaeaH7alKtzIuTsJqgvddZiPIFB5/AtvACtVe2qNwgAk6TheKmUhY7vIBDdnKHCMWRX xxzDlBYg3neODQ4z5ibS3djnG2/TKtO1RhQuBk95bETgtIbyy9Tdv/cJeAzCdOE4fm2KF rGRdRi0EBPgWTZ3oJxe0s/Sc1x/PW+fi+l/IJXiOYOSmPyGu9/8R2BWtu9YuUPfS7mg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="Bs/clfEz"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A0AB606A32C; Fri, 4 Dec 2026 12:50:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=Bs/clfEz Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C9A51F000C2; Fri, 4 Dec 2026 12:50:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796388657; bh=pBhwTytoiNuavB248FaqOQQqWoEuomlAjCspi3aKAYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=Bs/clfEzcj6pqPJpyJAR5Y0IGav8mvVIoro9Hs3qxgAtWSqrNLzkPOYI5smTjdiTr WbEtxpA6V/4XxGe2qHd5EB709zjahlA25+GpY2VZJHemgKIbQUwoB8Pl66tTMSatHz Wcc+iFCRfmy+FV1mR+ywf96hEG3bhaqJtwsRj+go= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Runyu Xiao , Ulf Hansson , Sasha Levin Subject: [PATCH 6.1 0702/1059] mmc: omap: synchronize clock timer before disabling fclk Date: Fri, 4 Dec 2026 19:03:53 +0900 Message-ID: <20261204100702.160762984@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Runyu Xiao [ 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 Signed-off-by: Ulf Hansson [ sashal: changed timer_delete()/timer_delete_sync() calls to the older del_timer()/del_timer_sync() API in mmc_omap_select_slot() and mmc_omap_release_slot() ] Signed-off-by: Sasha Levin --- 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 cc2213ea324f1..6386d6a8cb87d 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