Skip to content

Commit 7a582c5

Browse files
Raymond0225kartben
authored andcommitted
drivers: nxp: flexio: mask invalid ISR calling
Flexio ISR handle all flags even they are not interrupt enabled. This will cause invalid calling of ISR callback functions. Signed-off-by: Raymond Lei <raymond.lei@nxp.com>
1 parent f7f73bd commit 7a582c5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/misc/mcux_flexio/mcux_flexio.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,10 @@ static void mcux_flexio_isr(const struct device *dev)
7777
uint32_t shifter_status_flag = FLEXIO_GetShifterStatusFlags(base);
7878
uint32_t shifter_error_flag = FLEXIO_GetShifterErrorFlags(base);
7979

80+
/* Not all shifter interrupt is enabled. Only handle those interrupt enabled. */
81+
shifter_status_flag &= base->SHIFTSIEN;
82+
shifter_error_flag &= base->SHIFTEIEN;
83+
8084
if (shifter_status_flag || shifter_error_flag) {
8185
for (uint32_t idx = 0; idx < map_shifter_child_count; idx++) {
8286
if (((shifter_status_flag | shifter_error_flag) & BIT(idx)) != 0) {
@@ -97,6 +101,9 @@ static void mcux_flexio_isr(const struct device *dev)
97101
uint32_t map_timer_child_count = data->map_timer_child_count;
98102
uint32_t timer_status_flag = FLEXIO_GetTimerStatusFlags(base);
99103

104+
/* Not all timer interrupt is enabled. Only handle those interrupt enabled. */
105+
timer_status_flag &= base->TIMIEN;
106+
100107
if (timer_status_flag) {
101108
for (uint32_t idx = 0; idx < map_timer_child_count; idx++) {
102109
if ((timer_status_flag & BIT(idx)) != 0) {

0 commit comments

Comments
 (0)