Hello,
I use tcan4x5x over m_can driver with CANFD tcan4450 chip. Sometimes
after continuous communication I get in dmesg
tcan4x5x spi4.0 can1: FIFO read returned -22 . After that nothing works.
I have followed this behavior up to can_fd_dlc2len and found the following:
1. in m_can.c, function m_can_read_fifo does
cf->len = can_fd_dlc2len((fifo_header.dlc >> 16) & 0x0F);
cf->len = 0
DIV_ROUND_UP(cf->len, 4)
2. m_can_fifo_read(cdev, fgi, M_CAN_FIFO_DATA, cf->data,
DIV_ROUND_UP(cf->len, 4)) returns error because val_count=0
3. Following further chain with val_count=0:
cdev->ops->read_fifo(cdev, addr_offset, val, val_count) ->
tcan4x5x_read_fifo -> regmap_bulk_read -> ret -EINVAL
I can try to look deeper at fifo_header. Perhaps someone has the
possible cause of this behavior.
Regards,
Michael