linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Jander <david@protonic.nl>
To: Andri Yngvason <andri.yngvason@marel.com>
Cc: Steffen Rose <ro@emtas.de>,
	linux-can@vger.kernel.org, Marc Kleine-Budde <mkl@pengutronix.de>
Subject: Re: flexcan napi poll and error frames
Date: Mon, 27 Oct 2014 08:29:55 +0100	[thread overview]
Message-ID: <20141027082955.52ecece2@archvile> (raw)
In-Reply-To: <544A8F03.8040906@marel.com>


Hi Andri,

On Fri, 24 Oct 2014 17:40:19 +0000
Andri Yngvason <andri.yngvason@marel.com> wrote:

> 
> On fös 24.okt 2014 16:36, Steffen Rose wrote:
> > Hello,
> >
> > Am Freitag, 24. Oktober 2014, 16:04:56 schrieben Sie:
> >>> We can do little if the CAN controller does not notify the Software
> >>>> via interrupt.
> >>> Yes, that's why I wanted to figure out if it's a controller problem or
> >>> not.
> >>> Turns out it's a controller problem, but perhaps we can work around it?
> >>> E.g. if we check esr for state changes every time someone transmits a
> >>> frame, both of these problems would go away. Would it be unacceptable
> >>> overhead to do so?
> >> I've just confirmed that this "fix" works, but only if berr-reporting is
> >> enabled.
> > Is this workaround working in case of an open CAN Bus?
> > (Ack error situation)
> Yes
> > The flexcan can generate an error interrupt after every CAN bus error. But
> > in case of an error situation the interrupt load would be very high (e.g.
> > short circuit of the CAN).
> >
> That's what berr-reporting does, right? Considering that when the bus is
> flooded with errors, things are in a pretty bad shape anyway, I think it's
> not really going to contribute much to the over-all mess to just leave the
> error interrupts on all the time. It's far worse if the user doesn't get
> the correct error state.
> 
> Anyway, defensive measures can be taken. When the bus has reached
> error-passive, the driver is not going to need those interrupts any more
> so it could turn off the interrupts until the bus goes to bus-off or back
> down to warning or active; except when berr-reporting is enabled.

Would you mind trying out the patch series posted a few days ago here:

http://article.gmane.org/gmane.linux.can/6654

It applies to the flexcan-next branch of
git://gitorious.org/linux-can/linux-can-next.git
(base commit should be 907aa2d61697035a921cad6375c0d546b1d18af6 if HEAD fails).

I think it solves your problem.

Best regards,

-- 
David Jander
Protonic Holland.

  reply	other threads:[~2014-10-27  7:29 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24 10:26 flexcan napi poll and error frames Andri Yngvason
2014-10-24 10:43 ` Wolfgang Grandegger
2014-10-24 10:55   ` Andri Yngvason
2014-10-24 12:33     ` Wolfgang Grandegger
2014-10-24 14:39       ` Andri Yngvason
2014-10-24 16:04         ` Andri Yngvason
2014-10-24 16:36           ` Steffen Rose
2014-10-24 17:40             ` Andri Yngvason
2014-10-27  7:29               ` David Jander [this message]
     [not found]                 ` <544E2C19.1050608@marel.com>
2014-10-27 14:01                   ` David Jander
2014-10-27 15:53                     ` Andri Yngvason
2014-10-24 19:08           ` 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=20141027082955.52ecece2@archvile \
    --to=david@protonic.nl \
    --cc=andri.yngvason@marel.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=ro@emtas.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).