From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6201CC3A5AA for ; Wed, 4 Sep 2019 13:59:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 407942339D for ; Wed, 4 Sep 2019 13:59:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730477AbfIDN7Y (ORCPT ); Wed, 4 Sep 2019 09:59:24 -0400 Received: from ispman.iskranet.ru ([62.213.33.10]:39234 "EHLO ispman.iskranet.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730245AbfIDN7X (ORCPT ); Wed, 4 Sep 2019 09:59:23 -0400 Received: by ispman.iskranet.ru (Postfix, from userid 8) id DC574821822; Wed, 4 Sep 2019 20:53:40 +0700 (KRAT) Received: from KB016249 (unknown [62.213.40.60]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ispman.iskranet.ru (Postfix) with ESMTPS id 36513821822; Wed, 4 Sep 2019 20:53:40 +0700 (KRAT) From: Arseny Solokha To: Vladimir Oltean Cc: Claudiu Manoil , Russell King , Ioana Ciornei , Andrew Lunn , netdev , Florian Fainelli Subject: Re: [RFC PATCH 1/2] gianfar: convert to phylink References: <20190723151702.14430-1-asolokha@kb.kras.ru> <20190723151702.14430-2-asolokha@kb.kras.ru> Date: Wed, 04 Sep 2019 20:53:38 +0700 Message-ID: <87k1aop3q5.fsf@kb.kras.ru> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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?