[PATCH v3] can: grcan: Add device driver for GRCAN and GRHCAN cores
Andreas Larsson
andreas at gaisler.com
Wed Nov 7 23:55:26 EST 2012
On 11/07/2012 12:15 PM, Wolfgang Grandegger wrote:
> On 11/07/2012 08:32 AM, Andreas Larsson wrote:
>> On 11/05/2012 10:28 AM, Wolfgang Grandegger wrote:
> ...
>>> This looks good now. Just the automatic restart is missing as described
>>> above.
>>
>> When doing the bus_off handling as in at91_can, on a short-circuited bus
>> with restart-ms != 0, the result of a cansend is an endless and frequent
>> stream of
>>
>> can0 20000004 [8] 00 20 00 00 00 00 88 00 ERRORFRAME
>> controller-problem{tx-error-passive}
>> error-counter-tx-rx{{136}{0}}
>> can0 20000040 [8] 00 00 00 00 00 00 80 00 ERRORFRAME
>> bus-off
>> error-counter-tx-rx{{128}{0}}
>> can0 20000104 [8] 00 00 00 00 00 00 10 00 ERRORFRAME
>> controller-problem{}
>> restarted-after-bus-off
>> error-counter-tx-rx{{16}{0}}
>> can0 20000004 [8] 00 10 00 00 00 00 57 80 ERRORFRAME
>> controller-problem{rx-error-passive}
>> error-counter-tx-rx{{87}{128}}
>> can0 20000040 [8] 00 00 00 00 00 00 80 00 ERRORFRAME
>> bus-off
>> error-counter-tx-rx{{128}{0}}
>> can0 20000104 [8] 00 00 00 00 00 00 08 00 ERRORFRAME
>> controller-problem{}
>> restarted-after-bus-off
>> error-counter-tx-rx{{8}{0}}
>> can0 20000004 [8] 00 10 00 00 00 00 57 80 ERRORFRAME
>> controller-problem{rx-error-passive}
>> error-counter-tx-rx{{87}{128}}
>> can0 20000040 [8] 00 00 00 00 00 00 80 00 ERRORFRAME
>> bus-off
>> error-counter-tx-rx{{128}{0}}
>> can0 20000104 [8] 00 00 00 00 00 00 08 00 ERRORFRAME
>> controller-problem{}
>> restarted-after-bus-off
>> error-counter-tx-rx{{8}{0}}
>> [...]
>>
>> as the grcan core continues to try to resend the frame when it comes
>> back again. To mimic the sja1000 behavior as closely as possible, I
>> guess that the driver also would need to make sure that the tx and rx
>> buffers are cleaned out so that this resending does not happen, right?
>
> No, what you see is the normal behavior for automatic restart by the
> hardware. A bus-off recovery is *not* the same than a controller restart.
OK, if these automatic restarts are an OK behavior when restart_ms is non-zero I
am happy with taking the at91_can approach to things.
Cheers,
Andreas
More information about the devicetree-discuss
mailing list