* [PATCH net-next v2 0/2] net: phy: add and use helper phy_advertise_eee_all
@ 2024-02-03 19:47 Heiner Kallweit
2024-02-03 19:53 ` [PATCH net-next v2 1/2] net: phy: add " Heiner Kallweit
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Heiner Kallweit @ 2024-02-03 19:47 UTC (permalink / raw)
To: Andrew Lunn, Russell King - ARM Linux, Paolo Abeni,
Jakub Kicinski, Eric Dumazet, David Miller,
Realtek linux nic maintainers
Cc: netdev@vger.kernel.org
Per default phylib preserves the EEE advertising at the time of
phy probing. The EEE advertising can be changed from user space,
in addition this helper allows to set the EEE advertising to all
supported modes from drivers in kernel space.
v2:
- extend kernel doc description of new function
Heiner Kallweit (2):
net: phy: add helper phy_advertise_eee_all
r8169: use new helper phy_advertise_eee_all
drivers/net/ethernet/realtek/r8169_main.c | 3 +--
drivers/net/phy/phy_device.c | 6 +++++-
2 files changed, 6 insertions(+), 3 deletions(-)
--
2.43.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH net-next v2 1/2] net: phy: add helper phy_advertise_eee_all
2024-02-03 19:47 [PATCH net-next v2 0/2] net: phy: add and use helper phy_advertise_eee_all Heiner Kallweit
@ 2024-02-03 19:53 ` Heiner Kallweit
2024-02-03 20:35 ` Andrew Lunn
2024-02-03 19:54 ` [PATCH net-next v2 2/2] r8169: use new " Heiner Kallweit
2024-02-07 3:10 ` [PATCH net-next v2 0/2] net: phy: add and use " patchwork-bot+netdevbpf
2 siblings, 1 reply; 5+ messages in thread
From: Heiner Kallweit @ 2024-02-03 19:53 UTC (permalink / raw)
To: Andrew Lunn, Russell King - ARM Linux, Paolo Abeni,
Jakub Kicinski, Eric Dumazet, David Miller,
Realtek linux nic maintainers
Cc: netdev@vger.kernel.org
Per default phylib preserves the EEE advertising at the time of
phy probing. The EEE advertising can be changed from user space,
in addition this helper allows to set the EEE advertising to all
supported modes from drivers in kernel space.
Suggested-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
v2:
- extend kernel doc description of new function
---
drivers/net/phy/phy_device.c | 16 ++++++++++++++++
include/linux/phy.h | 1 +
2 files changed, 17 insertions(+)
diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
index dd778c7fd..dda5ece0d 100644
--- a/drivers/net/phy/phy_device.c
+++ b/drivers/net/phy/phy_device.c
@@ -2769,6 +2769,22 @@ void phy_advertise_supported(struct phy_device *phydev)
}
EXPORT_SYMBOL(phy_advertise_supported);
+/**
+ * phy_advertise_eee_all - Advertise all supported EEE modes
+ * @phydev: target phy_device struct
+ *
+ * Description: Per default phylib preserves the EEE advertising at the time of
+ * phy probing, which might be a subset of the supported EEE modes. Use this
+ * function when all supported EEE modes should be advertised. This does not
+ * trigger auto-negotiation, so must be called before phy_start()/
+ * phylink_start() which will start auto-negotiation.
+ */
+void phy_advertise_eee_all(struct phy_device *phydev)
+{
+ linkmode_copy(phydev->advertising_eee, phydev->supported_eee);
+}
+EXPORT_SYMBOL_GPL(phy_advertise_eee_all);
+
/**
* phy_support_sym_pause - Enable support of symmetrical pause
* @phydev: target phy_device struct
diff --git a/include/linux/phy.h b/include/linux/phy.h
index a66f07d3f..1343a4081 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -1960,6 +1960,7 @@ int phy_get_rate_matching(struct phy_device *phydev,
void phy_set_max_speed(struct phy_device *phydev, u32 max_speed);
void phy_remove_link_mode(struct phy_device *phydev, u32 link_mode);
void phy_advertise_supported(struct phy_device *phydev);
+void phy_advertise_eee_all(struct phy_device *phydev);
void phy_support_sym_pause(struct phy_device *phydev);
void phy_support_asym_pause(struct phy_device *phydev);
void phy_set_sym_pause(struct phy_device *phydev, bool rx, bool tx,
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH net-next v2 2/2] r8169: use new helper phy_advertise_eee_all
2024-02-03 19:47 [PATCH net-next v2 0/2] net: phy: add and use helper phy_advertise_eee_all Heiner Kallweit
2024-02-03 19:53 ` [PATCH net-next v2 1/2] net: phy: add " Heiner Kallweit
@ 2024-02-03 19:54 ` Heiner Kallweit
2024-02-07 3:10 ` [PATCH net-next v2 0/2] net: phy: add and use " patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: Heiner Kallweit @ 2024-02-03 19:54 UTC (permalink / raw)
To: Andrew Lunn, Russell King - ARM Linux, Paolo Abeni,
Jakub Kicinski, Eric Dumazet, David Miller,
Realtek linux nic maintainers
Cc: netdev@vger.kernel.org
Use new helper phy_advertise_eee_all() to simplify the code.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
---
drivers/net/ethernet/realtek/r8169_main.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/net/ethernet/realtek/r8169_main.c b/drivers/net/ethernet/realtek/r8169_main.c
index c70869539..b43db3c49 100644
--- a/drivers/net/ethernet/realtek/r8169_main.c
+++ b/drivers/net/ethernet/realtek/r8169_main.c
@@ -5091,8 +5091,7 @@ static int r8169_mdio_register(struct rtl8169_private *tp)
tp->phydev->mac_managed_pm = true;
if (rtl_supports_eee(tp))
- linkmode_copy(tp->phydev->advertising_eee,
- tp->phydev->supported_eee);
+ phy_advertise_eee_all(tp->phydev);
phy_support_asym_pause(tp->phydev);
/* PHY will be woken up in rtl_open() */
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2 1/2] net: phy: add helper phy_advertise_eee_all
2024-02-03 19:53 ` [PATCH net-next v2 1/2] net: phy: add " Heiner Kallweit
@ 2024-02-03 20:35 ` Andrew Lunn
0 siblings, 0 replies; 5+ messages in thread
From: Andrew Lunn @ 2024-02-03 20:35 UTC (permalink / raw)
To: Heiner Kallweit
Cc: Russell King - ARM Linux, Paolo Abeni, Jakub Kicinski,
Eric Dumazet, David Miller, Realtek linux nic maintainers,
netdev@vger.kernel.org
On Sat, Feb 03, 2024 at 08:53:15PM +0100, Heiner Kallweit wrote:
> Per default phylib preserves the EEE advertising at the time of
> phy probing. The EEE advertising can be changed from user space,
> in addition this helper allows to set the EEE advertising to all
> supported modes from drivers in kernel space.
>
> Suggested-by: Andrew Lunn <andrew@lunn.ch>
> Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net-next v2 0/2] net: phy: add and use helper phy_advertise_eee_all
2024-02-03 19:47 [PATCH net-next v2 0/2] net: phy: add and use helper phy_advertise_eee_all Heiner Kallweit
2024-02-03 19:53 ` [PATCH net-next v2 1/2] net: phy: add " Heiner Kallweit
2024-02-03 19:54 ` [PATCH net-next v2 2/2] r8169: use new " Heiner Kallweit
@ 2024-02-07 3:10 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-02-07 3:10 UTC (permalink / raw)
To: Heiner Kallweit
Cc: andrew, linux, pabeni, kuba, edumazet, davem, nic_swsd, netdev
Hello:
This series was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 3 Feb 2024 20:47:53 +0100 you wrote:
> Per default phylib preserves the EEE advertising at the time of
> phy probing. The EEE advertising can be changed from user space,
> in addition this helper allows to set the EEE advertising to all
> supported modes from drivers in kernel space.
>
> v2:
> - extend kernel doc description of new function
>
> [...]
Here is the summary with links:
- [net-next,v2,1/2] net: phy: add helper phy_advertise_eee_all
https://git.kernel.org/netdev/net-next/c/b64691274f5d
- [net-next,v2,2/2] r8169: use new helper phy_advertise_eee_all
https://git.kernel.org/netdev/net-next/c/7cc0187ea252
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-02-07 3:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-03 19:47 [PATCH net-next v2 0/2] net: phy: add and use helper phy_advertise_eee_all Heiner Kallweit
2024-02-03 19:53 ` [PATCH net-next v2 1/2] net: phy: add " Heiner Kallweit
2024-02-03 20:35 ` Andrew Lunn
2024-02-03 19:54 ` [PATCH net-next v2 2/2] r8169: use new " Heiner Kallweit
2024-02-07 3:10 ` [PATCH net-next v2 0/2] net: phy: add and use " patchwork-bot+netdevbpf
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).