-
Notifications
You must be signed in to change notification settings - Fork 8.2k
drivers: Disallow FD frames when not in FD Mode for mcan #50769
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
Conversation
|
Yeah. We need to fix this in pretty much every driver. |
Currently, if you send an FD frame with the mcan driver, but FD mode was not enabled, the hardware will only send the first 8 bytes of the frame, but still with a DLC of FD length. This results in some very weird behavior on the bus, dependning on what other devices are doing. Add a check to ensure an FD send only occurs with FD enabled. Signed-off-by: Thad House <[email protected]>
5b89435 to
5111118
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Tanks for the fix!
|
@ThadHouse Can I ask you to open a bug report for this one as well? Thanks. |
Done. #50776 |
|
@henrikbrixandersen, is this needed for 3.2 release? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to look further into this as it breaks some of our non CAN-FD test cases/applications (the ones that neglect to set .fd = 0; .brs = 0 since they pre-date CAN-FD support in Zephyr.
Alternate proposal in #51361. |
|
@ThadHouse Thank you for submitting this. However, an alternate solution to this issue was merged in #51361, so I am closing this one. |
Currently, if you send an FD frame with the mcan driver, but FD mode was not enabled, the hardware will only send the first 8 bytes of the frame, but still with a DLC of FD length. This results in some very weird behavior on the bus, dependning on what other devices are doing. Add a check to ensure an FD send only occurs with FD enabled.
Fixes: #50776
Signed-off-by: Thad House [email protected]