Skip to content

Conversation

LaurentiuM1234
Copy link
Contributor

@LaurentiuM1234 LaurentiuM1234 commented Aug 19, 2024

TX/RX FIFO underrun shouldn't crash the RTOS when it occurs. Also, since this can also happen under "normal" conditions (i.e: DMA doesn't copy data fast enough from/to SAI's FIFOs) the software should be able to recover from it.

As such:
1) Remove z_irq_spurious() call.
2) Clear error flag
3) De-escalate error message to warning message

Fixes #77633

((dir) == DAI_DIR_RX ?\
SAI_RxClearStatusFlags(UINT_TO_I2S(regmap), which) :\
SAI_TxClearStatusFlags(UINT_TO_I2S(regmap), which))

/* used to retrieve the SYNC direction. Use this macro when you know for sure
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LaurentiuM1234 change looks good to me. Will approve once this warning is fixed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tweaked the formatting of the macro as the clang-format suggestion did improve the code readability IMO. Warning still persists because of the position of \. I don't think this new suggestion improves code readability so unless we're required to make new code clang-format-compliant I see no reason to go with it.

@LaurentiuM1234 LaurentiuM1234 force-pushed the fix/sai_underrun_overrun branch 2 times, most recently from cfe549b to f5b6f14 Compare August 26, 2024 10:05
TX/RX FIFO underrun shouldn't crash the RTOS when it occurs.
Also, since this can also happen under "normal" conditions
(i.e: DMA doesn't copy data fast enough from/to SAI's FIFOs)
the software should be able to recover from it.

As such:
	1) Remove `z_irq_spurious()` call.
	2) Clear error flag
	3) De-escalate error message to warning message

Signed-off-by: Laurentiu Mihalcea <[email protected]>
@dleach02 dleach02 added the backport v3.7-branch Request backport to the v3.7-branch label Aug 27, 2024
@LaurentiuM1234
Copy link
Contributor Author

created bug report (#77633) for backporting

@LaurentiuM1234 LaurentiuM1234 added the bug The issue is a bug, or the PR is fixing a bug label Aug 27, 2024
@nashif nashif merged commit e224a41 into zephyrproject-rtos:main Aug 27, 2024
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: DAI backport v3.7-branch Request backport to the v3.7-branch bug The issue is a bug, or the PR is fixing a bug platform: NXP Drivers NXP Semiconductors, drivers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

drivers: dai: nxp: sai: RTOS crashes on TX/RX underrun/overrun
6 participants