Subject: Re: [PATCH] can: add Renesas R-Car CAN driver

From: Wolfgang Grandegger <[email-masked]>
Date: Tue, 12 Nov 2013 23:17:43 +0100

Hi Sergei,

On 11/12/2013 10:45 PM, Sergei Shtylyov wrote:
> Hello.
> 
> On 11/09/2013 04:02 AM, Sergei Shtylyov wrote:
> 
>>>>> 2. ... with short-circuited CAN high and low and doing some time later
>>>>>          a manual recovery with "ip link set can0 type can restart"
> 
>>>>     Now we have auto recovery only. Manual recovery was tested with the
>>>> first driver version and worked.
> 
>>> What do you mean with "auto recovery"? Auto recovery by the hardware or
>>> via "restart-ms <ms>"? How do you choose between "manual" and "auto"
>>> recovery?
> 
>>     This exact test was done with hardware auto-recovery only. No
>> "restart-ms"
>> was programmed.
> 
>>>> Terminal 1:
> 
>>>> [email-masked]:/opt/can-utils# ./cangen -n 1 -g 1 can0
>>>> [email-masked]:/opt/can-utils# ./cangen -n 1 -g 1 can0
>>>> [email-masked]:/opt/can-utils# ./cangen -n 1 -g 1 can0
>>>> [email-masked]:/opt/can-utils#
> 
>>>> Terminal 2:
> 
>>>> [email-masked]:/opt/can-utils# ./candump -td -e any,0:0,#FFFFFFFF
>>>> (000.000000) can0 2000008C [8] 00 00 08 00 00 00 00 00 ERRORFRAME
>>>> controller-problem{}
>>>> protocol-violation{{tx-dominant-bit-error}{}}
>>>> bus-error
>>>> (000.021147) can0 20000144 [8] 00 00 00 00 00 00 00 00 ERRORFRAME
>>>> controller-problem{}
>>>> bus-off
>>>> restarted-after-bus-off
> 
>>> Why does it get "restarted" directly after the bus-off?
> 
>>     Because we have hardware auto-recovery enabled.
> 
>>>> (011.738522) can0 2000008C [8] 00 00 08 00 00 00 00 00 ERRORFRAME
>>>> controller-problem{}
> 
>>> What controller problem? data[1] is not set for some reasom.
> 
>>     Not comments. Looking into it.
> 
>    Sorry, this has been fixed a while ago. Now the log looks like:
> 
> [email-masked]:/opt/can-utils#  ./candump -td -e any,0:0,#FFFFFFFF
>  (000.000000)  can0  2000008C   [8]  00 28 08 00 00 00 88 00 ERRORFRAME
>         controller-problem{tx-error-warning,tx-error-passive}

Only the highest level should be reported.

>         protocol-violation{{tx-dominant-bit-error}{}}
>         bus-error
>         error-counter-tx-rx{{136}{0}}
>  (000.007578)  can0  20000040   [8]  00 00 00 00 00 00 00 00 ERRORFRAME
>         bus-off
>  (000.091847)  can0  20000100   [8]  00 00 00 00 00 00 00 00 ERRORFRAME
>         restarted-after-bus-off
>  (056.136722)  can0  2000008C   [8]  00 28 08 00 00 00 88 00 ERRORFRAME
>         controller-problem{tx-error-warning,tx-error-passive}

Ditto.

Wolfgang.