All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: Tom Evans <tom_usenet@optusnet.com.au>,
	dan.egnor@gmail.com, linux-can@vger.kernel.org
Subject: Re: Flexcan
Date: Thu, 02 Apr 2015 14:07:28 +0200	[thread overview]
Message-ID: <551D3100.1020209@pengutronix.de> (raw)
In-Reply-To: <551D298D.7040809@optusnet.com.au>

[-- Attachment #1: Type: text/plain, Size: 2575 bytes --]

On 04/02/2015 01:35 PM, Tom Evans wrote:
> On 2/04/2015 5:28 PM, Marc Kleine-Budde wrote:
>> On 04/02/2015 04:20 AM, Tom Evans wrote:
>>> I had to seriously rewrite the FlexCAN drivers for our i.MX53 because the
>>> Ethernet driver blocked the CAN driver for so long the CAN hardware receive
>>> FIFO overflowed. Linux doesn't even support setting different interrupt
>>> priorities on ARM (but my problem was with NAPI).
>>
>> Can you share your changes? I'll have some days to hack on a better
>> generic RX-FIFO implementation for the at91 and flexcan.
> 
> Sure. "git diff -p" based of the 3.4 kernel sources.

Thanks.

> Working from home over Easter using git under cygwin under Windows via 
> Thunderbird, so the CRLFs and line breaks could be messed up, sorry. 
> Patches inline and attached. If this lot is useless, tell me what to 
> type to do it properly and I'll resend on Tuesday.

Uhhh sounds scary - what about switching to Linux over the holidays? :D
As I don't want to push that patch upstream, but get more insight into
the various problem and solutions, this is alright.

BTW: you can send pathes directly via "git send-email".

> flexcan.c.patch.buffer
> 
> The problem with the FlexCan driver is that it takes the interrupt, then 
> throws to NAPI to actually read the hardware buffers. How messed up is 
> that? It isn't as if reading 16 bytes or so is going to take THAT long, 
> and as there's only six message buffers it overflows in 600us at 1MHz. 
> In the same kernel, the Ethernet driver DOESN'T throw to NAPI but 
> handles as many 1500-byte Ethernet frames as there are coming in in the 
> one ISR. Other things can delay NAPI as well. So I fixed it with a 
> sledgehammer. It reads the messages during the ISR to an internal ring 
> buffer (sized to 100, later to 128)

Sledgehammers are not the best tool for mainline kernel development, but
it's good to demolish old walls and get a clear view to head in the
hopefully right direction.

> flexcan.c.patch.flood
> 
> A disconnected CAN bus generate an interrupt storm. This patch fixes it 
> the same way it is apparently done in some 3.18 drivers. This may 
> already be in there.

We're heading for a different solution, limiting the bus errors.

Thanks,
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   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-04-02 12:07 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAE+ymru296P+LjkT7_ONVc2OGMP9mtXW46Nq5aSnm1etauj9Aw@mail.gmail.com>
2015-03-28 20:26 ` Fwd: Querying current tx_queue usage of a SocketCAN interface Paarvai Naai
2015-03-29 22:42   ` Tom Evans
2015-03-30 21:55     ` Paarvai Naai
     [not found]       ` <5519E5A9.7080104@optusnet.com.au>
2015-03-31  0:26         ` Paarvai Naai
2015-03-31  3:09           ` Tom Evans
2015-04-01 20:33             ` Paarvai Naai
2015-04-01 20:57               ` Dan Egnor
2015-04-02  2:20                 ` Tom Evans
2015-04-02  2:33                   ` Daniel Egnor
2015-04-01 23:21               ` Tom Evans
2015-04-02  0:33                 ` Dan Egnor
2015-04-02  2:20                   ` Tom Evans
2015-04-02  6:28                     ` Flexcan (was: Re: Fwd: Querying current tx_queue usage of a SocketCAN interface) Marc Kleine-Budde
2015-04-02 11:35                       ` Tom Evans
2015-04-02 12:07                         ` Marc Kleine-Budde [this message]
2015-04-04  3:32                         ` Tom Evans
2015-04-09  8:06                           ` Flexcan Tom Evans
2015-04-10  6:35                             ` Flexcan (was: Re: Fwd: Querying current tx_queue usage of a SocketCAN interface) Tom Evans
2015-04-02 18:23                     ` Fwd: Querying current tx_queue usage of a SocketCAN interface Paarvai Naai
2015-04-02  6:46                   ` Marc Kleine-Budde
2015-04-02 18:28                     ` Paarvai Naai
2015-04-03  1:35                       ` Tom Evans
2015-04-03  6:45                         ` Paarvai Naai
2015-04-03 11:08                           ` Marc Kleine-Budde
2015-04-03 15:24                             ` Paarvai Naai
2015-04-03 20:28                               ` Marc Kleine-Budde
2015-04-03 20:53                                 ` Paarvai Naai
2015-04-04  8:49                                   ` Marc Kleine-Budde
2015-04-06 17:54                                     ` Paarvai Naai

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=551D3100.1020209@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=dan.egnor@gmail.com \
    --cc=linux-can@vger.kernel.org \
    --cc=tom_usenet@optusnet.com.au \
    /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.