All of lore.kernel.org
 help / color / mirror / Atom feed
From: Olivier Sobrie <olivier@sobrie.be>
To: Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>,
	linux-can@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH] can: kvaser_usb: Add support for Kvaser CAN/USB devices
Date: Mon, 6 Aug 2012 07:27:27 +0200	[thread overview]
Message-ID: <20120806052727.GA16630@hposo> (raw)
In-Reply-To: <501EDB0B.5040204@grandegger.com>

On Sun, Aug 05, 2012 at 10:43:55PM +0200, Wolfgang Grandegger wrote:
> On 08/02/2012 01:56 PM, Marc Kleine-Budde wrote:
> > On 08/02/2012 12:53 PM, Olivier Sobrie wrote:
> ...
> >> I actually implemeted it as you said and here is what I observed in
> >> candump output with restart_ms set to 100 ms:
> >>
> >> t0: Short circuit between CAN-H and CAN-L + cansend can1 123#1122
> >>   can1  2000008C  [8] 00 04 90 00 00 00 00 00   ERRORFRAME
> >> 	controller-problem{rx-error-warning}
> >> 	protocol-violation{{tx-recessive-bit-error,error-on-tx}{}}
> >> 	bus-error
> >>   can1  2000008C  [8] 00 10 90 00 00 00 00 00   ERRORFRAME
> >> 	controller-problem{rx-error-passive}
> >> 	protocol-violation{{tx-recessive-bit-error,error-on-tx}{}}
> >> 	bus-error
> >>   can1  200000C8  [8] 00 00 90 00 00 00 00 00   ERRORFRAME
> >> 	protocol-violation{{tx-recessive-bit-error,error-on-tx}{}}
> >> 	bus-off
> >> 	bus-error
> >> ...
> 
> FYI, the option "-td" nicely shows the timing. I assume that the
> "warning->passive->bus-off" sequence repeats because automatic bus-off
> is active via ip option "restart-ms xx ms". What I'm missing is the
> message "restarted-after-bus-off". Maybe it's not listed here...

Indeed it's missing. Please look at the patch I just sent if it is now
correct or not.

> 
> >>   can1  2000008C  [8] 00 04 90 00 00 00 00 00   ERRORFRAME
> >> 	controller-problem{rx-error-warning}
> >> 	protocol-violation{{tx-recessive-bit-error,error-on-tx}{}}
> >> 	bus-error
> >>   can1  2000008C  [8] 00 10 90 00 00 00 00 00   ERRORFRAME
> >> 	controller-problem{rx-error-passive}
> >> 	protocol-violation{{tx-recessive-bit-error,error-on-tx}{}}
> >> 	bus-error
> >>   can1  200000C8  [8] 00 00 90 00 00 00 00 00   ERRORFRAME
> >> 	protocol-violation{{tx-recessive-bit-error,error-on-tx}{}}
> >> 	bus-off
> >> 	bus-error
> >>
> >> t1: short circuit removed
> >>   can1  123  [2] 11 22
> >>   can1  20000100  [8] 00 00 00 00 00 00 00 00   ERRORFRAME
> >> 	restarted-after-bus-of
> >>
> >> The echo coming before the restart looks weird? No?
> 
> Yes. It should come later.

Ok I've to change this.

> 
> >> Shouldn't we drop the frame once BUF-OFF is reached?
> 
> No.

Ok.

> 
> > No, I don't think so. But wait for Wolfgang, here's more into error
> > handling then me.
> 
> Looking to your code it's not clear to me how you do recovery from
> bus-off (called "restart"). This is usually done via
> do_set_mode(CAN_MODE_START), either manually (restart-ms==0) or
> automatically (restart-ms>0). Could you please explain how the device
> does bus-off recovery? Does the hardware do it automatically? This
> should be suppressed if if restart-ms==0 (as Marc already pointed out).

The hardware automatically recovers from BUS-OFF if it isn't stopped.
In the second version of the patch I just sent, I put the device off if
restart-ms == 0.

Thanks,

-- 
Olivier

  reply	other threads:[~2012-08-06  5:27 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-30  5:32 [PATCH] can: kvaser_usb: Add support for Kvaser CAN/USB devices Olivier Sobrie
2012-07-30 11:11 ` Marc Kleine-Budde
2012-07-30 13:33   ` Olivier Sobrie
2012-07-31  9:56     ` Marc Kleine-Budde
2012-07-31 13:06       ` Olivier Sobrie
2012-07-31 13:27         ` Marc Kleine-Budde
2012-08-02 10:53           ` Olivier Sobrie
2012-08-02 11:56             ` Marc Kleine-Budde
2012-08-02 12:16               ` Olivier Sobrie
2012-08-02 12:33                 ` Marc Kleine-Budde
2012-08-02 13:20                   ` Olivier Sobrie
2012-08-05 20:43               ` Wolfgang Grandegger
2012-08-06  5:27                 ` Olivier Sobrie [this message]
2012-07-31 13:43         ` Wolfgang Grandegger
2012-08-05 20:41       ` Wolfgang Grandegger
2012-08-06  5:21 ` [PATCH v2] " Olivier Sobrie
2012-08-06  8:10   ` Oliver Neukum
2012-08-08  5:28     ` Olivier Sobrie
2012-08-07  6:26   ` Wolfgang Grandegger
2012-08-08  6:14     ` Olivier Sobrie
2012-08-08  8:25       ` Wolfgang Grandegger
     [not found]         ` <5022227F.60800-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2012-08-08 13:30           ` Olivier Sobrie
2012-08-08 15:02             ` Wolfgang Grandegger
2012-08-13 13:51 ` [PATCH v3] " Olivier Sobrie
2012-09-20  5:06 ` [PATCH v4] " Olivier Sobrie
     [not found]   ` <1348117587-2905-1-git-send-email-olivier-Ui3EtX6WB9GzQB+pC5nmwQ@public.gmane.org>
2012-09-21  9:54     ` Marc Kleine-Budde
2012-09-22 16:02       ` Wolfgang Grandegger
     [not found]         ` <505DE106.6060405-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2012-10-02  7:14           ` Olivier Sobrie
2012-10-02  7:16 ` [PATCH v5] " Olivier Sobrie
2012-11-07 20:29   ` Marc Kleine-Budde
2012-11-20  8:46     ` Olivier Sobrie
2012-11-20 10:59       ` Marc Kleine-Budde
     [not found] ` <1343626352-24760-1-git-send-email-olivier-Ui3EtX6WB9GzQB+pC5nmwQ@public.gmane.org>
2012-11-21  7:11   ` [PATCH v6] " Olivier Sobrie
2012-11-22 11:01     ` Marc Kleine-Budde
2012-11-22 15:01     ` Olivier Sobrie
2012-11-22 21:30       ` Greg KH
2012-11-23  8:48         ` Marc Kleine-Budde
2012-11-23 13:30           ` [PATCH] kvaser_usb: fix "dma on the stack" errors Olivier Sobrie
2012-11-23 13:40             ` Olivier Sobrie
2012-11-23 13:48               ` Marc Kleine-Budde
2012-11-23 13:54               ` [PATCH v2] " Olivier Sobrie
2012-11-23 14:08                 ` Marc Kleine-Budde
2012-11-23 14:16                   ` Olivier Sobrie

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=20120806052727.GA16630@hposo \
    --to=olivier@sobrie.be \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=wg@grandegger.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.