[PATCH] can: don't count arbitration lose as an error

Oliver Hartkopp socketcan at hartkopp.net
Wed Dec 2 11:22:56 EST 2020


Hello Jeroen,

On 02.12.20 16:37, Jeroen Hofstee wrote:
> On 12/2/20 3:35 PM, Oliver Hartkopp wrote:

>> Do we agree that in one-shot mode both the tx_errors and the 
>> arbitration_lost counters are increased in the arbitration-lost case?
>>
>> At least this would fit to the Kvaser USB behaviour.
> 
> 
> I have no opinion about that. I just kept existing behavior.

That's ok for me either.

>> And btw. I wondered if we should remove the check for 
>> CAN_CTRLMODE_ONE_SHOT here, as we ALWAYS should count a tx_error and 
>> drop the echo_skb when we have a TX-interrupt and TX-complete flag is 
>> zero.
>>
>> So replace:
>>
>> if (priv->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT &&
>>                   !(status & SR_TCS)) {
>>
>> with:
>>
>> if (!(status & SR_TCS)) {
>>
>> Any suggestions?
>>
> 
> In theory, yes. But I can't think of a reason you would end
> up there without CAN_CTRLMODE_ONE_SHOT being set.

Right. Me too. But for that reason I would remove that extra check to 
catch this error even if CAN_CTRLMODE_ONE_SHOT is not enabled.

> Aborting the current transmission in non single shot mode
> will get you there and incorrectly report the message as
> transmitted, but that is not implemented afaik.

Ahem, no. If you get there the echo_skb is deleted and the tx_errors 
counter is increased. Just as it should be.

Regards,
Oliver



More information about the linux-arm-kernel mailing list