netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Ethan Tuttle <ethan@ethantuttle.com>
Cc: netdev@vger.kernel.org
Subject: Re: [BUG] mvneta: mirabox ethernet only works if initialized by uboot
Date: Fri, 9 Aug 2013 09:50:40 +0200	[thread overview]
Message-ID: <20130809095040.46cd3dd8@skate> (raw)
In-Reply-To: <CACzLR4vv4kNVVkFx46jwcmB=hk_aT_XRrvU-Mpc0ZKdEQ-c_Fg@mail.gmail.com>

Dear Ethan Tuttle,

On Thu, 8 Aug 2013 22:31:37 -0700, Ethan Tuttle wrote:
> I ran into this issue after upgrading my mirabox from the old marvell
> kernel to 3.11-rc4.  Although ethernet interfaces are present, and
> 'link up' is reported, it isn't possible to send or receive packets.
> I'm using a vanilla kernel with .config from ArchLinuxARM[1].
> 
> Jochen De Smet posted a more detailed report[2] and a work-around on
> the Fedora ARM list: if an interface is started using the dhcp command
> in uboot, ethernet works in linux.
> 
> I reproduced the issue on -rc3 and -rc1 as well, so it isn't a recent
> regression.
> 
> It should be easy to reproduce on a mirabox, even when tftping a
> kernel: just try to use the other interface :).
> 
> Reporting here because I don't see any other reports to the
> maintainers.  I'm happy to provide more debug output or test patches
> if it will help.

This issue is well-known to me, but I unfortunately never had the time
to investigate it. I have a patch that makes it disappear, but I don't
think the patch is the right fix.

I don't have the Mirabox with me at the moment. If you're willing to
help, what would be nice would be to compare the values of the Ethernet
MAC registers and the values of the Ethernet PHY registers between the
working and non-working interfaces.

The reason I believe the patch is wrong is because the mvneta driver
uses the kernel phylib, and software based PHY polling, so it should be
the responsibility of the software to configure the PHY. However, what
the patch does is enable a feature of the hardware that makes it poll
and configure the PHY by itself automatically. While it looks nice, it
doesn't play nicely with the phylib framework of the kernel.

Best regards,

Thomas

The patch below:
==

This bit was missing, causing only the port initialized by u-boot
to work correctly.

Signed-off-by: Willy Tarreau <w@1wt.eu>
---
 drivers/net/ethernet/marvell/mvneta.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index c68481b..c006359 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -684,6 +684,9 @@ static void mvneta_port_up(struct mvneta_port *pp)
 	}
 
 	mvreg_write(pp, MVNETA_RXQ_CMD, q_map);
+
+	mvreg_write(pp, MVNETA_UNIT_CONTROL,
+	            mvreg_read(pp, MVNETA_UNIT_CONTROL) | MVNETA_PHY_POLLING_ENABLE);
 }
 
 /* Stop the Ethernet port activity */


Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

      reply	other threads:[~2013-08-09  7:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-09  5:31 [BUG] mvneta: mirabox ethernet only works if initialized by uboot Ethan Tuttle
2013-08-09  7:50 ` Thomas Petazzoni [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=20130809095040.46cd3dd8@skate \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=ethan@ethantuttle.com \
    --cc=netdev@vger.kernel.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 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).