Skip to content

Commit 3c80b15

Browse files
mjchen0jhedberg
authored andcommitted
drivers: mbox: imx_mu: handle all interrupts for a channel
Handle all interrupts for a channel before going to next channel. Previous code did an if/else check, so if both a data rx interrupt and a notification interrupt were pending for a channel, only one would be handled in the ISR. The ISR would have to fire again (probably would be still pending) for the other interrupt to be processed. This could even lead to starvation/delay if another data rx interrupt got pended again. Signed-off-by: Mike J. Chen <[email protected]>
1 parent 593e2b5 commit 3c80b15

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/mbox/mbox_nxp_imx_mu.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,12 +195,14 @@ static void mu_isr(const struct device *dev)
195195
data->cb[i_channel](dev, i_channel, data->user_data[i_channel],
196196
&msg);
197197
}
198-
} else if ((flags & gen_int_mask) == gen_int_mask) {
198+
}
199+
if ((flags & gen_int_mask) == gen_int_mask) {
199200
MU_ClearStatusFlags(config->base, gen_int_mask);
200201
if (data->cb[i_channel]) {
201202
data->cb[i_channel](dev, i_channel, data->user_data[i_channel],
202203
NULL);
203204
}
204205
}
206+
205207
}
206208
}

0 commit comments

Comments
 (0)