Thread (11 messages) 11 messages, 3 authors, 2020-12-02

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

From: Oliver Hartkopp <socketcan@hartkopp.net>
Date: 2020-12-02 16:27:19
Also in: linux-arm-kernel, linux-can

Hello Jeroen,

On 02.12.20 16:37, Jeroen Hofstee wrote:
On 12/2/20 3:35 PM, Oliver Hartkopp wrote:
quoted
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.
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help