Skip to content

Conversation

@bjarki-andreasen
Copy link
Contributor

CAN: MCAN: Implement CAN_MODE_ONE_SHOT [fromlist]

Add support for device runtime power management.
Suspending the device will place it into sleep mode, its lowest
power state.
All config will be lost when suspending the device.
Do not allow suspending the device if it is started or has
RX filters registered.
The application has to reconfigure the CAN device to resume
expected operation.

Signed-off-by: Ryan Erickson <[email protected]>
(cherry picked from commit 631dbd9)
Implement CAN_MODE_ONE_SHOT (DAR mode) for can_mcan. To acheive
this, can_mcan has been refactored to use the TX cancel feature to
cancel ongoing TX when stopping, as TX can now be cancelled for
other reasons than CAN stopping.

The CAN_MODE_ONE_SHOT feature depends on CONFIG_CAN_STATS as we need
to monitor PEA and PED events, as these are produced if a TX fails.
The TCF event only works if a TX is cancelled explicitly using TXBCR
due to a bug in the MCAN IP, so it can not be used to detect failed
and thus cancelled TX in CAN_MODE_ONE_SHOT.

Upstream PR #: 99055

Signed-off-by: Bjarki Arge Andreasen <[email protected]>
@bjarki-andreasen
Copy link
Contributor Author

Found potential bug with this approach, working on it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants