Skip to content

Commit 04778ff

Browse files
mjchen0jhedberg
authored andcommitted
drivers: mbox: imx_mu: ignore TriggerInterrupt failures
The ipc backends, like icmsg.c, don't expect errors when using mailbox send for notifications. In some places, icmsg.c ignores the return value of the mailbox send, in some places it propagates the error up, and in some places it asserts. icmsg only uses the mailbox send with NULL msg as a means to interrupt the other processor, and all data is passed via shared memory. So it is safe to ignore the case when the interrupt is already pending, since the other processor should handle the pending message when it gets around the handling the interrupt. As long as the order of clearing the interrupt is before the handling of the data, there should be no case where not pending a new interrupt when one is already pending would result in missing any new message. Signed-off-by: Mike J. Chen <[email protected]>
1 parent b365311 commit 04778ff

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

drivers/mbox/mbox_nxp_imx_mu.c

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,18 @@ static int nxp_imx_mu_send(const struct device *dev, uint32_t channel, const str
6363
if (msg == NULL) {
6464
if (MU_TriggerInterrupts(cfg->base, g_gen_int_trig_mask[channel]) !=
6565
kStatus_Success) {
66-
/* interrupt already pending, cannot trigger again */
67-
return -EAGAIN;
66+
/* Ignore any error returned by MU_TriggerInterrupts().
67+
* It can return failure if the interrupt is already pending, but
68+
* don't return that as an error otherwise the ipc service
69+
* using it might assert or fail. Since ipc uses mailbox
70+
* interrupts only as notifications, and the data transfer
71+
* is via shared memory, as long as the interrupt is pending,
72+
* the other processor should read all the data when it
73+
* handles the interrupt. As long as the interrupt is cleared
74+
* before data is processed, which it is. Just LOG_DBG the
75+
* occurrence.
76+
*/
77+
LOG_DBG("Interrupt already pending on channel %u", channel);
6878
}
6979
return 0;
7080
}

0 commit comments

Comments
 (0)