From: Andrew Lunn <andrew@lunn.ch>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: David Miller <davem@davemloft.net>,
netdev <netdev@vger.kernel.org>,
Vivien Didelot <vivien.didelot@gmail.com>
Subject: Re: [PATCH net-next 2/2] net: dsa: mv88e6xxx: Set link down when changing speed
Date: Mon, 23 Mar 2020 23:39:34 +0100 [thread overview]
Message-ID: <20200323223934.GA14512@lunn.ch> (raw)
In-Reply-To: <20200323220113.GX25745@shell.armlinux.org.uk>
On Mon, Mar 23, 2020 at 10:01:13PM +0000, Russell King - ARM Linux admin wrote:
> On Mon, Mar 23, 2020 at 10:49:00PM +0100, Andrew Lunn wrote:
> > The MAC control register must not be changed unless the link is down.
> > Add the necassary call into mv88e6xxx_mac_link_up. Without it, the MAC
> > does not change state, the link remains at the wrong speed.
> >
> > Fixes: 30c4a5b0aad8 ("net: mv88e6xxx: use resolved link config in mac_link_up()")
> > Signed-off-by: Andrew Lunn <andrew@lunn.ch>
> > ---
> > drivers/net/dsa/mv88e6xxx/chip.c | 8 ++++++++
> > 1 file changed, 8 insertions(+)
> >
> > diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c
> > index dd8a5666a584..24ce17503950 100644
> > --- a/drivers/net/dsa/mv88e6xxx/chip.c
> > +++ b/drivers/net/dsa/mv88e6xxx/chip.c
> > @@ -733,6 +733,14 @@ static void mv88e6xxx_mac_link_up(struct dsa_switch *ds, int port,
> >
> > mv88e6xxx_reg_lock(chip);
> > if (!mv88e6xxx_port_ppu_updates(chip, port) || mode == MLO_AN_FIXED) {
> > + /* Port's MAC control must not be changed unless the
> > + * link is down
> > + */
> > + err = chip->info->ops->port_set_link(chip, port,
> > + LINK_FORCED_DOWN);
> > + if (err)
> > + goto error;
> > +
>
> The port should be down at this point, otherwise the link state is not
> matching phylink's idea of the state. Your patch merely works around
> that. I think it needs solving properly.
Hi Russell
So the problem here is that CPU and DSA ports should default to up and
at their fastest speed. During setup, the driver is setting the CPU
port to 1G and up. Later on, phylink finds the fixed-link node in DT,
and then sets the port to 100Mbps as requested.
How do you suggest fixing this? If we find a fixed-link, configure it
first down and then up?
Andrew
next prev parent reply other threads:[~2020-03-23 22:39 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-23 21:48 [PATCH net-next 0/2] mv88e6xxx fixed link fixes Andrew Lunn
2020-03-23 21:48 ` [PATCH net-next 1/2] net: dsa: mv88e6xxx: Configure MAC when using fixed link Andrew Lunn
2020-03-23 21:49 ` [PATCH net-next 2/2] net: dsa: mv88e6xxx: Set link down when changing speed Andrew Lunn
2020-03-23 22:01 ` Russell King - ARM Linux admin
2020-03-23 22:39 ` Andrew Lunn [this message]
2020-03-27 11:13 ` Russell King - ARM Linux admin
2020-03-27 21:26 ` Andrew Lunn
2020-03-27 21:48 ` Russell King - ARM Linux admin
2020-03-27 2:57 ` [PATCH net-next 0/2] mv88e6xxx fixed link fixes David Miller
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=20200323223934.GA14512@lunn.ch \
--to=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@gmail.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 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).