All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@grandegger.com>
To: "Max S." <max@schneidersoft.net>
Cc: linux-can <linux-can@vger.kernel.org>
Subject: Re: GS_USB
Date: Mon, 07 Oct 2013 22:30:30 +0200	[thread overview]
Message-ID: <525319E6.4020505@grandegger.com> (raw)
In-Reply-To: <1381175546.21207.37.camel@blackbox>

On 10/07/2013 09:52 PM, Max S. wrote:
> On Mon, 2013-10-07 at 16:37 +0200, Wolfgang Grandegger wrote:
>> Will not find time for the review today...
> 
> no problem.
> 
>> The CAN controller does not do any asynchronous error reporting,
>> right? This will limit the usability of this device, especially
>> CAN applications relying on that feature will not work. Any chance
>> to add asynchronous error reporting to the firmware?
> 
> Only CAN_ERR_CRTL_RX_OVERFLOW is currently reported (possible when host
> is too slow).
> CAN_ERR_CRTL_TX_OVERFLOW is impossible due to the driver design
> (tx context + echo).
> 
> Which errors are most important to the applications you mentioned?

CAN error state changes are sufficient, including bus-off. Bus-off
recovery initiated by the software would be nice as well. Reporting
individual bus errors is less important.

> The hardware does not allow for the sensing of the CAN_ERR_TRX_* errors.
> I can sense some  CAN_ERR_PROT_* errors, as well as all CAN_ERR_CRTL_*
> errors.

> In firmware it is possible to queue error/status frames much like normal
> frames. So they would show up in the receive callback... Thats what you
> meant by asynchronous right?

Yep, an application can then read and handle these error messages. Here
is the output of "candump -candump -td -e any,0:0,#FFFFFFFF" showing
error state changes until bus-off and recovery with an SJA1000:

 (000.202225)  can0   5F  [8] 07 B4 4F 67 3A 90 D9 E4
 (000.201285)  can0  20000204  [8] 00 08 00 00 00 00 78 00   ERRORFRAME
        controller-problem{tx-error-warning}
        error-counter-tx-rx{{120}{0}}
 (000.003249)  can0  20000240  [8] 00 00 00 00 00 00 00 00   ERRORFRAME
        bus-off
 (005.015531)  can0  20000100  [8] 00 00 00 00 00 00 7F 00   ERRORFRAME
        restarted-after-bus-off
        error-counter-tx-rx{{127}{0}}

We don't have yet support for decreasing the error state, e.g.:

 (000.000133)  can0  20000200  [8] 00 40 00 00 00 00 00 00   ERRORFRAME
        state-change{back-to-error-active}


Wolfgang.

  reply	other threads:[~2013-10-07 20:31 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-04 12:31 GS_USB Max S.
2013-10-04 13:23 ` GS_USB Marc Kleine-Budde
2013-10-05 20:36 ` GS_USB Wolfgang Grandegger
2013-10-07 14:22   ` GS_USB Max S.
2013-10-07 14:37     ` GS_USB Wolfgang Grandegger
2013-10-07 19:52       ` GS_USB Max S.
2013-10-07 20:30         ` Wolfgang Grandegger [this message]
2013-11-03 17:12           ` GS_USB Max S.
2013-11-03 19:42             ` GS_USB Wolfgang Grandegger
2013-11-09 23:19             ` GS_USB Wolfgang Grandegger
2013-11-11  2:10               ` GS_USB Max S.
2013-11-11  8:05                 ` GS_USB Wolfgang Grandegger
2013-11-11 15:41                   ` GS_USB Oliver Hartkopp
     [not found]                     ` <1384199350.3483.20.camel@blackbox>
2013-11-11 21:49                       ` GS_USB Oliver Hartkopp
2013-11-15 10:39                         ` GS_USB Max S.
2013-11-23 16:05                           ` GS_USB Max S.
2013-12-04 21:17                             ` GS_USB Max S.
2013-12-05 19:05                               ` GS_USB Oliver Hartkopp
2013-12-05 19:07                                 ` GS_USB Oliver Hartkopp
2013-12-09 17:53                                   ` GS_USB Max S.
2013-12-05 20:18                               ` GS_USB Wolfgang Grandegger
2013-12-05 20:42                                 ` GS_USB Wolfgang Grandegger
2013-12-07 10:06                             ` GS_USB Wolfgang Grandegger
2013-12-09 10:52                               ` GS_USB Marc Kleine-Budde
2013-12-09 13:15                                 ` GS_USB Wolfgang Grandegger

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=525319E6.4020505@grandegger.com \
    --to=wg@grandegger.com \
    --cc=linux-can@vger.kernel.org \
    --cc=max@schneidersoft.net \
    /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.