Thread (5 messages) 5 messages, 2 authors, 2017-10-05

Re: MCP2517FD Bus-Off recovery

From: Wolfgang Grandegger <hidden>
Date: 2017-10-05 16:56:17

Am 05.10.2017 um 17:55 schrieb Marcel.Birthelmer@microchip.com:
Wolfgang wrote:
quoted
quoted
Have a look to the "at91_can" driver. If "restart_ms" is "0", the
automatic recovery will be used. If not, the controller will be stopped:
That's not correct. If "restart_ms" is "0" the controller will be stopped waiting
for manual restart. Otherwise automatic recovery will be used. The "grcan"
driver uses the same logic.
So it seems like the behavior between the two flows is substantially different - one completely disables the hardware (including the receive mechanism and presumably ACK'ing messages), while the other just temporarily suspends transmission of messages. Is this understanding correct?
Yes, but while the controller is in bus-off, it will not receive or send 
any messages. If we stop the controller brute-force, we must make sure 
that no messages go out or come in. So hardware-wise, the behaviour is 
the same. Well, a bus-off recovery by hardware is different.
quoted
quoted
http://elixir.free-electrons.com/linux/latest/source/drivers/net/can/a
t91_can.c#L962

In case of automatic recovery, the CAN controller usually signals back
to error passive -> warning -> active. When it's back to error
passive, netif_wake_queue etc. should be called:

http://elixir.free-electrons.com/linux/latest/source/drivers/net/can/a
t91_can.c#L922

Can automatic recovery be switched off?
No, there's no switch for this feature.
OK,

Wolfgang.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help