We are using an iMx6 (quad and dual on different boards) and we are seeing infrequent instances where the CAN module does not properly initialize at power on. This is under yocto linux using socketCAN. Most of the time things come up and work as expected. However sometimes the can0 interface cannot be activated. When I run canconfig can0, the state is STOPPED. I tell it to start but it stays in the STOPPED state. A restart command replies that we are not in the BUS-OFF state so it isn't required. I have also tried ifconfig down/up and that doesn't get it working. The only thing I have found that will recover it is to do a full reboot of the system.
It seems to happen more frequently when there is CAN traffic during system boot. I have a bench-top system where my CAN bus is normally idle and I never see the condition when that is the case. However, if I get CAN traffic running and then reboot, I may see it happen once or twice in a month. Similarly, when the target device is placed on a vehicle (where CAN is active when we boot), we see the same "stuck in STOP" behavior happen very infrequently. I am pretty sure something is going wrong at a low level because network manager usually issues the "Gained carrier" message for can0, but when this happens it does not. That and the fact that canconfig is showing STOPPED tells me that it isn't a problem in the application layer.
Any ideas on what is happening that causes the initialization at boot to fail and force the block into the STOPPED state? Or possibly how to "kick it in the pants" and get it going again without having to do a full reboot?