Re: [PATCH] usb: typec: tipd: mask interrupt across suspend to fix IRQ storm

From: Heikki Krogerus

Date: Fri Dec 04 2026 - 07:30:37 EST


On Tue, Dec 01, 2026 at 04:46:50PM +0800, jianfeng.gao@xxxxxxxxx wrote:
> From: JianFeng Gao <jianfeng.gao@xxxxxxxxx>
>
> When tps->wakeup is false, tps6598x_suspend() left the IRQ enabled because
> disable_irq() was gated inside the "if (tps->wakeup)" branch.
>
> During hibernation the parent I2C (designware) adapter suspends right
> after the child's freeze callback, so with the IRQ still enabled and the
> type-C line still asserted, tps6598x_interrupt() keeps re-firing. Its
> register reads now fail with -ESHUTDOWN, the handler bails with
> event1/event2 == 0 and returns IRQ_NONE, so the line is never acked and
> the handler loops, flooding the log with "failed to read ..." errors
> until the noirq phase finally masks interrupts.
>
> Mask the interrupt unconditionally in suspend and re-enable it in resume,
> keeping enable_irq()/disable_irq() balanced. The wake-source arming stays
> conditional on tps->wakeup.
>
> Fixes: 481735d64794 ("usb: typec: tipd: Support wakeup")
> Cc: stable@xxxxxxxxxxxxxxx
> Co-developed-by: Li Yifan <yifan2.li@xxxxxxxxx>
> Signed-off-by: Li Yifan <yifan2.li@xxxxxxxxx>
> Signed-off-by: JianFeng Gao <jianfeng.gao@xxxxxxxxx>
> Tested-by: Munirah Izyani Mohammad Amin <munirah.izyani.mohammad.amin@xxxxxxxxx>
> Acked-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
> ---

Where is the changelog? This should be v6 or v7.

Thanks,

> drivers/usb/typec/tipd/core.c | 18 ++++++++++++++----
> 1 file changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/usb/typec/tipd/core.c b/drivers/usb/typec/tipd/core.c
> index 02539378ffed..aba000a36a06 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 = to_i2c_client(dev);
> struct tps6598x *tps = i2c_get_clientdata(client);
>
> - 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);
> +
> + if (tps->wakeup)
> enable_irq_wake(client->irq);
> - } else if (tps->reset) {
> + else if (tps->reset)
> gpiod_set_value_cansleep(tps->reset, 1);
> - }
>
> if (!client->irq)
> cancel_delayed_work_sync(&tps->wq_poll);
> @@ -2004,12 +2011,15 @@ static int __maybe_unused tps6598x_resume(struct device *dev)
>
> 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);
> }
>
> + /* Balance the unconditional disable_irq() in tps6598x_suspend() */
> + if (client->irq)
> + enable_irq(client->irq);
> +
> if (!client->irq)
> queue_delayed_work(system_power_efficient_wq, &tps->wq_poll,
> msecs_to_jiffies(POLL_INTERVAL));
> --
> 2.34.1

--
heikki