[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200521151916.GC677363@lunn.ch>
Date: Thu, 21 May 2020 17:19:16 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Daniel González Cabanelas <dgcbueu@...il.com>
Cc: netdev@...r.kernel.org, davem@...emloft.net,
thomas.petazzoni@...tlin.com,
Russell King <rmk+kernel@...linux.org.uk>
Subject: Re: [PATCH] net: mvneta: only do WoL speed down if the PHY is valid
> drivers/net/ethernet/marvell/mvneta.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
> index 41d2a0eac..f9170bc93 100644
> --- a/drivers/net/ethernet/marvell/mvneta.c
> +++ b/drivers/net/ethernet/marvell/mvneta.c
> @@ -3567,8 +3567,9 @@ static void mvneta_start_dev(struct mvneta_port *pp)
>
> phylink_start(pp->phylink);
>
> - /* We may have called phy_speed_down before */
> - phy_speed_up(pp->dev->phydev);
> + if(pp->dev->phydev)
> + /* We may have called phy_speed_down before */
> + phy_speed_up(pp->dev->phydev);
I don't think it is as simple as this. You should not really be mixing
phy_ and phylink_ calls within one driver. You might of noticed there
are no other phy_ calls in this driver. So ideally you want to add
phylink_ calls which do the right thing.
Andrew
Powered by blists - more mailing lists