All of lore.kernel.org
 help / color / mirror / Atom feed
From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: FEC ethernet issues [Was: PL310 errata workarounds]
Date: Tue, 1 Apr 2014 23:51:49 +0100	[thread overview]
Message-ID: <20140401225149.GC7528@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <OF15BAA4F9.E675BBEF-ON87257CAD.006812E9-87257CAD.006BE81E@grpleg.it>

On Tue, Apr 01, 2014 at 01:38:37PM -0600, robert.daniels at vantagecontrols.com wrote:
> I'm not sure where this factors in, but I originally saw this problem using
> the Freescale 2.6.35 kernel.  The driver there exhibits this problem
> differently, although it could very well be a different problem. What
> I observed was that when the FEC got into this bad state the driver would
> attempt to transmit a socket buffer but for some reason the buffer would
> not actually get transmitted.
>
> The driver would continue transmitting packets until it got all the way
> around in the ring buffer to the buffer descriptor right before the one
> that was never transmitted.  When this buffer descriptor was set to
> transmit you'd get a double transmit - the new packet and the previously
> untransmitted buffer.
>
> This results in out-of-order packets being sent directly from the i.MX53.

At initial glance, this is coherent with my idea of the FEC skipping a
ring entry on the initial pass around.  Then when a new entry is loaded,

Let's say that the problem entry is number 12 that has been skipped.
When we get back around to entry 11, the FEC will transmit entries 11
and 12, as you rightly point out, and it will then look at entry 13
for the next packet.

However, the driver loads the next packet into entry 12, and hits the
FEC to transmit it.  The FEC re-reads entry 13, finds no packet, so
does nothing.

Then the next packet is submitted to the driver, and it enters it into
entry 13, again hitting the FEC.  The FEC now sees the entry at 13,
meanwhile the entry at 12 is still pending.

> I hope this additional information is useful, I don't know enough
> about these low-level networking details to contribute much but
> it's possible that what I've seen in the 2.6.35 kernel is actually
> the same issue that I'm seeing in the 3.14 kernel but handled
> better.

It confirms the theory, but doesn't really provide much clues for a
solution at the moment.

