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=1796385891; b=Lq/Sw+Tf9cfAUe7RaxBtAbNn1ywaLKzEY6OjUozqPZx5Zqx9awooOJi+S52TjfRUEx8b 0mwYqqQzOJ5I1bKYJ+ktuBoiSLOemUW8nco+yxL3THOE/b9dKQOe784Ygpf6rH8nMyenQ ONJjnPcTTMmuHp1/buYHMdRUFC3a1EpAa7NjSSdb09twV8MJX0hhh/iEA4VAk/je4Ug9z WXArJ+wKxCGsK/OsSgaUOQJqJQg6mP9hE/YDouM5olBI9bq6HMhXnqH1a9KmyzWnRn4VR zWgswaFS6kbrZWx9bkES8cTtW5SPwMGsExe+93qM8cVZfUdM8QzH6f1J0xlrei/R7eQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796385891; 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=1h6PGx9As3R86IJIRG08qWVAyRp49idoN97Go+G3ns4=; b=YyIZxwXJf1jOqRLKPGJI5zv6DSvL0vwWAFdyCCQG6kPm/GD7jKguIqyCjuGDFiLMfP6h ppldoyhGhMzKHuCJZWOOMznxRw44nHgrLzDGfDED0SufGF4Cw2mz6lx0E2DL3Jxeq5abt wC0EwD1tYboK2LU46Tp1rKdiOHKQ4BGwskWIAubUXpQVMmCo/6A9KWKqi7lMrwyXKo84J sH3xCAjrUMzbKu/96vpad9uF8Ciyqk8+xuWWW6CFGsxUi7tm2GrPRzwRuSz7oUhIwqI2G mFae7vjE+2xNXlrUap6LN8U113h0BhEEpysxGkbIQLXB2F/h6UqwHQXF2oRS3/2D1LQ== 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=IsL46ti9; 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 BB53B606A32D; Fri, 4 Dec 2026 12:04:51 +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=IsL46ti9 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F2B931F00931; Fri, 4 Dec 2026 12:04:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796385891; bh=1h6PGx9As3R86IJIRG08qWVAyRp49idoN97Go+G3ns4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=IsL46ti9leIWzeMLRhCaGRipxlKaZwfuCzLVyMNKf7pn1WM8keV+V3YE8GMxhpjoU NG0Q6S9J77P7mSvh14J5n9Jnk8nQxB4GVPWGuTyiU2FDG7ATII0beyGe7NPUJ8ZwG5 fE5kNWWA2cX0t4br7x8pnEcOMZPXZDj8MykAibvo= 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.6 0736/1167] mmc: omap: synchronize clock timer before disabling fclk Date: Fri, 4 Dec 2026 19:02:43 +0900 Message-ID: <20261204100721.241544128@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100702.047403948@linuxfoundation.org> References: <20261204100702.047403948@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.6-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: Adapted to the older timer API, using del_timer()/del_timer_sync() in place of timer_delete()/timer_delete_sync(). ] 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 0293a4dbe7e01..afe94b1e3266e 100644 --- a/drivers/mmc/host/omap.c +++ b/drivers/mmc/host/omap.c @@ -215,7 +215,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); @@ -274,7 +274,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