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=1796115659; b=OABRADcLfUKyBakd62zIoeKwOSnfNOr3KJIwAbL4oR6yyx/Lvk5nXuKw5vXgjvfpT4Eb 0tKR5f++r6oX2+REmqrgXjGWs4VC1OU/mZssR/lk5phaJkYe3jaaSwSdwByN+x9kcCA2n TQbu8N3VbpT1ktZmHoCmSoZb9Kc0K7HzXcOc+vJNZG1XRjcVSNd7HpB3hkGDCHFwQQL7U MHu3cNWRzr1aS6cdodUboihqbUTS5fboIs0XAJA6Q7NYdhbS61cvX18cUZYF7j6H/SAgc jqAKd+spt9mBIIaV0SzxTles6ffICug8kr1CV59y9KUCow1+/FDWo5Mg/16pIOB4kLA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796115659; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=jK3aHy88h7+WPJupcGdNEF8CFB+cfFvHxBEc3kivttc=; b=yoSP6U3dM7XbGVqVliexN14nkZiNF+2LA9GAaXzL/iwGuPSiZP4E+JJZKGfbZB9aeHzU 7nY1WcUbyqjvrAog0dfLJRFUBnMiM4leAS5CR7S7uI0aQIrzEqwinIFUZcZ5cjOzFyu7j Hz2pFFLdrzeL1m34iyt9EZl+B++ZdH+SQuhhCjVjZQgogxc6I0FCHKcJfBjqfYQLGy3OF /HU1Ubo0JDdsDc1rvAxmYfjXZ/2O49TZUedYAFBHp+7fD4uAHr0xqr6Fv1HPgOYe1KX5B 8XYBFj7L7CLaXF8d8RatD9oYXxtnQjo43cyYVpe6F08YPHeW8/ANhZ6vJuoEzLTUIZg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="FZW/B9sx"; 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 1C56E606A325 for ; Tue, 1 Dec 2026 09:00:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=FZW/B9sx Received: by smtp.kernel.org (Postfix) with ESMTPSA id 487F21F000C1; Tue, 1 Dec 2026 09:00:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796115658; bh=jK3aHy88h7+WPJupcGdNEF8CFB+cfFvHxBEc3kivttc=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=FZW/B9sx2WyHOdO/YZwBQlSZhKeSUgD5q81dbL1KxXD/bzytGicmd5L2DApg7FOWm lP3bKESCOLYu/BUpkHae4vHCH9iIvIO+3XB1kBiPWyDK8PivVkabemKY7+iqqkrfFf S8Ch3KEYfr35FO9Z+/uOT1Jj6WvESUbdMZaJnfy61sX0Hm/x3HyngiUY/gRUcF2BCz 3qfz9hRPaVOVakzSaai7Sf4TjKA9icrFdBU2lnXKYMYWjm3Dro0nsPd0Y0QO1cNLte fFVn5/VxGUWZru5uS1n4SWrr1pa61+22n95uTejIytplQ5rKutXghlveGVuzDA/kzi Chh7OS2utGBPQ== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] usb: typec: tipd: mask interrupt across suspend to fix IRQ storm Reply-To: sashiko-reviews@lists.linux.dev To: jianfeng.gao@intel.com Cc: linux-usb@vger.kernel.org In-Reply-To: <20261201084650.3697134-1-jianfeng.gao@intel.com> References: <20261201084650.3697134-1-jianfeng.gao@intel.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 09:00:57 +0000 X-Mailing-List: linux-usb@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] usb: typec: tipd: unbalanced disable_irq() on error in tps6598x_resume() It also noticed 1 related pre-existing issue this patch does not introduce: - [High] usb: typec: tipd: shared IRQ line globally disabled in tps6598x_suspend() [1] -- commit bad1fa24a640cc758aca2387c46de94a7477d077 Author: JianFeng Gao usb: typec: tipd: mask interrupt across suspend to fix IRQ storm This commit disables client->irq unconditionally in tps6598x_suspend() and re-enables it in tps6598x_resume() to prevent an interrupt storm when the parent I2C controller suspends while tps->wakeup is false. > diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c > index 67471c363a687..28a4f60629dfa 100644 > --- a/drivers/usb/typec/tipd/core.c > +++ b/drivers/usb/typec/tipd/core.c > @@ -1973,12 +1973,19 @@ static int __maybe_unused tps6598x_suspend(struct= device *dev) > struct i2c_client *client =3D to_i2c_client(dev); > struct tps6598x *tps =3D i2c_get_clientdata(client); > =20 > - if (tps->wakeup) { > + /* > + * Mask the interrupt before the parent I2C controller is suspended: > + * otherwise a still-asserted level IRQ keeps re-entering the handler, > + * whose register reads then fail with -ESHUTDOWN, producing an > + * interrupt storm until the noirq phase globally disables interrupts. > + */ > + if (client->irq) > disable_irq(client->irq); [Severity: High] This problem wasn't introduced by this patch, but calling disable_irq(client->irq) here globally masks a shared interrupt line at the interrupt controller [1]. Because the driver requests client->irq with IRQF_SHARED, masking the line across suspend starves any other devices sharing the IRQ during their suspend sequence and prevents them from waking the system. > + > + if (tps->wakeup) > enable_irq_wake(client->irq); > - } else if (tps->reset) { > + else if (tps->reset) > gpiod_set_value_cansleep(tps->reset, 1); > - } > =20 > if (!client->irq) > cancel_delayed_work_sync(&tps->wq_poll); > @@ -2004,12 +2011,15 @@ static int __maybe_unused tps6598x_resume(struct = device *dev) > =20 > if (tps->wakeup) { > disable_irq_wake(client->irq); > - enable_irq(client->irq); > } else if (tps->reset) { > gpiod_set_value_cansleep(tps->reset, 0); > msleep(TPS_SETUP_MS); > } > =20 > + /* Balance the unconditional disable_irq() in tps6598x_suspend() */ > + if (client->irq) > + enable_irq(client->irq); [Severity: Medium] Can an early error return in tps6598x_resume() leave client->irq disabled? Before reaching enable_irq(client->irq), tps6598x_resume() returns early if tps6598x_check_mode() or tps->data->init() fails: drivers/usb/typec/tipd/core.c:tps6598x_resume() { ret =3D tps6598x_check_mode(tps); if (ret < 0) return ret; if (ret =3D=3D TPS_MODE_PTCH) { ret =3D tps->data->init(tps); if (ret) return ret; } ... } In particular, when tps->wakeup is false and tps->reset is present, tps6598x_suspend() now disables client->irq and asserts reset, and tps6598x_resume() runs tps6598x_check_mode() over I2C while the chip is still held in reset before de-asserting tps->reset. When that read (or any resume I2C transfer) fails, client->irq stays disabled so Type-C events are no longer serviced, and later suspend cycles call disable_irq() again and increase the disable depth. [1] https://sashiko.dev/#/bug/linux-c47210b1-54f4-4549-9e9f-d91fbab89bb8 --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201084650.3697= 134-1-jianfeng.gao@intel.com?part=3D1