All of lore.kernel.org
 help / color / mirror / Atom feed
From: Russell King <rmk+kernel@armlinux.org.uk>
To: Andrew Lunn <andrew@lunn.ch>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Ioana Ciornei <ioana.ciornei@nxp.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org,
	Alexandru Marginean <alexandru.marginean@nxp.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>,
	"michael@walle.cc" <michael@walle.cc>,
	"olteanv@gmail.com" <olteanv@gmail.com>,
	Vladimir Oltean <vladimir.oltean@nxp.com>,
	Jakub Kicinski <kuba@kernel.org>
Subject: [PATCH net-next 05/14] net: phylink: update PCS when changing interface during resolution
Date: Tue, 21 Jul 2020 12:04:05 +0100	[thread overview]
Message-ID: <E1jxq45-0004Rh-QB@rmk-PC.armlinux.org.uk> (raw)
In-Reply-To: <20200721110152.GY1551@shell.armlinux.org.uk>

The only PHYs that are used with phylink which change their interface
are the BCM84881 and MV88X3310 family, both of which only change their
interface modes on link-up events.  This will break when drivers are
converted to split-PCS.  Fix this.

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/phylink.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 1507ea8a9385..f1693ec63366 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -629,8 +629,15 @@ static void phylink_resolve(struct work_struct *w)
 				phylink_link_down(pl);
 				cur_link_state = false;
 			}
+			phylink_pcs_config(pl, false, &link_state);
+			pl->link_config.interface = link_state.interface;
+		} else {
+			/* The interface remains unchanged, only the speed,
+			 * duplex or pause settings have changed. Call the
+			 * old mac_config() method to configure the MAC/PCS.
+			 */
+			phylink_mac_config(pl, &link_state);
 		}
-		phylink_mac_config(pl, &link_state);
 	}
 
 	if (link_state.link != cur_link_state) {
-- 
2.20.1


  parent reply	other threads:[~2020-07-21 11:04 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21 11:01 [PATCH net-next 00/14] Phylink PCS updates Russell King - ARM Linux admin
2020-07-21 11:03 ` [PATCH net-next 01/14] net: phylink: update ethtool reporting for fixed-link modes Russell King
2020-07-21 11:03 ` [PATCH net-next 02/14] net: phylink: rejig link state tracking Russell King
2020-07-21 11:03 ` [PATCH net-next 03/14] net: phylink: rearrange resolve mac_config() call Russell King
2020-07-21 11:04 ` [PATCH net-next 04/14] net: phylink: ensure link is down when changing interface Russell King
2020-07-21 11:04 ` Russell King [this message]
2020-07-21 11:04 ` [PATCH net-next 06/14] net: phylink: avoid mac_config calls Russell King
2020-07-21 11:04 ` [PATCH net-next 07/14] net: phylink: simplify ksettings_set() implementation Russell King
2020-07-21 11:04 ` [PATCH net-next 08/14] net: phylink: simplify phy case for ksettings_set method Russell King
2020-07-21 11:04 ` [PATCH net-next 09/14] net: phylink: use config.an_enabled in " Russell King
2020-07-21 11:04 ` [PATCH net-next 10/14] net: phylink: simplify fixed-link case for " Russell King
2020-07-21 11:04 ` [PATCH net-next 11/14] net: phylink: in-band pause mode advertisement update for PCS Russell King
2020-07-21 11:04 ` [PATCH net-next 12/14] net: phylink: re-implement interface configuration with PCS Russell King
2020-07-21 11:04 ` [PATCH net-next 13/14] net: phylink: add struct phylink_pcs Russell King
2020-07-21 11:04 ` [PATCH net-next 14/14] net: phylink: add interface to configure clause 22 PCS PHY Russell King
2020-07-21 22:47 ` [PATCH net-next 00/14] Phylink PCS updates 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=E1jxq45-0004Rh-QB@rmk-PC.armlinux.org.uk \
    --to=rmk+kernel@armlinux.org.uk \
    --cc=alexandru.marginean@nxp.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=ioana.ciornei@nxp.com \
    --cc=kuba@kernel.org \
    --cc=michael@walle.cc \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vladimir.oltean@nxp.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.