* [PATCH] net: phylink: update to use phy_support_asym_pause()
@ 2019-11-15 20:05 Russell King
2019-11-15 20:07 ` Russell King - ARM Linux admin
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Russell King @ 2019-11-15 20:05 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Heiner Kallweit; +Cc: David S. Miller, netdev
Use phy_support_asym_pause() rather than open-coding it.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
drivers/net/phy/phylink.c | 15 ++++++---------
1 file changed, 6 insertions(+), 9 deletions(-)
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 2b70b4d50573..a68d664b65a3 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -697,11 +697,6 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy)
__ETHTOOL_DECLARE_LINK_MODE_MASK(supported);
int ret;
- memset(&config, 0, sizeof(config));
- linkmode_copy(supported, phy->supported);
- linkmode_copy(config.advertising, phy->advertising);
- config.interface = pl->link_config.interface;
-
/*
* This is the new way of dealing with flow control for PHYs,
* as described by Timur Tabi in commit 529ed1275263 ("net: phy:
@@ -709,10 +704,12 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy)
* using our validate call to the MAC, we rely upon the MAC
* clearing the bits from both supported and advertising fields.
*/
- if (phylink_test(supported, Pause))
- phylink_set(config.advertising, Pause);
- if (phylink_test(supported, Asym_Pause))
- phylink_set(config.advertising, Asym_Pause);
+ phy_support_asym_pause(phy);
+
+ memset(&config, 0, sizeof(config));
+ linkmode_copy(supported, phy->supported);
+ linkmode_copy(config.advertising, phy->advertising);
+ config.interface = pl->link_config.interface;
ret = phylink_validate(pl, supported, &config);
if (ret)
--
2.20.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] net: phylink: update to use phy_support_asym_pause()
2019-11-15 20:05 [PATCH] net: phylink: update to use phy_support_asym_pause() Russell King
@ 2019-11-15 20:07 ` Russell King - ARM Linux admin
2019-11-16 16:08 ` Andrew Lunn
2019-11-16 21:09 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux admin @ 2019-11-15 20:07 UTC (permalink / raw)
To: Andrew Lunn, Florian Fainelli, Heiner Kallweit; +Cc: David S. Miller, netdev
Forgetting the net-next tag again...
On Fri, Nov 15, 2019 at 08:05:45PM +0000, Russell King wrote:
> Use phy_support_asym_pause() rather than open-coding it.
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
> drivers/net/phy/phylink.c | 15 ++++++---------
> 1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
> index 2b70b4d50573..a68d664b65a3 100644
> --- a/drivers/net/phy/phylink.c
> +++ b/drivers/net/phy/phylink.c
> @@ -697,11 +697,6 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy)
> __ETHTOOL_DECLARE_LINK_MODE_MASK(supported);
> int ret;
>
> - memset(&config, 0, sizeof(config));
> - linkmode_copy(supported, phy->supported);
> - linkmode_copy(config.advertising, phy->advertising);
> - config.interface = pl->link_config.interface;
> -
> /*
> * This is the new way of dealing with flow control for PHYs,
> * as described by Timur Tabi in commit 529ed1275263 ("net: phy:
> @@ -709,10 +704,12 @@ static int phylink_bringup_phy(struct phylink *pl, struct phy_device *phy)
> * using our validate call to the MAC, we rely upon the MAC
> * clearing the bits from both supported and advertising fields.
> */
> - if (phylink_test(supported, Pause))
> - phylink_set(config.advertising, Pause);
> - if (phylink_test(supported, Asym_Pause))
> - phylink_set(config.advertising, Asym_Pause);
> + phy_support_asym_pause(phy);
> +
> + memset(&config, 0, sizeof(config));
> + linkmode_copy(supported, phy->supported);
> + linkmode_copy(config.advertising, phy->advertising);
> + config.interface = pl->link_config.interface;
>
> ret = phylink_validate(pl, supported, &config);
> if (ret)
> --
> 2.20.1
>
>
--
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] 4+ messages in thread
* Re: [PATCH] net: phylink: update to use phy_support_asym_pause()
2019-11-15 20:05 [PATCH] net: phylink: update to use phy_support_asym_pause() Russell King
2019-11-15 20:07 ` Russell King - ARM Linux admin
@ 2019-11-16 16:08 ` Andrew Lunn
2019-11-16 21:09 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2019-11-16 16:08 UTC (permalink / raw)
To: Russell King; +Cc: Florian Fainelli, Heiner Kallweit, David S. Miller, netdev
On Fri, Nov 15, 2019 at 08:05:45PM +0000, Russell King wrote:
> Use phy_support_asym_pause() rather than open-coding it.
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] net: phylink: update to use phy_support_asym_pause()
2019-11-15 20:05 [PATCH] net: phylink: update to use phy_support_asym_pause() Russell King
2019-11-15 20:07 ` Russell King - ARM Linux admin
2019-11-16 16:08 ` Andrew Lunn
@ 2019-11-16 21:09 ` David Miller
2 siblings, 0 replies; 4+ messages in thread
From: David Miller @ 2019-11-16 21:09 UTC (permalink / raw)
To: rmk+kernel; +Cc: andrew, f.fainelli, hkallweit1, netdev
From: Russell King <rmk+kernel@armlinux.org.uk>
Date: Fri, 15 Nov 2019 20:05:45 +0000
> Use phy_support_asym_pause() rather than open-coding it.
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Applied, thank you.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2019-11-16 21:09 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-15 20:05 [PATCH] net: phylink: update to use phy_support_asym_pause() Russell King
2019-11-15 20:07 ` Russell King - ARM Linux admin
2019-11-16 16:08 ` Andrew Lunn
2019-11-16 21:09 ` David Miller
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.