Skip to content

Commit c77661d

Browse files
affenull2345Jassi Brar
authored andcommitted
mailbox: sprd: clear delivery flag before handling TX done
If there are any pending messages in the mailbox queue, they are sent as soon as a TX done event arrives from the driver. This may trigger a new delivery interrupt while the previous one is still being handled. If the delivery status is cleared after this, the interrupt is lost. To prevent this from happening, clear the delivery status immediately after checking it and before any new messages are sent. Signed-off-by: Otto Pflüger <otto.pflueger@abscue.de> Signed-off-by: Jassi Brar <jassisinghbrar@gmail.com>
1 parent 0856aed commit c77661d

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

drivers/mailbox/sprd-mailbox.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ static irqreturn_t sprd_mbox_inbox_isr(int irq, void *data)
166166
return IRQ_NONE;
167167
}
168168

169+
/* Clear FIFO delivery and overflow status first */
170+
writel(fifo_sts &
171+
(SPRD_INBOX_FIFO_DELIVER_MASK | SPRD_INBOX_FIFO_OVERLOW_MASK),
172+
priv->inbox_base + SPRD_MBOX_FIFO_RST);
173+
169174
while (send_sts) {
170175
id = __ffs(send_sts);
171176
send_sts &= (send_sts - 1);
@@ -181,11 +186,6 @@ static irqreturn_t sprd_mbox_inbox_isr(int irq, void *data)
181186
mbox_chan_txdone(chan, 0);
182187
}
183188

184-
/* Clear FIFO delivery and overflow status */
185-
writel(fifo_sts &
186-
(SPRD_INBOX_FIFO_DELIVER_MASK | SPRD_INBOX_FIFO_OVERLOW_MASK),
187-
priv->inbox_base + SPRD_MBOX_FIFO_RST);
188-
189189
/* Clear irq status */
190190
writel(SPRD_MBOX_IRQ_CLR, priv->inbox_base + SPRD_MBOX_IRQ_STS);
191191

0 commit comments

Comments
 (0)