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

spi: spi-axi-spi-engine: setup the timer before IRQ enable #2410

Merged
merged 1 commit into from
Jan 26, 2024

Conversation

nunojsa
Copy link
Collaborator

@nunojsa nunojsa commented Jan 25, 2024

The watchdog timer was being activated after enabling the interrupts and that could actually lead for the message to be transferred before we get to call mod_timer() which would lead to a spurious soft interrupt. In extreme cases (like playing with overlays to load + unload devices) this could lead to a panic splat as the timer callback would be called with the spi engine device gone already.

Fixes: fde5597 ("spi: axi-spi-engine: Add watchdog timer")


Note this is also an issue in the main branch but not an issue in the upstream version of the spi-engine @dlech worked on. As I'm expecting the upstream version to be synced in the ADI tree + offload support, I'm not doing this fix in main.

@nunojsa nunojsa requested a review from a team January 25, 2024 09:34
The watchdog timer was being activated after enabling the interrupts and
that could actually lead for the message to be transferred before we get
to call mod_timer() which would lead to a spurious soft interrupt. In
extreme cases (like playing with overlays to load + unload devices)
this could lead to a panic splat as the timer callback would be called
with the spi engine device gone already.

Fixes: fde5597 ("spi: axi-spi-engine: Add watchdog timer")
Signed-off-by: Nuno Sa <[email protected]>
@nunojsa
Copy link
Collaborator Author

nunojsa commented Jan 25, 2024

This should also fix #2298

@nunojsa nunojsa merged commit a2949a1 into 2022_R2 Jan 26, 2024
12 checks passed
@nunojsa nunojsa deleted the staging/spi-engine-fix branch January 26, 2024 08:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants