* [PATCH net-next] net: phylink: tidy up disable bit clearing
@ 2021-11-30 14:49 Russell King
2021-11-30 15:44 ` Marek Behún
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Russell King @ 2021-11-30 14:49 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit; +Cc: David S. Miller, netdev, Jakub Kicinski
Tidy up the disable bit clearing where we clear a bit and the run the
link resolver.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
---
drivers/net/phy/phylink.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index eacbb0e6a24b..8e3861f09b4f 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -1090,6 +1090,12 @@ static void phylink_run_resolve_and_disable(struct phylink *pl, int bit)
}
}
+static void phylink_enable_and_run_resolve(struct phylink *pl, int bit)
+{
+ clear_bit(bit, &pl->phylink_disable_state);
+ phylink_run_resolve(pl);
+}
+
static void phylink_fixed_poll(struct timer_list *t)
{
struct phylink *pl = container_of(t, struct phylink, link_poll);
@@ -1574,8 +1580,7 @@ void phylink_start(struct phylink *pl)
*/
phylink_mac_initial_config(pl, true);
- clear_bit(PHYLINK_DISABLE_STOPPED, &pl->phylink_disable_state);
- phylink_run_resolve(pl);
+ phylink_enable_and_run_resolve(pl, PHYLINK_DISABLE_STOPPED);
if (pl->cfg_link_an_mode == MLO_AN_FIXED && pl->link_gpio) {
int irq = gpiod_to_irq(pl->link_gpio);
@@ -1715,8 +1720,7 @@ void phylink_resume(struct phylink *pl)
phylink_mac_initial_config(pl, true);
/* Re-enable and re-resolve the link parameters */
- clear_bit(PHYLINK_DISABLE_MAC_WOL, &pl->phylink_disable_state);
- phylink_run_resolve(pl);
+ phylink_enable_and_run_resolve(pl, PHYLINK_DISABLE_MAC_WOL);
} else {
phylink_start(pl);
}
@@ -2645,8 +2649,7 @@ static void phylink_sfp_link_up(void *upstream)
ASSERT_RTNL();
- clear_bit(PHYLINK_DISABLE_LINK, &pl->phylink_disable_state);
- phylink_run_resolve(pl);
+ phylink_enable_and_run_resolve(pl, PHYLINK_DISABLE_LINK);
}
/* The Broadcom BCM84881 in the Methode DM7052 is unable to provide a SGMII
--
2.30.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH net-next] net: phylink: tidy up disable bit clearing
2021-11-30 14:49 [PATCH net-next] net: phylink: tidy up disable bit clearing Russell King
@ 2021-11-30 15:44 ` Marek Behún
2021-11-30 15:51 ` Andrew Lunn
2021-12-02 3:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Marek Behún @ 2021-11-30 15:44 UTC (permalink / raw)
To: Russell King
Cc: Andrew Lunn, Heiner Kallweit, David S. Miller, netdev,
Jakub Kicinski
On Tue, 30 Nov 2021 14:49:41 +0000
Russell King <rmk+kernel@armlinux.org.uk> wrote:
> Tidy up the disable bit clearing where we clear a bit and the run the
> link resolver.
... and *then run ... ? But this is not important :)
Reviewed-by: Marek Behún <kabel@kernel.org>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH net-next] net: phylink: tidy up disable bit clearing
2021-11-30 14:49 [PATCH net-next] net: phylink: tidy up disable bit clearing Russell King
2021-11-30 15:44 ` Marek Behún
@ 2021-11-30 15:51 ` Andrew Lunn
2021-12-02 3:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: Andrew Lunn @ 2021-11-30 15:51 UTC (permalink / raw)
To: Russell King; +Cc: Heiner Kallweit, David S. Miller, netdev, Jakub Kicinski
On Tue, Nov 30, 2021 at 02:49:41PM +0000, Russell King wrote:
> Tidy up the disable bit clearing where we clear a bit and the run the
> link resolver.
>
> 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-next] net: phylink: tidy up disable bit clearing
2021-11-30 14:49 [PATCH net-next] net: phylink: tidy up disable bit clearing Russell King
2021-11-30 15:44 ` Marek Behún
2021-11-30 15:51 ` Andrew Lunn
@ 2021-12-02 3:20 ` patchwork-bot+netdevbpf
2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-12-02 3:20 UTC (permalink / raw)
To: Russell King; +Cc: andrew, hkallweit1, davem, netdev, kuba
Hello:
This patch was applied to netdev/net-next.git (master)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 30 Nov 2021 14:49:41 +0000 you wrote:
> Tidy up the disable bit clearing where we clear a bit and the run the
> link resolver.
>
> Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
> ---
> drivers/net/phy/phylink.c | 15 +++++++++------
> 1 file changed, 9 insertions(+), 6 deletions(-)
Here is the summary with links:
- [net-next] net: phylink: tidy up disable bit clearing
https://git.kernel.org/netdev/net-next/c/aa729c439441
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] 4+ messages in thread
end of thread, other threads:[~2021-12-02 3:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-30 14:49 [PATCH net-next] net: phylink: tidy up disable bit clearing Russell King
2021-11-30 15:44 ` Marek Behún
2021-11-30 15:51 ` Andrew Lunn
2021-12-02 3:20 ` 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).