All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: tom_usenet@optusnet.com.au, David Jander <david@protonic.nl>
Cc: kernel@pengutronix.de, linux-can@vger.kernel.org
Subject: Re: [PATCH 0/8] RFC: more flexcan cleanups and SW FIFO IRQ offloading
Date: Thu, 3 Sep 2015 10:45:52 +0200	[thread overview]
Message-ID: <55E808C0.8040309@pengutronix.de> (raw)
In-Reply-To: <55E80231.30808@optusnet.com.au>

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

On 09/03/2015 10:17 AM, Tom Evans wrote:
> On 03/09/15 16:58, Marc Kleine-Budde wrote:
>> On 09/03/2015 08:32 AM, David Jander wrote:
>>>>> this series adds a software FIFO implementation and switches
> 
> Thank you both for explaining that.
> 
> It seems fairly bulletproof as long as it doesn't overflow. There are 64 
> buffers, so 32 in the first half, so that handles a 1.5ms interrupt latency.
> 
> A shame Freescale didn't think of that method instead of requiring the driver 
> run quicksort somewhere.
> 
>  > In an atomic operation, the MB's that have been served are
>  > now disabled.
> 
> That's the sort of tricky operation that exposes nasty silicon bugs. I'd 
> suggest that this mode be made easy to turn off in case some chip variant has 
> a problem like htis.

This mode is only enabled on imx6, vybid and newer, as all the other
cores cannot receive RTR frames in the non FIFO mode.

> This feature looks to be enabled as a "QUIRK" of the CPU.

The quirk to enable the non FIFO mode, a.k.a. SW_FIFO is called
FLEXCAN_QUIRK_USE_SW_FIFO. See patch 7/8 where it is enabled on imx6 and
vybrid.

> In an old generation kernel this might be optionally enabled in the .config 
> file, as NAPI is in the 2.6.35 FEC drivers I'm stuck with using at the moment 
> on the i.MX53. In the current kernel, could this mode of operation (and/or 
> hardware FIFO using NAPI) be made configurable in the Device Tree instead?

Since 4.0 or something you really want to use NAPI, otherwise the order
of the packages is not guaranteed by the networking stack. So in both
case we use NAPI, but read the CAN frames in the hard IRQ context.
Either with the traditional FIFO (on that powerpc, imx25, imx35, imx53
and imx28) or the non-FIFO mode (imx6, vybrid).

With the current implementation, when enabling FLEXCAN_QUIRK_USE_SW_FIFO
on mx28, the controller doesn't receive RTR and extended CAN frames. RTR
is a known issue for the older cores, whie extended frames is probably a
configuration issue.

Given that the extended frame issue is fixed, you might want to
sacrifice RTR reception (because you don't need it) for bigger buffers
you can either patch the driver (adding the FLEXCAN_QUIRK_USE_SW_FIFO),
add a device tree option (convince the reviewers that this not a
confiuration option but a hardware description) or make it a new
CAN_CTRLMODE, so that it can be configured from the userspace.

According to the documentation both the normal FIFO and the mailboxes
can be used for RX at the same time, we can try to setup filters, so
that the FIFO is used for RTR messages only, while the normal mailboxes
are used for the non RTR messages. In order to merge these two together
we probably need to evaluate the timestamps.

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: 455 bytes --]

      parent reply	other threads:[~2015-09-03  8:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-01 10:31 [PATCH 0/8] RFC: more flexcan cleanups and SW FIFO IRQ offloading Marc Kleine-Budde
2015-09-01 10:31 ` [PATCH 1/8] can: flexcan: add missing register definitions Marc Kleine-Budde
2015-09-01 10:31 ` [PATCH 2/8] can: flexcan: activate individual RX masking and initialize reg_rximr Marc Kleine-Budde
2015-09-01 10:31 ` [PATCH 3/8] can: flexcan: add quirk FLEXCAN_QUIRK_ENABLE_EACEN_RRS Marc Kleine-Budde
2015-09-01 10:31 ` [PATCH 4/8] can: flexcan: reg_imask2_default Marc Kleine-Budde
2015-09-01 10:31 ` [PATCH 5/8] can: rx-fifo: introduce software rx-fifo implementation Marc Kleine-Budde
2015-09-01 10:32 ` [PATCH 6/8] can: flexcan: add support for rx-fifo based software FIFO implementation Marc Kleine-Budde
2015-09-01 10:32 ` [PATCH 7/8] can: flexcan: switch imx6 and vf610 to software based fifo Marc Kleine-Budde
2015-09-01 10:32 ` [PATCH 8/8] can: at91_can: switch to rx-fifo implementation Marc Kleine-Budde
2015-09-02 23:58 ` [PATCH 0/8] RFC: more flexcan cleanups and SW FIFO IRQ offloading Tom Evans
2015-09-03  6:32   ` David Jander
2015-09-03  6:58     ` Marc Kleine-Budde
2015-09-03  8:17       ` Tom Evans
2015-09-03  8:38         ` David Jander
2015-09-03  8:47           ` Marc Kleine-Budde
2015-09-04  3:19           ` Tom Evans
2015-09-03  8:45         ` Marc Kleine-Budde [this message]

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=55E808C0.8040309@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=david@protonic.nl \
    --cc=kernel@pengutronix.de \
    --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.