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=1796387889; b=t2ZAegT30si4yEikpt3sdPyjvpLPeAIAp0NCP2wehTvJ7STbkCECNJsSPwKiMGwaeesK cMd0E5j/3DjAHsu2gTQIU4fta4CK21Ux9lpgdNHlLDNjrqTPRXs8Cxcfm0qLvQcJlEu0G HNPaVaPHLt6dhsLncfHi2FkEYkMo6/qXOyRCFEFc1BjQ3fQ4hdQdP7g6ys72E13QtqzxJ 6J/XfLr+pdQ9hOd6ngH6vfFiWDzXimd6T1wwjpgXk2UAEVtc+KKeQQpY/CvxXwovczZfX JCyWeFr/e0Q/dM6qV8x/Y0/QjXxRy12u2cqrZMrHFCgK29V5QeCAebZRZXh5VwM1hKw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796387889; 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=+1Nim4YpMIbZoB2H962Dq5TRUtmKb+E3AKSORf3QgpE=; b=etgVIn6Uq0af6zzJkTE4FeRkdwwJMHi98IoZBbQb+AOuAD9i+1FlXzgwsgSUMln/o608 IRKqMmTIIl9HKOU4May2X4QT5LAav9Ux2F7DzkDk+BPOgRaMd70CXNg9D20R6C/D+XE3F RlswKOSOZAoq0Ij2QpNC7Un1HPL2/VyDY81Too4i/WLJV5acvOekGu1+bUQ2cEF+tMkKp TiMuVtap/P5Tt/ujoP+5o0R0G59EKR2g8DHt5H8MnahF3wddnULxQX/x+KE7LM7DmHAb4 cVwY2WOK/7krfkbJ9hxe8abxEgwAvvTNz0TlQzRp6symYLvKC0byfv2Zu+BWPYLF6Hg== 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=v9wMjln7; 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 875B9606A322; Fri, 4 Dec 2026 12:38:09 +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=v9wMjln7 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9BD51F000C2; Fri, 4 Dec 2026 12:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796387889; bh=+1Nim4YpMIbZoB2H962Dq5TRUtmKb+E3AKSORf3QgpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=v9wMjln77mcHwCh4Zi+78Z1HpD32igEjfkC1Izo/OG84tNUMedP/oqvz+dH6Ag+mA 3CkpNkLhgKRVVuWnedge0kz/pSFc22xBjDVUFHfJ+jnJ+qDrE1bLOerT8XT4X5HHJC lhG3fB3+DTFS4lfIikOPlMCRYEks9EWz1BETLs9c= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ijae Kim , Myeonghun Pak , Mark Brown , Sasha Levin Subject: [PATCH 6.1 0399/1059] ASoC: rt5645: Shut down the button timer on removal Date: Fri, 4 Dec 2026 18:58:50 +0900 Message-ID: <20261204100654.666587464@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: 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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Myeonghun Pak [ Upstream commit f0ecc305442f20a6df2575943e9897825d80cc5d ] jack_detect_work can rearm btn_check_timer, and the timer callback can queue jack_detect_work. Deleting the timer before cancelling the work does not break this cycle: an already running worker can rearm the timer after timer_delete_sync() returns. The timer can then outlive removal. Use timer_shutdown_sync() before cancelling the delayed work so that subsequent attempts to rearm the timer are ignored. The IRQ producer has already been removed at this point. Keep the restartable timer deletion in the suspend path. This issue was identified as part of our ongoing research while reviewing kernel code. Fixes: 7ff6319e7da5 ("ASoC: rt5645: use polling to support HS button") Assisted-by: LLM Co-developed-by: Ijae Kim Signed-off-by: Ijae Kim Signed-off-by: Myeonghun Pak Link: https://patch.msgid.link/179203261324.2681924.5002100194676410503.rt5645-button-timer@gmail.com Signed-off-by: Mark Brown [ sashal: Changed the del_timer_sync() context and removed line to match the older name, since the timer_delete_sync() rename isn't present here. ] Signed-off-by: Sasha Levin --- sound/soc/codecs/rt5645.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c index 7d4ebef1edfd7..434c3d527c622 100644 --- a/sound/soc/codecs/rt5645.c +++ b/sound/soc/codecs/rt5645.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -4189,10 +4190,10 @@ static void rt5645_i2c_remove(struct i2c_client *i2c) free_irq(i2c->irq, rt5645); /* - * Since the rt5645_btn_check_callback() can queue jack_detect_work, - * the timer need to be delted first + * The timer and jack_detect_work can rearm each other. Shut down the + * timer before cancelling the work. */ - del_timer_sync(&rt5645->btn_check_timer); + timer_shutdown_sync(&rt5645->btn_check_timer); cancel_delayed_work_sync(&rt5645->jack_detect_work); cancel_delayed_work_sync(&rt5645->rcclock_work); -- 2.53.0