linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ira W. Snyder" <iws@ovro.caltech.edu>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org
Subject: Re: [PATCH 3/3] can: janz-ican3: add support for one shot mode
Date: Fri, 13 Jul 2012 16:05:21 -0700	[thread overview]
Message-ID: <20120713230521.GD4538@ovro.caltech.edu> (raw)
In-Reply-To: <4FFFE366.8000707@pengutronix.de>

On Fri, Jul 13, 2012 at 10:59:18AM +0200, Marc Kleine-Budde wrote:
> On 07/12/2012 06:15 PM, Ira W. Snyder wrote:
> > From: "Ira W. Snyder" <iws@ovro.caltech.edu>
> > 
> > The Janz VMOD-ICAN3 hardware has support for one shot packet
> > transmission. This means that a packet will be attempted to be sent
> > once, with no automatic retries.
> > 
> > The SocketCAN core supports this mode using CAN_CTRLMODE_ONE_SHOT.
> 
> What happens to the queued to-be-echoed CAN frames if the device fails
> to send a CAN frame, due to one shot mode?
> 

I borrowed the hardware and tested this. I generated bus problems by
unplugging the cable from the card.

With "berr-reporting off" I get no indication from the firmware that
there is any problems until ERROR-WARNING (96 errors) or ERROR-PASSIVE
(128 errors) state is reached.

With "berr-reporting on", I get a bus-error message for every message I
try to send. It looks like this:

  can0  20000088  [8] 00 00 80 19 00 00 08 00   ERRORFRAME
        protocol-violation{{error-on-tx}{acknowledge-slot}}
        bus-error
        error-counter-tx-rx{{8}{0}}

The TX error count increases by 8 for each packet. My CAN book seems to
say this is the correct behavior when the bus is unconnected.

I fixed the echo skb problem (see my patch in reply to this) by always
enabling bus errors, and using those to know when packet transmission
failed. In testing, it works well. Please take that patch instead of
this one.

Thanks for the review.

Ira

> Marc
> -- 
> Pengutronix e.K.                  | Marc Kleine-Budde           |
> Industrial Linux Solutions        | Phone: +49-231-2826-924     |
> Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
> Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |
> 



  reply	other threads:[~2012-07-13 23:05 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12 16:15 [PATCH 0/3] can: janz-ican3: fix support for CAN_RAW_RECV_OWN_MSGS Ira W. Snyder
2012-07-12 16:15 ` [PATCH 1/3] " Ira W. Snyder
2012-07-16  7:28   ` Wolfgang Grandegger
2012-07-16 16:00     ` Ira W. Snyder
2012-07-17  8:22       ` Wolfgang Grandegger
2012-07-12 16:15 ` [PATCH 2/3] can: janz-ican3: increase tx buffer size Ira W. Snyder
2012-07-13  9:00   ` Marc Kleine-Budde
2012-07-13 15:20     ` [PATCH] can: janz-ican3: fix support for CAN_RAW_RECV_OWN_MSGS Ira W. Snyder
2012-07-17 23:09       ` Marc Kleine-Budde
2012-07-18 17:47         ` Ira W. Snyder
2012-07-19 10:14           ` Marc Kleine-Budde
2012-07-12 16:15 ` [PATCH 3/3] can: janz-ican3: add support for one shot mode Ira W. Snyder
2012-07-13  8:59   ` Marc Kleine-Budde
2012-07-13 23:05     ` Ira W. Snyder [this message]
2012-07-13 23:07       ` [PATCH v2 " Ira W. Snyder
2012-07-17 22:51         ` Marc Kleine-Budde
2012-07-18 18:20           ` Ira W. Snyder
2012-07-18 21:35             ` Ira W. Snyder
2012-07-19  8:01             ` Marc Kleine-Budde

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=20120713230521.GD4538@ovro.caltech.edu \
    --to=iws@ovro.caltech.edu \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).