[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7f0107c6-ce31-4e1b-aad5-e7b21cdf0be3@lunn.ch>
Date: Tue, 18 Jul 2023 16:43:43 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Mengyuan Lou <mengyuanlou@...-swift.com>
Cc: netdev@...r.kernel.org
Subject: Re: [PATCH net-next v4] net: core: add member ncsi_enabled to
net_device
On Tue, Jul 18, 2023 at 10:20:57AM +0800, Mengyuan Lou wrote:
> Add flag ncsi_enabled to struct net_device indicating whether
> NCSI is enabled. Phy_suspend() will use it to decide whether PHY
> can be suspended or not.
>
> Signed-off-by: Mengyuan Lou <mengyuanlou@...-swift.com>
> ---
> drivers/net/phy/phy_device.c | 4 +++-
> include/linux/netdevice.h | 3 +++
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c
> index 2cad9cc3f6b8..6587b35071e9 100644
> --- a/drivers/net/phy/phy_device.c
> +++ b/drivers/net/phy/phy_device.c
> @@ -1859,7 +1859,9 @@ int phy_suspend(struct phy_device *phydev)
> return 0;
>
> phy_ethtool_get_wol(phydev, &wol);
> - phydev->wol_enabled = wol.wolopts || (netdev && netdev->wol_enabled);
> + phydev->wol_enabled = wol.wolopts ||
> + (netdev && netdev->wol_enabled) ||
> + (netdev && netdev->ncsi_enabled);
I don't really like this. phydev->wol_enabled no longer means
wol_enabled. Please rename phydev->wol_enabled to indicate that the
PHY should not be suspended because it is being used for something.
> /* If the device has WOL enabled, we cannot suspend the PHY */
> if (phydev->wol_enabled && !(phydrv->flags & PHY_ALWAYS_CALL_SUSPEND))
> return -EBUSY;
This comment also needs updating.
Andrew
Powered by blists - more mailing lists