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=1796379468; b=khOY+mDpaWCM/IthzAe9vSCmxYnw/8+A6XHp0AGL5IE6Zx+HkOae0nXDiWF0/XS+ttyy nSunlppiWHqEuUe2Bd/Nw3F+Vm6ZMxlD3dbljaXXBFo6OCQ5QY82eviyLmCoqrtiPXx0D 87jciRey9cWv8RYhMaunOND3OE/Ev/1quvlSijUZRMvTpch17BE8ZY1FmbrSKji+zvrni TjAUSk/jZkbeB6aYlE9KPRJ4GLpTXxz0vcqBzA9epIQ47lFFV1kXPQq0EyolBwrPul/OV KPF/r7Jw4vOaTU9hdh3xbYSl/yGxW9+xiYOGdmSIusN7rmW+UfUDHY2pvWcDbhutX+g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379468; 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=kPNMvfoc0c3lREwE7BBbUym9Epz5Ti0g4o9TK1xvy4s=; b=tNzUaXnVhm9qnck8OZONPIphQR6qrzJwHT1r5eATLKoxW5jQ/s2MyQD02RXggUsoJ4gn 2u9GhJa7v8Cg/YPYe+7gwVjjOceLthLJ3ehGjQNfQlF5Mbtet2XkKxot78CKUbfJQjj4v NUOYuehsVFBv0wOQzI/cUYNjVByJGHgTmFkQXzk5HNXkP8KoCz6oQupZoRKR0EyWjSeMv FpC+ZcfSlBZK3S1ctFdQGTPhxKu4WPJigMNDJhovOj5yPRIaUQGRfgmSVICoI3cRbWShM wQ3BOoLFHPWbGzG+bKBR2NZuwNFLOeW3WFfpvNSfHOJEyqu2tCACUl/EjDa9DjPyvrg== 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=gGnYDC6v; 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 A0BBA606A322; Fri, 4 Dec 2026 10:17:48 +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=gGnYDC6v Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1792F1F000C2; Fri, 4 Dec 2026 10:17:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796379468; bh=kPNMvfoc0c3lREwE7BBbUym9Epz5Ti0g4o9TK1xvy4s=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=gGnYDC6vP2HArtIR2tz+9x1XjxoUW+w8sq2LZW2npnU8VV5AgUdwKoqw5wUAuewEl BZDzJaXUyZrK3bbwl4KYuJC7KpZavHB5wQDHvGRQrxpcsALowUbTZeXzpNUt2ujpKp 2uVfU6JEc8m37cGVoeKl8Cb+lQU4wgCU8vN6N2hU= 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.12 022/555] mmc: omap: synchronize clock timer before disabling fclk Date: Fri, 4 Dec 2026 19:01:05 +0900 Message-ID: <20261204100605.218382275@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100603.988357525@linuxfoundation.org> References: <20261204100603.988357525@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-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: Replaced del_timer(&host->clk_timer) with del_timer_sync(...) in two places, since this tree predates the timer_delete* rename. ] 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 ee0940d96febf..973e6ab1401cf 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -214,7 +214,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); @@ -273,7 +273,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