-
Notifications
You must be signed in to change notification settings - Fork 26
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
mcp25xxfd: invalid IVMIF condition makes the driver stop #8
Comments
@jlanger : You check it a second time? Because in line 399 there is already this check and you check now again by doubling lines 399/400. |
@petmos No the first check is checking for the flag being set, and the new check checks for the interrupt enable bit. |
@DanielOgorchock : Oops, I didn't recognized the different last letter. Sorry. |
The problem is in the last few lines of mcp25xxfd_can_int_handle_ivmif(). The invalid message interrupt flag (IVMIF) needs to be cleared but the interrupt enable bit (IVMIE) is being used instead. The problem:
Changing the last few lines to this made the problem go away:
|
…g register set fixed Added check if IMVIF interrupts are enabled in mcp25xxfd_can_int_handle_ivmif() in order to avoid unhandled IMVIF conditions. Also the root cause, the reset of the IVMIE instead of IVMIF at the end of the same function is corrected, so that the previously mentioned fix only hardens the ISR. This solution was proposed in Github issue msperl#8
I'm constantly getting a situation where the driver stops processing interrupts because it detected an invalid IVMIF situation.
i.e this dmesg message:
found IVMIF situation not supported by driver - bdiag = [0x%08x, 0x%08x]
Looking at the registeres I can see that the IMVIF interrupt flag is set even though IMVIE flag is not set and thus the Invalid Message Interrupt is not enabled at all.
Also no error flags are set in BDIAG so mcp25xxfd_can_int_handle_ivmif returns an error, making the whole driver stop processing interrupts.
As a workaround I added a check at the beginning of mcp25xxfd_can_int_handle_ivmif to make sure that IMVIE is enabled before proceeding.
See the attached diff
This resolves the issue for me however I'm still not sure why I see IVMIF interrupts even though IMVIE is disabled.
Any ideas?
ivmif.txt
The text was updated successfully, but these errors were encountered: