CAN bus stops working, spi issue

Hi,

my Linux kernel prints the following messages for the mcp25xxfd driver:

[ 8454.869252] spi_imx 30840000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 2000000, post: 1, pre: 12
[ 8454.876726] mcp25xxfd spi2.0 can0: tefif: fifo 1 not pending - tef data: id: 0000060a flags: 00000208, ts: df8b2d76 - this may be a problem with spi signal quality- try reducing spi-clock speed if this can get reproduced
[ 8454.877161] systemd-journald[246]: /dev/kmsg buffer overrun, some messages lost.
[ 8454.896842] spi_imx 30840000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 2000000, post: 1, pre: 12
[ 8454.904278] spi_imx 30840000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 2000000, post: 1, pre: 12
[ 8454.904313] mcp25xxfd spi2.0 can0: tefif: fifo 3 not pending - tef data: id: 0000060a flags: 00000608, ts: df8bebb4 - this may be a problem with spi signal quality- try reducing spi-clock speed if this can get reproduced
[ 8454.904830] systemd-journald[246]: /dev/kmsg buffer overrun, some messages lost.
[ 8454.924426] spi_imx 30840000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 2000000, post: 1, pre: 12

After these messages the interface stops working. I have already tried reducing the spi clock from 2MHz to 1MHz wihtin the device tree, without success. The bus is running at a speed of 250kb.
Prior to this issue I had to manually resize the tx queue size before I open the interface since it randomly resets its value to 0.

Can anybody help me?

Does anybody also know, why the kernel is constantly printing the following messages:

[ 9026.807647] spi_imx 30840000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 2000000, post: 1, pre: 12
[ 9026.808010] spi_imx 30840000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 2000000, post: 1, pre: 12
....
[ 9029.807120] spi_imx 30840000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 2000000, post: 1, pre: 12
[ 9029.807297] spi_imx 30840000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 2000000, post: 1, pre: 12
[ 9029.807738] spi_imx 30840000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 2000000, post: 1, pre: 12
[ 9029.807813] spi_imx 30840000.spi: mx51_ecspi_clkdiv: fin: 50000000, fspi: 2000000, post: 1, pre: 12

Hi @gandi,

We already have a pretty good thread on this here:

https://www.toradex.com/community/questions/60859/mcp2517fdmcp2518fd-can-controller-driver-errors-on.html?childToView=61191#answer-61191

Maybe that will help.

Ed

Hi @edwaugh

thank you for this really fast response :slight_smile:
I have applied the two patches mentioned in this thread and it looks good.

Hi @gandi

Thanks for the update. I will also do some tests on the SPI Can Controller and share my results.

Best regards,
Jaski

Hi
I have the same problem, but can’t access the mentioned thread.

Oops! That page doesn’t exist or is private.

Hi @codeshredder726b !

You can access that thread though this link: MCP2517FD/MCP2518FD CAN controller driver errors on IMX8MM Verdin

Please be aware that the thread is around 2 years old.

Best regards,