From: Andreas Larsson <andreas@gaisler.com>
To: Wolfgang Grandegger <wg@grandegger.com>
Cc: linux-can@vger.kernel.org, Marc Kleine-Budde <mkl@pengutronix.de>,
devicetree-discuss@lists.ozlabs.org, software@gaisler.com
Subject: Re: [PATCH v3] can: grcan: Add device driver for GRCAN and GRHCAN cores
Date: Wed, 07 Nov 2012 13:55:26 +0100 [thread overview]
Message-ID: <509A5A3E.4090505@gaisler.com> (raw)
In-Reply-To: <509A42D8.6030009@grandegger.com>
On 11/07/2012 12:15 PM, Wolfgang Grandegger wrote:
> On 11/07/2012 08:32 AM, Andreas Larsson wrote:
>> On 11/05/2012 10:28 AM, Wolfgang Grandegger wrote:
> ...
>>> This looks good now. Just the automatic restart is missing as described
>>> above.
>>
>> When doing the bus_off handling as in at91_can, on a short-circuited bus
>> with restart-ms != 0, the result of a cansend is an endless and frequent
>> stream of
>>
>> can0 20000004 [8] 00 20 00 00 00 00 88 00 ERRORFRAME
>> controller-problem{tx-error-passive}
>> error-counter-tx-rx{{136}{0}}
>> can0 20000040 [8] 00 00 00 00 00 00 80 00 ERRORFRAME
>> bus-off
>> error-counter-tx-rx{{128}{0}}
>> can0 20000104 [8] 00 00 00 00 00 00 10 00 ERRORFRAME
>> controller-problem{}
>> restarted-after-bus-off
>> error-counter-tx-rx{{16}{0}}
>> can0 20000004 [8] 00 10 00 00 00 00 57 80 ERRORFRAME
>> controller-problem{rx-error-passive}
>> error-counter-tx-rx{{87}{128}}
>> can0 20000040 [8] 00 00 00 00 00 00 80 00 ERRORFRAME
>> bus-off
>> error-counter-tx-rx{{128}{0}}
>> can0 20000104 [8] 00 00 00 00 00 00 08 00 ERRORFRAME
>> controller-problem{}
>> restarted-after-bus-off
>> error-counter-tx-rx{{8}{0}}
>> can0 20000004 [8] 00 10 00 00 00 00 57 80 ERRORFRAME
>> controller-problem{rx-error-passive}
>> error-counter-tx-rx{{87}{128}}
>> can0 20000040 [8] 00 00 00 00 00 00 80 00 ERRORFRAME
>> bus-off
>> error-counter-tx-rx{{128}{0}}
>> can0 20000104 [8] 00 00 00 00 00 00 08 00 ERRORFRAME
>> controller-problem{}
>> restarted-after-bus-off
>> error-counter-tx-rx{{8}{0}}
>> [...]
>>
>> as the grcan core continues to try to resend the frame when it comes
>> back again. To mimic the sja1000 behavior as closely as possible, I
>> guess that the driver also would need to make sure that the tx and rx
>> buffers are cleaned out so that this resending does not happen, right?
>
> No, what you see is the normal behavior for automatic restart by the
> hardware. A bus-off recovery is *not* the same than a controller restart.
OK, if these automatic restarts are an OK behavior when restart_ms is non-zero I
am happy with taking the at91_can approach to things.
Cheers,
Andreas
next prev parent reply other threads:[~2012-11-07 12:55 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-02 14:38 [PATCH] can: grcan: Add device driver for GRCAN and GRHCAN cores Andreas Larsson
2012-10-04 9:45 ` Marc Kleine-Budde
2012-10-11 10:04 ` Marc Kleine-Budde
2012-10-11 11:22 ` Andreas Larsson
2012-10-11 11:28 ` Marc Kleine-Budde
2012-10-11 12:08 ` Andreas Larsson
2012-10-23 9:57 ` [PATCH v2] " Andreas Larsson
2012-10-23 16:26 ` Wolfgang Grandegger
2012-10-24 13:31 ` Andreas Larsson
2012-10-30 9:06 ` [PATCH v3] " Andreas Larsson
2012-10-30 10:07 ` Wolfgang Grandegger
2012-10-30 16:24 ` Andreas Larsson
2012-10-31 12:51 ` Wolfgang Grandegger
2012-10-31 16:33 ` Andreas Larsson
2012-10-31 16:39 ` [PATCH v4] " Andreas Larsson
2012-10-31 20:21 ` [PATCH v3] " Wolfgang Grandegger
2012-11-01 16:08 ` Andreas Larsson
2012-11-02 14:23 ` [PATCH v5] " Andreas Larsson
2012-11-05 9:28 ` [PATCH v3] " Wolfgang Grandegger
2012-11-07 7:32 ` Andreas Larsson
2012-11-07 11:15 ` Wolfgang Grandegger
2012-11-07 12:55 ` Andreas Larsson [this message]
2012-11-07 15:20 ` [PATCH v6] " Andreas Larsson
2012-11-08 8:29 ` Wolfgang Grandegger
2012-11-08 9:27 ` Marc Kleine-Budde
2012-11-08 10:37 ` Andreas Larsson
[not found] ` <509B7B1E.5040509-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2012-11-08 13:10 ` [PATCH v7] " Andreas Larsson
2012-11-09 0:01 ` Marc Kleine-Budde
2012-11-12 14:57 ` [PATCH v8] " Andreas Larsson
2012-11-13 21:15 ` Marc Kleine-Budde
2012-11-14 7:50 ` Andreas Larsson
2012-11-14 8:43 ` Marc Kleine-Budde
2012-11-14 11:02 ` Andreas Larsson
2012-11-14 11:22 ` Marc Kleine-Budde
2012-11-14 15:07 ` Andreas Larsson
2012-11-14 15:12 ` Marc Kleine-Budde
2012-11-15 7:47 ` [PATCH v9] " Andreas Larsson
2012-11-15 20:32 ` Marc Kleine-Budde
2012-11-16 6:17 ` Andreas Larsson
2012-11-08 10:33 ` [PATCH v6] " Andreas Larsson
2012-10-30 9:29 ` [PATCH v2] " 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=509A5A3E.4090505@gaisler.com \
--to=andreas@gaisler.com \
--cc=devicetree-discuss@lists.ozlabs.org \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=software@gaisler.com \
--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.