netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: phylink: ensure consistent phy interface mode
@ 2019-05-28  9:27 Russell King
  2019-05-31 13:02 ` Andrew Lunn
  0 siblings, 1 reply; 3+ messages in thread
From: Russell King @ 2019-05-28  9:27 UTC (permalink / raw)
  To: David S. Miller; +Cc: Andrew Lunn, Florian Fainelli, Heiner Kallweit, netdev

Ensure that we supply the same phy interface mode to mac_link_down() as
we did for the corresponding mac_link_up() call.  This ensures that MAC
drivers that use the phy interface mode in these methods can depend on
mac_link_down() always corresponding to a mac_link_up() call for the
same interface mode.

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

diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 74983593834b..9044b95d2afe 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -51,6 +51,10 @@ struct phylink {
 
 	/* The link configuration settings */
 	struct phylink_link_state link_config;
+
+	/* The current settings */
+	phy_interface_t cur_interface;
+
 	struct gpio_desc *link_gpio;
 	struct timer_list link_poll;
 	void (*get_fixed_state)(struct net_device *dev,
@@ -446,12 +450,12 @@ static void phylink_resolve(struct work_struct *w)
 		if (!link_state.link) {
 			netif_carrier_off(ndev);
 			pl->ops->mac_link_down(ndev, pl->link_an_mode,
-					       pl->phy_state.interface);
+					       pl->cur_interface);
 			netdev_info(ndev, "Link is Down\n");
 		} else {
+			pl->cur_interface = link_state.interface;
 			pl->ops->mac_link_up(ndev, pl->link_an_mode,
-					     pl->phy_state.interface,
-					     pl->phydev);
+					     pl->cur_interface, pl->phydev);
 
 			netif_carrier_on(ndev);
 
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: phylink: ensure consistent phy interface mode
  2019-05-28  9:27 [PATCH net] net: phylink: ensure consistent phy interface mode Russell King
@ 2019-05-31 13:02 ` Andrew Lunn
  2019-05-31 13:25   ` Russell King - ARM Linux admin
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2019-05-31 13:02 UTC (permalink / raw)
  To: Russell King; +Cc: David S. Miller, Florian Fainelli, Heiner Kallweit, netdev

On Tue, May 28, 2019 at 10:27:21AM +0100, Russell King wrote:
> Ensure that we supply the same phy interface mode to mac_link_down() as
> we did for the corresponding mac_link_up() call.  This ensures that MAC
> drivers that use the phy interface mode in these methods can depend on
> mac_link_down() always corresponding to a mac_link_up() call for the
> same interface mode.
> 
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>

Reviewed-by: Andrew Lunn <andrew@lunn.ch>

    Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: phylink: ensure consistent phy interface mode
  2019-05-31 13:02 ` Andrew Lunn
@ 2019-05-31 13:25   ` Russell King - ARM Linux admin
  0 siblings, 0 replies; 3+ messages in thread
From: Russell King - ARM Linux admin @ 2019-05-31 13:25 UTC (permalink / raw)
  To: Andrew Lunn; +Cc: David S. Miller, Florian Fainelli, Heiner Kallweit, netdev

On Fri, May 31, 2019 at 03:02:26PM +0200, Andrew Lunn wrote:
> On Tue, May 28, 2019 at 10:27:21AM +0100, Russell King wrote:
> > Ensure that we supply the same phy interface mode to mac_link_down() as
> > we did for the corresponding mac_link_up() call.  This ensures that MAC
> > drivers that use the phy interface mode in these methods can depend on
> > mac_link_down() always corresponding to a mac_link_up() call for the
> > same interface mode.
> > 
> > Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> 
> Reviewed-by: Andrew Lunn <andrew@lunn.ch>

Hi Andrew,

davem already applied this patch a couple of days ago, since it is a
dependency for other patches.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-31 13:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-28  9:27 [PATCH net] net: phylink: ensure consistent phy interface mode Russell King
2019-05-31 13:02 ` Andrew Lunn
2019-05-31 13:25   ` Russell King - ARM Linux admin

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).