Skip to content
/ linux Public

Commit e2809ad

Browse files
affenull2345Sasha Levin
authored andcommitted
mailbox: sprd: clear delivery flag before handling TX done
[ Upstream commit c77661d ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 4c4679b commit e2809ad

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

drivers/mailbox/sprd-mailbox.c

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

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

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

0 commit comments

Comments
 (0)