Linux CAN drivers development
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: Jason R1 White <White_Jason_R1@cat.com>
Cc: linux-can@vger.kernel.org, linux-can-owner@vger.kernel.org
Subject: Re: Bus off
Date: Fri, 27 Jun 2014 18:28:17 +0200	[thread overview]
Message-ID: <53AD9BA1.1030801@grandegger.com> (raw)
In-Reply-To: <OF5172F7FC.3EFFF9B4-ON86257D04.0056582A-86257D04.00568EC9@notes.cat.com>

On 06/27/2014 05:45 PM, Jason R1 White wrote:
> So is it still the recommendation to close the interface to flush the 
> queues?

As I said: the purpose of "restart" is not to do a fast if down->up.

> Is there anything planned for an ip command or IOCTL to do this?

It's on the wish list, let's say. Somebody needs to implement it. It's
also not straight-forward because there might be more than one socket
sending out CAN messages. For standard network devices there is no way
to flush all TX queues, IIRC.

Wolfgang.

>> On 06/27/2014 05:22 PM, Jason R1 White wrote:
>>>>
>>>> On Thu, Jun 26, 2014 at 10:13:17AM -0700, Austin Schuh wrote:
>>>>> Does anyone know if the TX queues are cleared on BUS-OFF?
>>>>
>>>> No queues are emptied, you will only loose the curent pending 
>>> transmission.
>>>>
>>>>>
>>>
>>> I thought the restart mechanism flushed the transmit queues (ip link 
> set 
>>> can0 type can restart).  Is this not the case?  That is what we are 
>>> relying upon.  We used to close and open the interface explicitly. 
>>
>>
>> "restart" and "restart-ms" should trigger a bus-off recovery:
>>
>>
> http://lxr.free-electrons.com/source/Documentation/networking/can.txt#L1087
> 
>>
>>>
>>> For controls its not a good practice to let stale data sit in the 
> output 
>>> buffer. 
>>
>> The intention of restart(-ms) was to simply trigger a bus-off recovery.
>> The name is not well chosen, though.
>>
>> Wolfgang.
> 
> 


  parent reply	other threads:[~2014-06-27 16:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26 17:13 Bus off Austin Schuh
2014-06-26 22:54 ` Max S.
2014-06-27  7:04   ` Marc Kleine-Budde
2014-06-27  5:05 ` Kurt Van Dijck
2014-06-27 15:22   ` Jason R1 White
2014-06-27 15:35     ` Wolfgang Grandegger
2014-06-27 15:45       ` Jason R1 White
2014-06-27 15:50         ` Marc Kleine-Budde
2014-06-27 16:28         ` Wolfgang Grandegger [this message]
2014-06-27 17:34           ` Oliver Hartkopp
2014-06-28  1:29             ` Austin Schuh
2014-06-28  8:52               ` Wolfgang Grandegger
2014-06-28 18:48                 ` Austin Schuh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53AD9BA1.1030801@grandegger.com \
    --to=wg@grandegger.com \
    --cc=White_Jason_R1@cat.com \
    --cc=linux-can-owner@vger.kernel.org \
    --cc=linux-can@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox