From: Florian Fainelli <f.fainelli@gmail.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, linux-kernel@vger.kernel.org, mxs@sbrk.org,
arno@natisbad.org, stsp@users.sourceforge.net,
devicetree@vger.kernel.org, thomas.petazzoni@free-electrons.com,
Florian Fainelli <f.fainelli@gmail.com>
Subject: [PATCH net v5 1/4] net: dsa: bcm_sf2: Do not override speed settings
Date: Mon, 20 Jul 2015 17:49:55 -0700 [thread overview]
Message-ID: <1437439798-12622-2-git-send-email-f.fainelli@gmail.com> (raw)
In-Reply-To: <1437439798-12622-1-git-send-email-f.fainelli@gmail.com>
The SF2 driver currently overrides speed settings for its port
configured using a fixed PHY, this is both unnecessary and incorrect,
because we keep feedback to the hardware parameters that we read from
the PHY device, which in the case of a fixed PHY cannot possibly change
speed.
This is a required change to allow the fixed PHY code to allow
registering a PHY with a link configured as DOWN by default and avoid
some sort of circular dependency where we require the link_update
callback to run to program the hardware, and we then utilize the fixed
PHY parameters to program the hardware with the same settings.
Fixes: 246d7f773c13 ("net: dsa: add Broadcom SF2 switch driver")
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
drivers/net/dsa/bcm_sf2.c | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
index 972982f8bea7..3297604f8216 100644
--- a/drivers/net/dsa/bcm_sf2.c
+++ b/drivers/net/dsa/bcm_sf2.c
@@ -890,15 +890,11 @@ static void bcm_sf2_sw_fixed_link_update(struct dsa_switch *ds, int port,
struct fixed_phy_status *status)
{
struct bcm_sf2_priv *priv = ds_to_priv(ds);
- u32 duplex, pause, speed;
+ u32 duplex, pause;
u32 reg;
duplex = core_readl(priv, CORE_DUPSTS);
pause = core_readl(priv, CORE_PAUSESTS);
- speed = core_readl(priv, CORE_SPDSTS);
-
- speed >>= (port * SPDSTS_SHIFT);
- speed &= SPDSTS_MASK;
status->link = 0;
@@ -933,18 +929,6 @@ static void bcm_sf2_sw_fixed_link_update(struct dsa_switch *ds, int port,
reg &= ~LINK_STS;
core_writel(priv, reg, CORE_STS_OVERRIDE_GMIIP_PORT(port));
- switch (speed) {
- case SPDSTS_10:
- status->speed = SPEED_10;
- break;
- case SPDSTS_100:
- status->speed = SPEED_100;
- break;
- case SPDSTS_1000:
- status->speed = SPEED_1000;
- break;
- }
-
if ((pause & (1 << port)) &&
(pause & (1 << (port + PAUSESTS_TX_PAUSE_SHIFT)))) {
status->asym_pause = 1;
--
2.1.0
next prev parent reply other threads:[~2015-07-21 0:49 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-21 0:49 [PATCH net v5 0/4] net: enable inband link state negotiation only when explicitly requested Florian Fainelli
2015-07-21 0:49 ` Florian Fainelli [this message]
2015-07-21 0:49 ` [PATCH net v5 2/4] net: phy: fixed_phy: handle link-down case Florian Fainelli
2015-07-21 0:49 ` [PATCH net v5 3/4] of_mdio: add new DT property 'managed' to specify the PHY management type Florian Fainelli
2015-07-21 0:49 ` [PATCH net v5 4/4] mvneta: use inband status only when explicitly enabled Florian Fainelli
2015-07-21 11:17 ` [PATCH net v5 0/4] net: enable inband link state negotiation only when explicitly requested Stas Sergeev
2015-07-21 20:18 ` Arnaud Ebalard
[not found] ` <1437439798-12622-1-git-send-email-f.fainelli-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-07-21 23:13 ` 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=1437439798-12622-2-git-send-email-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=arno@natisbad.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mxs@sbrk.org \
--cc=netdev@vger.kernel.org \
--cc=stsp@users.sourceforge.net \
--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 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).