Skip to contentSkip to conversation

can: flexcan: problems with bus error reporting om i.MX53

DISCUSSION Matthias Klein 2 participants 3 messages Jul 25, 2014 – Jul 28, 2014 CAN network drivers

lore
Share & tools
lore
#0 lore raw

Hi all,

we had the following problems when we enabled bus error reporting on an i.MX537 (Ka-Ro TX53-8130):
- interrupt flooding when sending a packet on an open bus
- bus state change notifications did not work properly
- second bus state change after bus recovery was not properly notified

The patches in the next mails fix all these problems and are tested against mainline linux 3.12.24-rt38 with PREEMPT_RT patch.

Best regards,
Matthias Klein

#1 lore raw
Quoted 5 lines · * Matthias Klein | 2014-07-25 20:16:34 [+0200]:

Hi all,

we had the following problems when we enabled bus error reporting on an i.MX537 (Ka-Ro TX53-8130):
- interrupt flooding when sending a packet on an open bus

This happens because
#1 the ISR always returns that it handled the interrupt even if it did
nothing
#2 on error the interrupt source remains asserted on an open CAN bus as
long as the CAN bus is open. This was verified on iMX53 (which has FLEXCAN_HAS_BROKEN_ERR_STATE) and imx6q

Quoted 1 line

- bus state change notifications did not work properly

The error-passive -> error warning transition was not reported to userland, #3

Quoted 1 line

- second bus state change after bus recovery was not properly notified

The second transition from error-passive to error-warning does not work properly. By second is meant a transition while the error counter >0 (in test scenarion 120 < x < 128). After the BUS was closed, the CAN controller was able to send packages (they were received) but the internal state said passive mode and the error counter was >128 and decrementing with each can message sent.
New #4.

Quoted 2 lines

Best regards,
Matthias Klein

Sebastian

#2 lore raw
In reply to Matthias Klein

For the sake of completeness I have reworked the patch based on:

b1aa1c7 can: flexcan: fix transition from and to freeze mode
in chip_{,un}freeze

If I find some spare time will have a look into the "can: berr_limit support" series [1].

[1] http://comments.gmane.org/gmane.linux.can/4070

Best regards,
Matthias Klein

Am 25.07.2014 20:16, schrieb Matthias Klein:

Quoted 12 lines

Hi all,

we had the following problems when we enabled bus error reporting on an i.MX537 (Ka-Ro TX53-8130):
- interrupt flooding when sending a packet on an open bus
- bus state change notifications did not work properly
- second bus state change after bus recovery was not properly notified

The patches in the next mails fix all these problems and are tested against mainline linux 3.12.24-rt38 with PREEMPT_RT patch.

Best regards,
Matthias Klein