From: David Miller <davem@davemloft.net>
To: rmk+kernel@arm.linux.org.uk
Cc: andrew@lunn.ch, netdev@vger.kernel.org
Subject: Re: [PATCH] net: dsa: actually force the speed on the CPU port
Date: Sun, 20 Sep 2015 21:36:30 -0700 (PDT) [thread overview]
Message-ID: <20150920.213630.1367205638417597647.davem@davemloft.net> (raw)
In-Reply-To: <E1ZbSZE-0007KQ-HO@rmk-PC.arm.linux.org.uk>
From: Russell King <rmk+kernel@arm.linux.org.uk>
Date: Mon, 14 Sep 2015 13:09:04 +0100
> Commit 54d792f257c6 ("net: dsa: Centralise global and port setup
> code into mv88e6xxx.") merged in the 4.2 merge window broke the link
> speed forcing for the CPU port of Marvell DSA switches. The original
> code was:
>
> /* MAC Forcing register: don't force link, speed, duplex
> * or flow control state to any particular values on physical
> * ports, but force the CPU port and all DSA ports to 1000 Mb/s
> * full duplex.
> */
> if (dsa_is_cpu_port(ds, p) || ds->dsa_port_mask & (1 << p))
> REG_WRITE(addr, 0x01, 0x003e);
> else
> REG_WRITE(addr, 0x01, 0x0003);
>
> but the new code does a read-modify-write:
>
> reg = _mv88e6xxx_reg_read(ds, REG_PORT(port), PORT_PCS_CTRL);
> if (dsa_is_cpu_port(ds, port) ||
> ds->dsa_port_mask & (1 << port)) {
> reg |= PORT_PCS_CTRL_FORCE_LINK |
> PORT_PCS_CTRL_LINK_UP |
> PORT_PCS_CTRL_DUPLEX_FULL |
> PORT_PCS_CTRL_FORCE_DUPLEX;
> if (mv88e6xxx_6065_family(ds))
> reg |= PORT_PCS_CTRL_100;
> else
> reg |= PORT_PCS_CTRL_1000;
>
> The link speed in the PCS control register is a two bit field. Forcing
> the link speed in this way doesn't ensure that the bit field is set to
> the correct value - on the hardware I have here, the speed bitfield
> remains set to 0x03, resulting in the speed not being forced to gigabit.
>
> We must clear both bits before forcing the link speed.
>
> Fixes: 54d792f257c6 ("net: dsa: Centralise global and port setup code into mv88e6xxx.")
> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This code looks really different now in the current tree, can you
please respin?
Thanks.
next prev parent reply other threads:[~2015-09-21 4:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-14 12:09 [PATCH] net: dsa: actually force the speed on the CPU port Russell King
2015-09-21 4:36 ` David Miller [this message]
-- strict thread matches above, loose matches on Subject: below --
2015-09-21 20:42 Russell King
2015-09-22 1:18 ` Andrew Lunn
2015-09-23 0:19 ` 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=20150920.213630.1367205638417597647.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=andrew@lunn.ch \
--cc=netdev@vger.kernel.org \
--cc=rmk+kernel@arm.linux.org.uk \
/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).