From: David Jander <david@protonic.nl>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Alexander Stein <alexander.stein@systec-electronic.com>,
linux-can@vger.kernel.org
Subject: Re: [PATCH v2 02/12] can: rx-offload: Add support for timestamp based irq offloading
Date: Tue, 5 Jul 2016 08:31:09 +0200 [thread overview]
Message-ID: <20160705083109.1c8d44a8@erd980> (raw)
In-Reply-To: <9e7e6562-3ed5-6807-a178-aa19595191a8@pengutronix.de>
On Tue, 5 Jul 2016 08:19:31 +0200
Marc Kleine-Budde <mkl@pengutronix.de> wrote:
> On 07/05/2016 07:46 AM, Alexander Stein wrote:
> > On Monday 04 July 2016 20:32:07, Marc Kleine-Budde wrote:
> >> Some CAN controllers don't implement a FIFO in hardware, but fill their
> >> mailboxes in a particular order (from lowest to highest or highest to
> >> lowest). This makes problems to read the frames in the correct order from
> >> the hardware, as new frames might be filled into just read (low) mailboxes.
> >> This gets worse, when following new frames are received into not read
> >> (higher) mailboxes.
> >>
> >> On the bright side some these CAN controllers put a timestamp on each
> >> received CAN frame. This patch adds support to offload CAN frames in
> >> interrupt context, order them by timestamp and then transmitted in a NAPI
> >> context.
> >>
> >> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> >
> > How is this supposed to work with CAN controllers without tmestamps, e.g.
> > CCAN/DCAN? Do you need to set the timestamp manually using ktime_get() or
> > similar when reading each mailbox? IMHO especially those controllers are prone
> > to ordering issues under heavy load as the hardware doesn't ensure ordering by
> > itself and there is no hardware based timestamp.
>
> The algorithm added in this patch only supports controllers that add
> timestamps to the mailbox on reception in hardware (like flexcan, at91
> and hecc). However the other algorithm we implemented didn't make use of
> timestamps and targeted controllers that fill mailboxes in a particular
> order. It can be ported to the current framework and the c_can/d_can
> driver to it.
I originally wrote order-based FIFO simulation for the flexcan, that didn't
use the timestamps. It turned out that flexcan has some hardware issues that
prevented this implementation from working reliably on the flexcan controller.
In fact, the whole ordered reception mechanism is useless on flexcan without
timestamps.
Marc: did you throw away the original implementation for good, or are you
planning to add it again, in order to use it for CCAN/DCAN and similar
controllers?
Best regards,
--
David Jander
Protonic Holland.
next prev parent reply other threads:[~2016-07-05 6:54 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-04 18:32 [PATCH v2 00/12] can: rx-offload: add implmentation and switch flexcan driver to use it Marc Kleine-Budde
2016-07-04 18:32 ` [PATCH v2 01/12] can: rx-offload: Add support for HW fifo based irq offloading Marc Kleine-Budde
2016-07-04 18:32 ` [PATCH v2 02/12] can: rx-offload: Add support for timestamp " Marc Kleine-Budde
2016-07-04 18:49 ` Andri Yngvason
2016-07-04 20:59 ` Marc Kleine-Budde
2016-07-04 22:30 ` Marc Kleine-Budde
2016-07-05 11:58 ` Andri Yngvason
2016-07-05 12:40 ` Marc Kleine-Budde
2016-07-05 5:46 ` Alexander Stein
2016-07-05 6:19 ` Marc Kleine-Budde
2016-07-05 6:31 ` David Jander [this message]
2016-07-05 7:21 ` Marc Kleine-Budde
2016-07-04 18:32 ` [PATCH v2 03/12] can: flexcan: remove write-only member pdata of struct flexcan_priv Marc Kleine-Budde
2016-07-04 18:32 ` [PATCH v2 04/12] can: flexcan: make declaration of devtype_data const Marc Kleine-Budde
2016-07-04 18:32 ` [PATCH v2 05/12] can: flexcan: calculate default value for imask1 during runtime Marc Kleine-Budde
2016-07-04 18:32 ` [PATCH v2 06/12] can: flexcan: make TX mailbox selectable " Marc Kleine-Budde
2016-07-04 18:32 ` [PATCH v2 07/12] can: flexcan: make use of rx-offload's irq_offload_fifo Marc Kleine-Budde
2016-07-04 18:32 ` [PATCH v2 08/12] can: flexcan: add missing register definitions Marc Kleine-Budde
2016-07-04 18:32 ` [PATCH v2 09/12] can: flexcan: activate individual RX masking and initialize reg_rximr Marc Kleine-Budde
2016-07-04 18:32 ` [PATCH v2 10/12] can: flexcan: add quirk FLEXCAN_QUIRK_ENABLE_EACEN_RRS Marc Kleine-Budde
2016-07-04 18:32 ` [PATCH v2 11/12] can: flexcan: add support for timestamp based rx-offload Marc Kleine-Budde
2016-07-04 18:32 ` [PATCH v2 12/12] can: flexcan: switch imx6 and vf610 to timestamp based offloading Marc Kleine-Budde
2016-07-13 7:28 ` [PATCH v2 00/12] can: rx-offload: add implmentation and switch flexcan driver to use it Mirza Krak
2016-07-13 7:46 ` Marc Kleine-Budde
2016-09-07 6:33 ` Holger Schurig
2016-10-04 6:32 ` Holger Schurig
2016-10-04 11:57 ` Alexander Stein
2016-10-04 12:33 ` David Jander
2016-10-05 12:37 ` Alexander Stein
2016-11-30 14:22 ` Alexander Stein
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=20160705083109.1c8d44a8@erd980 \
--to=david@protonic.nl \
--cc=alexander.stein@systec-electronic.com \
--cc=linux-can@vger.kernel.org \
--cc=mkl@pengutronix.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).