From: Wolfgang Grandegger <wg@grandegger.com>
To: Oliver Hartkopp <socketcan@hartkopp.net>
Cc: Andri Yngvason <andri.yngvason@marel.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
linux-can@vger.kernel.org
Subject: Re: [PATCH 2/4] Consolidate and unify state change handling
Date: Wed, 24 Sep 2014 08:28:19 +0200 [thread overview]
Message-ID: <5dbfb5357e26091dee2c14f14f50d71c@grandegger.com> (raw)
In-Reply-To: <5421F4D5.5030709@hartkopp.net>
On Wed, 24 Sep 2014 00:31:49 +0200, Oliver Hartkopp
<socketcan@hartkopp.net> wrote:
> On 09/23/2014 10:33 PM, Wolfgang Grandegger wrote:
>> On 09/21/2014 07:27 PM, Andri Yngvason wrote:
>
>
>>> PS.: I must admit that I don't actually know why it's useful to know
>>> which
>>> error counter changed; tx or rx. I think it would be much simpler to
>>> send
>>> the max of both and be done with it. Can anyone point out a case where
>>> this
>>> helps?
>>
>> I agree that it would be much simpler not to distinguish between rx and
>> tx state changes. This is for historical reasons. Oliver, do you
>> remember why we adapted that solution?
>>
>
> No. Indeed I was not even aware of the fact that error counters should
be
> set
> into any kind of relation.
>
> When the error counters change, the error message should be fired.
> And when the thresholds e.g. for CAN_ERR_CRTL_*X_WARNING are triggered
> these
> flags should be set accordingly.
Well, unfortunately it's not that simple. Normally just the state change
is
triggered and the software has to find out the direction. On most
controllers
we therefore fiddle with the RX and TX error counters. Or do you suggest
to
monitor (cache) the error counters? They are not available on some CAN
controllers.
> So can_state errcount_to_state() makes perfectly sense.
>
> But I don't know why to compare tx error counters to rx error counters
> either.
See above.
Wolfgang.
next prev parent reply other threads:[~2014-09-24 6:28 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-18 16:25 [PATCH 2/4] Consolidate and unify state change handling Andri Yngvason
2014-09-19 21:10 ` Wolfgang Grandegger
2014-09-21 14:47 ` Andri Yngvason
2014-09-21 15:30 ` Wolfgang Grandegger
2014-09-21 17:27 ` Andri Yngvason
2014-09-23 20:33 ` Wolfgang Grandegger
2014-09-23 22:31 ` Oliver Hartkopp
2014-09-24 6:28 ` Wolfgang Grandegger [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-09-18 16:38 Andri Yngvason
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=5dbfb5357e26091dee2c14f14f50d71c@grandegger.com \
--to=wg@grandegger.com \
--cc=andri.yngvason@marel.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=socketcan@hartkopp.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 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).