[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<174493419290.1021855.6916017022620646335.stgit@ahduyck-xeon-server.home.arpa>
Date: Thu, 17 Apr 2025 16:56:32 -0700
From: Alexander Duyck <alexander.duyck@...il.com>
To: linux@...linux.org.uk
Cc: netdev@...r.kernel.org, andrew@...n.ch, kuba@...nel.org
Subject: [RFC PATCH 2/2] net: phylink: Extend phylink_suspend to support a
"rolling stop"
From: Alexander Duyck <alexanderduyck@...com>
The fbnic driver has been abusing the wake-on-lan aspects of
phylink_suspend to leave the MAC up when the driver is unloaded or ifconfig
down is called.
Rather than rely on wake-on-lan we can use the rolling_start flag to
indicate that the device is prone to starting/stopping with the MAC link
up, and repurpose the mac_wol to indicate that we are requesting the
mac_link_up following the suspend.
Signed-off-by: Alexander Duyck <alexanderduyck@...com>
---
drivers/net/ethernet/meta/fbnic/fbnic_netdev.c | 5 -----
drivers/net/phy/phylink.c | 9 ++++++---
2 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c b/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c
index 79a01fdd1dd1..05793811569d 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_netdev.c
@@ -685,11 +685,6 @@ struct net_device *fbnic_netdev_alloc(struct fbnic_dev *fbd)
netdev->min_mtu = IPV6_MIN_MTU;
netdev->max_mtu = FBNIC_MAX_JUMBO_FRAME_SIZE - ETH_HLEN;
- /* TBD: This is workaround for BMC as phylink doesn't have support
- * for leavling the link enabled if a BMC is present.
- */
- netdev->ethtool->wol_enabled = true;
-
fbn->fec = FBNIC_FEC_AUTO | FBNIC_FEC_RS;
fbn->link_mode = FBNIC_LINK_AUTO | FBNIC_LINK_50R2;
netif_carrier_off(netdev);
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index 66cd866959ef..792f9d512765 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -2526,7 +2526,7 @@ EXPORT_SYMBOL_GPL(phylink_rx_clk_stop_unblock);
/**
* phylink_suspend() - handle a network device suspend event
* @pl: a pointer to a &struct phylink returned from phylink_create()
- * @mac_wol: true if the MAC needs to receive packets for Wake-on-Lan
+ * @mac_link_up: true if the MAC needs to receive packets after suspend
*
* Handle a network device suspend event. There are several cases:
*
@@ -2536,12 +2536,15 @@ EXPORT_SYMBOL_GPL(phylink_rx_clk_stop_unblock);
* can also bring down the link between the MAC and PHY.
* - If Wake-on-Lan is active, but being handled by the MAC, the MAC
* still needs to receive packets, so we can not bring the link down.
+ * - If rolling_start is requested, and the MAC is shared with a BMC, the MAC
+ * still needs to receive packets, so we can not bring the link down.
*/
-void phylink_suspend(struct phylink *pl, bool mac_wol)
+void phylink_suspend(struct phylink *pl, bool mac_link_up)
{
ASSERT_RTNL();
- if (mac_wol && (!pl->netdev || pl->netdev->ethtool->wol_enabled)) {
+ if (mac_link_up && (!pl->netdev || pl->netdev->ethtool->wol_enabled ||
+ pl->config->rolling_start)) {
/* Wake-on-Lan enabled, MAC handling */
mutex_lock(&pl->state_mutex);
Powered by blists - more mailing lists