However, I've had something of a breakthrough with iMX6 and half-duplex.
I think much of the problem comes down to this ERR006358 workaround
implemented in the driver (this apparantly doesn't affect your device.)
The delayed work implementation, and my delayed timer implementation of
the same are fundamentally wrong to the erratum documentation - as is
the version implemented in the Freescale BSP.

Implementing what the erratum says as an acceptable workaround improves
things tremendously - I see iperf on a 10Mbit hub go from 1-2Mbps up to
8Mbps, though still with loads of collisions.  That said, I'm not that
trusting of the error bits indicated from the FEC.

The reason I mention it here is that I wonder if less wacking of the
FEC_X_DES_ACTIVE register may help your problem.

In 3.14, in the fec_enet_start_xmit function, find the
"writel(0, fep->hwp + FEC_X_DES_ACTIVE);" and change it to:

	wmb();

        /* Trigger transmission start */
        if (readl(fep->hwp + FEC_X_DES_ACTIVE) == 0)
                writel(0, fep->hwp + FEC_X_DES_ACTIVE);

and see whether that helps your problem(s).

-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.

  reply	other threads:[~2014-04-01 22:51 UTC|newest]

Thread overview: 76+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-14 14:48 PL310 errata workarounds Russell King - ARM Linux
2014-03-14 15:01 ` Russell King - ARM Linux
2014-03-14 16:02   ` Rob Herring
2014-03-14 17:57     ` Russell King - ARM Linux
2014-03-14 19:14       ` Rob Herring
2014-03-14 20:32         ` Russell King - ARM Linux
2014-03-19 21:22         ` Marek Vasut
2014-03-19 21:35           ` Rob Herring
2014-03-19 21:46             ` Russell King - ARM Linux
2014-03-19 21:54               ` Marek Vasut
2014-03-16 11:52     ` Russell King - ARM Linux
2014-03-17 15:04       ` Rob Herring
2014-03-17 15:37         ` Russell King - ARM Linux
2014-03-17 17:29           ` Catalin Marinas
2014-03-17 19:44             ` Russell King - ARM Linux
2014-03-17 21:09               ` Nicolas Pitre
2014-03-17 21:14                 ` Russell King - ARM Linux
2014-03-17 21:54                   ` Nicolas Pitre
2014-03-16 15:29 ` Russell King - ARM Linux
2014-03-17 14:00   ` Rob Herring
2014-03-17 14:40     ` Russell King - ARM Linux
2014-03-18 11:22     ` *READ THIS IF YOUR SOC HAS A L2 CACHE* PL310 auxctrl settings Russell King - ARM Linux
2014-03-28 12:51       ` Maxime Coquelin
2014-03-28 13:02         ` Russell King - ARM Linux
2014-03-28 13:32           ` Maxime Coquelin
2014-03-18 17:26     ` PL310 errata workarounds Russell King - ARM Linux
2014-03-19 21:52       ` Marek Vasut
2014-03-19 22:51         ` Russell King - ARM Linux
2014-03-19 23:05           ` FEC ethernet issues [Was: PL310 errata workarounds] Marek Vasut
2014-03-20  4:01             ` Marek Vasut
2014-03-20 22:27               ` Fabio Estevam
2014-03-20 23:06                 ` Russell King - ARM Linux
2014-03-21  0:24                   ` Troy Kisky
2014-03-21  1:18                     ` Russell King - ARM Linux
2014-03-21  1:36                       ` Fabio Estevam
2014-03-21  1:43                         ` Fabio Estevam
2014-03-21 16:37                           ` Bernd Faust
     [not found]                           ` <CANBf9eNZB+BVBDkgWNxxGs-ndQ-mYCc6+bfVdS-8T-QLpSZ3GA@mail.gmail.com>
2014-03-21 17:32                             ` Russell King - ARM Linux
2014-03-23 11:38                               ` Bernd Faust
2014-03-23 13:44                                 ` Russell King - ARM Linux
2014-03-24 17:57                               ` robert.daniels at vantagecontrols.com
2014-03-24 20:21                                 ` Marek Vasut
2014-03-24 22:37                                   ` robert.daniels at vantagecontrols.com
2014-03-24 23:44                                     ` Russell King - ARM Linux
2014-03-25  1:02                                       ` Marek Vasut
2014-03-25 23:10                                         ` Russell King - ARM Linux
2014-03-26  0:11                                       ` Russell King - ARM Linux
2014-04-01  9:26                                         ` Russell King - ARM Linux
2014-04-01 14:00                                           ` Eric Nelson
2014-04-01 17:29                                             ` Russell King - ARM Linux
2014-04-01 18:11                                               ` Eric Nelson
2014-04-02  2:26                                               ` fugang.duan at freescale.com
2014-04-01 19:38                                           ` robert.daniels at vantagecontrols.com
2014-04-01 22:51                                             ` Russell King - ARM Linux [this message]
2014-04-02  0:37                                               ` robert.daniels at vantagecontrols.com
2014-04-02  3:19                                               ` fugang.duan at freescale.com
2014-04-02  8:59                                                 ` Russell King - ARM Linux
2014-04-02  9:40                                                   ` fugang.duan at freescale.com
2014-04-02 10:46                                                     ` Russell King - ARM Linux
2014-04-02 11:33                                                       ` fugang.duan at freescale.com
2014-04-02 16:51                                                         ` Russell King - ARM Linux
2014-04-03  2:41                                                           ` fugang.duan at freescale.com
2014-04-03  8:56                                                             ` Russell King - ARM Linux
2014-04-03  9:55                                                               ` fugang.duan at freescale.com
2014-04-03 10:32                                                                 ` Russell King - ARM Linux
2014-04-03 13:36                                                                   ` Shawn Guo
2014-04-03 13:45                                                                     ` Russell King - ARM Linux
2014-04-03 14:00                                                                       ` Shawn Guo
2014-04-04 20:21                                               ` robert.daniels at vantagecontrols.com
2014-04-29  9:26                                                 ` Jaccon Bastiaansen
     [not found]                                                 ` <CAGzjT4d8H6YE6P6A1E4aHiPAenJFvZH01LHXaNzVwhF2MRBvWQ@mail.gmail.com>
2014-05-02 11:41                                                   ` Russell King - ARM Linux
2014-05-08  9:23                                                     ` Jaccon Bastiaansen
2014-03-21 15:50           ` PL310 errata workarounds Frank Li
2014-03-21 17:12             ` Russell King - ARM Linux
2014-03-17 16:32   ` Russell King - ARM Linux
2014-03-17 16:51     ` Russell King - ARM Linux

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=20140401225149.GC7528@n2100.arm.linux.org.uk \
    --to=linux@arm.linux.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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.