]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
mailbox: pcc: Clear any pending responder interrupts before enabling it
authorSudeep Holla <sudeep.holla@arm.com>
Thu, 16 Oct 2025 19:08:20 +0000 (20:08 +0100)
committerJassi Brar <jassisinghbrar@gmail.com>
Sun, 18 Jan 2026 20:19:21 +0000 (14:19 -0600)
Some platforms may leave a responder interrupt pending from earlier
transactions. If a PCC responder channel has a pending interrupt when
the controller starts up, enabling the IRQ line without first clearing
the condition can lead to a spurious interrupt which could disrupt other
transmissions if the IRQ is shared.

Explicitly clear any pending responder interrupt before enabling the IRQ
to ensure a clean start. Acknowledge the responder channel via
pcc_chan_acknowledge() in startup before requesting/enablement of the
IRQ. This ensures a clean baseline for the first transfer/receiption
of the notification/response.

Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Tested-by: Adam Young <admiyo@os.amperecomputing.com>
Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
drivers/mailbox/pcc.c

index d8739eca5ac0615815112bd42d50d2c1be27415b..967eb249f40d9fae3c40ce6a160f81e9bbdbce3f 100644 (file)
@@ -467,6 +467,12 @@ static int pcc_startup(struct mbox_chan *chan)
        unsigned long irqflags;
        int rc;
 
+       /*
+        * Clear and acknowledge any pending interrupts on responder channel
+        * before enabling the interrupt
+        */
+       pcc_chan_acknowledge(pchan);
+
        if (pchan->plat_irq > 0) {
                irqflags = pcc_chan_plat_irq_can_be_shared(pchan) ?
                                                IRQF_SHARED | IRQF_ONESHOT : 0;