I have the same problem you found with the Freescale 2.6.35 kernel's FlexCAN driver. In addition, I noticed that the driver does not always send all of the CAN packets. For example, if I try to send 100 CAN packets quickly, only the first 36 packets get sent (but in the wrong order). The remaining 64 CAN packets are apparently queued somewhere in the kernel. If I then send another 100 packets, the remaining 64 packets from the first try get sent along with 36 packets from the second try (again in the wrong order).
Can you tell me if using the 2.6.38 driver would fix both problems?
When you ported the FlexCAN driver from 2.6.38 into 2.6.35, which files did you have to change? If you could attach the changed files, I will try it with kernel 2.6.35 to see if it fixed both problems.
I agree with you that Freescale needs to fix this problem, either as a patch or as an SDK update.
Thanks.
James Attewell said:
I have managed to fix the problem with the CAN frame ordering. It is a bug in the FlexCAN driver.
There are 64 hardware CAN frame buffers and the driver is using 32 of them round-robin for transmitting. These buffers seems to have a priority associated with them (lower buffers have higher priority) so if a multi-frame message causes the buffers to wrap from 31 back to zero, the frames at the end of the multi-frame message get sent before some of the previous frames.
My solution was to port the new mainline FlexCAN driver by Pengutronix from the 2.6.38 kernel into my 2.6.35 tree. This has solved the problem and everything is working fine now.
How do I submit a bug report to Freescale as this problem is going to exist on all their platforms that use the FlexCAN driver and it really needs to be fixed?
Cheers
James