From 5934e1e04153bd60856da22f8da41e98b669cade Mon Sep 17 00:00:00 2001 From: Dj Date: Sun, 11 Oct 2026 01:12:11 -0400 Subject: [PATCH] usb: typec: tipd: Drain latched SPMI events after port registration SPMI event messages can arrive before the event IRQ is registered. Run the existing serialized handler once after successful initialization so the initial event state is reconciled with the registered port. Preserve the public polling, wake and suspend handling. Signed-off-by: Dj --- drivers/usb/typec/tipd/spmi.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/tipd/spmi.c b/drivers/usb/typec/tipd/spmi.c index 3ff9f602c23b6..2554daa515136 100644 --- a/drivers/usb/typec/tipd/spmi.c +++ b/drivers/usb/typec/tipd/spmi.c @@ -268,9 +268,16 @@ static int sn201202x_probe(struct spmi_device *device) return ret; ret = tipd_init(tps); - if (ret) + if (ret) { spmi_command_sleep(device); - return ret; + return ret; + } + + /* SPMI event messages can precede registration of the event IRQ. + * Reconcile the latched state after the port and its work are ready. + */ + tps->data->irq_handler(tps->irq, tps); + return 0; } static void sn201202x_remove(struct spmi_device *device)