linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Evans <tom_usenet@optusnet.com.au>
To: Marc Kleine-Budde <mkl@pengutronix.de>,
	Torsten Lang <torsten.lang@uweschneider.de>
Cc: Holger Schurig <holgerschurig@gmail.com>,
	Alexander Stein <alexander.stein@systec-electronic.com>,
	linux-can@vger.kernel.org
Subject: Re: can: flexcan: implement workaround for FIFO overruns (based on code by David Jander)
Date: Fri, 24 Jul 2015 13:53:13 +1000	[thread overview]
Message-ID: <55B1B6A9.1000702@optusnet.com.au> (raw)
In-Reply-To: <55AF5AF2.6050905@pengutronix.de>

On 22/07/15 18:57, Marc Kleine-Budde wrote:
> On 07/22/2015 10:00 AM, Torsten Lang wrote:
>> Am 09.07.2015 um 09:59 schrieb Holger Schurig:
>>>> Is it "normal" to have interrupts locked out for more than 300us
 >>>> (six 50us CAN messages at 1MHz)?
>>> Unfortunately yes.  My $CUSTOMER had overruns with 500 kB/s, 80% bus
>>> load, and CAN messages with 3 bytes of data. My guess this was mostly
>>> due to the sucky SDHCI (eMMC) driver code in Linux.

There's been some off-list email on this. It looks like the MMC driver isn't 
well written.

I think I've found the "Official Freescale" workaround for the CAN problems 
under Linux:

http://cache.freescale.com/files/32bit/doc/app_note/AN4815.pdf

The above App Note documents migration to the i.MX 6SoloX chip. It contains 
one each of Cortex-A9 and Cortex-M4 CPU cores.

The purpose of the M4 core is listed to be:

               Secondary processor for fast boot, low power
               processing, and robust CAN message handling.

So that's your only fix. Use a totally separate CPU for CAN.

Or don't design hardware that uses chips that the software doesn't support 
(well enough to work with your other hardware). So don't design with eMMC on 
this platform. Use something simpler and faster, like NAND or NOR Flash.

On a slightly better note, who's responsible for the MMC driver?

Which one are you using? This one (from Freescale 2.6.35):

/*
  *  linux/drivers/mmc/host/mxc_mmc.c - Freescale MXC/i.MX MMC driver
  *
  *  based on imxmmc.c
  *  Copyright (C) 2004 Sascha Hauer, Pengutronix <sascha@saschahauer.de>
  *
  *  derived from pxamci.c by Russell King

This one from the Mainline:

http://lxr.free-electrons.com/source/drivers/mmc/host/mxcmmc.c

   9  *  Copyright (C) 2008 Sascha Hauer, Pengutronix <s.hauer@pengutronix.de>
  10  *  Copyright (C) 2006 Pavel Pisa, PiKRON <ppisa@pikron.com>
  11  *
  12  *  derived from pxamci.c by Russell King

Is there a mailing list where these apparent MMC driver problems can be 
reported? Probably "gmane.linux.kernel.mmc".

It might be worth posting some FTRACE results to there.

> IIRC you can insert a SD/MMC/eMMC and mark it as non removable
 > in the DT to work around the problem - connecting the Card
 > Detection pin might also work.

Has anyone tested that to see if it helps or helps enough?

Tom


  reply	other threads:[~2015-07-24  3:53 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08 14:38 can: flexcan: implement workaround for FIFO overruns (based on code by David Jander) Torsten Lang
2015-07-09  6:33 ` Holger Schurig
2015-07-09  6:38   ` Holger Schurig
2015-07-09  9:26   ` Torsten Lang
2015-07-09  9:32     ` Holger Schurig
2015-07-09  9:36       ` Marc Kleine-Budde
2015-07-09  9:42         ` Holger Schurig
2015-07-09  6:58 ` Alexander Stein
2015-07-09  7:27   ` Holger Schurig
2015-07-09  7:48     ` Alexander Stein
2015-07-09  7:59       ` Holger Schurig
2015-07-09 10:03         ` Torsten Lang
2015-07-22  8:00         ` Torsten Lang
2015-07-22  8:57           ` Marc Kleine-Budde
2015-07-24  3:53             ` Tom Evans [this message]
2015-07-24  8:45               ` Torsten Lang
2015-07-09  7:42 ` Tom Evans
2015-07-09  9:48   ` Torsten Lang
2015-07-09 10:05     ` Holger Schurig
2015-07-09 15:36     ` Tom Evans
2015-07-10  9:17       ` Torsten Lang
2015-07-11  6:42         ` Tom Evans
2015-07-09  8:06 ` Holger Schurig
2015-07-09  8:43   ` Oliver Hartkopp

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=55B1B6A9.1000702@optusnet.com.au \
    --to=tom_usenet@optusnet.com.au \
    --cc=alexander.stein@systec-electronic.com \
    --cc=holgerschurig@gmail.com \
    --cc=linux-can@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=torsten.lang@uweschneider.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).