Hi,

>> @@ -1964,7 +1966,7 @@ void stop_gfar(struct net_device *dev)
>>         /* disable ints and gracefully shut down Rx/Tx DMA */
>>         gfar_halt(priv);
>>
>> -       phy_stop(dev->phydev);
>> +       phylink_stop(priv->phylink);
>>
>>         free_skb_resources(priv);
>>  }
>> @@ -2219,12 +2221,7 @@ int startup_gfar(struct net_device *ndev)
>>         /* Start Rx/Tx DMA and enable the interrupts */
>>         gfar_start(priv);
>>
>> -       /* force link state update after mac reset */
>> -       priv->oldlink = 0;
>> -       priv->oldspeed = 0;
>> -       priv->oldduplex = -1;
>> -
>> -       phy_start(ndev->phydev);
>> +       phylink_start(priv->phylink);
>>
>>         enable_napi(priv);
>>
>> @@ -2593,7 +2590,7 @@ static int gfar_close(struct net_device *dev)
>>         stop_gfar(dev);
>>
>>         /* Disconnect from the PHY */
>> -       phy_disconnect(dev->phydev);
>> +       phylink_disconnect_phy(priv->phylink);
>
> It is very odd to disconnect from the PHY on ndo_close and connect
> back on ndo_open. I don't know of any other driver that does that.
> Can't you change the behavior to simply start and stop phylink here?

I surely can. But I've just looked at xilinx_axienet, mvneta, mvpp2, and stmmac,
and they all call phylink_stop() and phylink_disconnect_phy() in ndo_stop. What
do you think would justify such a change?

Reply via email to