Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drivers: spi: spi_mcux_dspi: bus busy status ignored in async #22584

Closed
aunsbjerg opened this issue Feb 7, 2020 · 1 comment
Closed

drivers: spi: spi_mcux_dspi: bus busy status ignored in async #22584

aunsbjerg opened this issue Feb 7, 2020 · 1 comment
Labels
bug The issue is a bug, or the PR is fixing a bug

Comments

@aunsbjerg
Copy link
Collaborator

Describe the bug
When doing async SPI reads, the status code from DSPI_MasterTransferNonBlocking is ignored. This means that the context is not unlocked in spi_context_release even though an error condition is present.

I've seen a wide range of behaviour that I believe is caused by this bug. Sometimes, an imprecise bus error is produced, sometimes the board will just reset and sometimes, the board gets unresponsive and requires a hard reset to return to function.

To Reproduce
I've seen this issue on a custom board where we use SPI to read ADC samples from a streaming ADC chip. The driver reads samples from the ADC chip with a 2KHz frequency. Occasionally, the driver will attempt to read a sample before the previous read was finished, resulting in a busy bus and this will occasionally cause the aforementioned crashes, stalls etc.

Expected behavior
I would expect that the spi driver is able to gracefully handle a busy bus without crashing the kernel.

Impact
This is a showstopper as the board does not always restart when the error happens, forcing a manual reset of the board.

Environment:

  • Ubuntu 18.04
  • SDK 0.10.3
  • Zephyr 1.14
  • Custom K64f
@aunsbjerg aunsbjerg added the bug The issue is a bug, or the PR is fixing a bug label Feb 7, 2020
@aunsbjerg
Copy link
Collaborator Author

A possible fix that works for me: #22582

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug The issue is a bug, or the PR is fixing a bug
Projects
None yet
Development

No branches or pull requests

1 participant