On Colibri iMX8X we’re using one CAN bus from M4 which is working without an issue. We’re also planning to use another CAN bus from Linux. Problem occurs when the Linux one fails configuration (e.g. invalid /etc/network/interfaces file), crashes or is just turned off (through ip link set dev can0 down), it hard faults the M4.
It looks like Linux CAN driver when turning off the periphery also turns off the LPCG for this CAN. But this also turns off the clock for the M4 CAN, because even though by the addresses there are distinct LPCGs for each CAN, physically there is only one according to the reference manual.
Are there plans to fix it or modify the behavior or is there a recommended workaround?
As for device tree, one CAN is in DTB, the other one is not (to be accessed only from M4). The issue is really that drivers approach it, like the CAN busses have independent clock control (they have even separate addresses), but under the hood, there is only one.
The workaround we’ve come up is to disable the turning off the LPCG in the kernel driver, when the interface is disabled. But it doesn’t feel the most proper. Do you other solution or are you planning something from your side?