diff mbox series

[RFC,net-next,06/13] net: phylink: avoid mac_config calls

Message ID E1jqHFt-0006P7-Ed@rmk-PC.armlinux.org.uk
State RFC
Delegated to: David Miller
Headers show
Series Phylink PCS updates | expand

Commit Message

Russell King June 30, 2020, 2:29 p.m. UTC
Avoid calling mac_config() when using split PCS, and the interface
remains the same.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
 drivers/net/phy/phylink.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Florian Fainelli June 30, 2020, 7:04 p.m. UTC | #1
On 6/30/2020 7:29 AM, Russell King wrote:
> Avoid calling mac_config() when using split PCS, and the interface
> remains the same.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
diff mbox series

Patch

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index f1693ec63366..424a927d7889 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -631,10 +631,12 @@  static void phylink_resolve(struct work_struct *w)
 			}
 			phylink_pcs_config(pl, false, &link_state);
 			pl->link_config.interface = link_state.interface;
-		} else {
+		} else if (!pl->pcs_ops) {
 			/* The interface remains unchanged, only the speed,
 			 * duplex or pause settings have changed. Call the
-			 * old mac_config() method to configure the MAC/PCS.
+			 * old mac_config() method to configure the MAC/PCS
+			 * only if we do not have a PCS installed (an
+			 * unconverted user.)
 			 */
 			phylink_mac_config(pl, &link_state);
 		}