All of lore.kernel.org
 help / color / mirror / Atom feed
From: arno@natisbad.org (Arnaud Ebalard)
To: Stas Sergeev <stsp@list.ru>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org,
	Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
	Florian Fainelli <f.fainelli@gmail.com>
Subject: Re: [BUG,BISECTED] mvneta: second interface no more usable on mirabox
Date: Wed, 17 Jun 2015 01:05:24 +0200	[thread overview]
Message-ID: <874mm71cgb.fsf@natisbad.org> (raw)
In-Reply-To: <5580A4C3.1020509@list.ru> (Stas Sergeev's message of "Wed, 17 Jun 2015 01:35:47 +0300")

Hi,

Stas Sergeev <stsp@list.ru> writes:

> 17.06.2015 00:44, Arnaud Ebalard пишет:
>> Hi,
>>
>> On Mirabox, the second ethernet interface is no more usable on 4.1-rc*
>> series (no packets coming out of the interface, when using dhclient for
>> instance). It works as expected on 4.0.
>>
>> Bisecting the issue, I ended up on 898b2970e2c9 ("mvneta: implement
>> SGMII-based in-band link state signaling"). Reverting that commit gives
>> me back the second interface.
>>
>> Then, I also tested on a NETGEAR ReadyNAS 104, which is also powered by
>> the same SoC (Armada 370) and also has two (mvneta-supported) ethernet
>> interfaces. With an unmodified 4.1-rc8, only one of the two interfaces
>> is available. Reverting 898b2970e2c9 makes both usable again.
>>
>> FWIW, mirabox and RN104 ethernet interfaces use RGMII.
> Hi, hope someone who can reproduce the problem,
> can provide a better help.
> I looked into a patch, and it seems most things are done
> under "if (pp->use_inband_status)", which is not your case.

Looking at the patch, yes. Both platforms I have which encounter the
problem use RGMII and "if (pp->use_inband_status)" changes are for
SGMII.

> But it seems the patch can still change a couple of flags
> for you, and maybe that makes a problem?

AFAICT, autoneg config register (MVNETA_GMAC_AUTONEG_CONFIG) is
modified. And the logic when link status changes is also modified:
 - MVNETA_GMAC_FORCE_LINK_DOWN flag cleared when there is carrier. It was
   previously set when that event occured.
 - The link down event logic is also modified.

>
> Please try the attached (absolutely untested) patch.
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index ce5f7f9..74176ec 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -1013,6 +1013,12 @@ static void mvneta_defaults_set(struct mvneta_port *pp)
>  		val = mvreg_read(pp, MVNETA_GMAC_CLOCK_DIVIDER);
>  		val |= MVNETA_GMAC_1MS_CLOCK_ENABLE;
>  		mvreg_write(pp, MVNETA_GMAC_CLOCK_DIVIDER, val);
> +	} else {
> +		val = mvreg_read(pp, MVNETA_GMAC_AUTONEG_CONFIG);
> +		val &= ~(MVNETA_GMAC_INBAND_AN_ENABLE |
> +		       MVNETA_GMAC_AN_SPEED_EN |
> +		       MVNETA_GMAC_AN_DUPLEX_EN);
> +		mvreg_write(pp, MVNETA_GMAC_AUTONEG_CONFIG, val);
>  	}
>  
>  	mvneta_set_ucast_table(pp, -1);

*Second interface is back w/ that patch applied*. Cannot tell if it is a
 proper fix, though or a valid workaround.

Thanks for your feedback.

a+

  parent reply	other threads:[~2015-06-16 23:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-16 21:44 [BUG,BISECTED] mvneta: second interface no more usable on mirabox Arnaud Ebalard
     [not found] ` <5580A4C3.1020509@list.ru>
2015-06-16 23:05   ` Arnaud Ebalard [this message]
2015-06-17 13:24     ` Stas Sergeev

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=874mm71cgb.fsf@natisbad.org \
    --to=arno@natisbad.org \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=stsp@list.ru \
    --cc=thomas.petazzoni@free-electrons.com \
    /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.