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=-4.0 required=3.0 tests=BAYES_00, 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 F2A1FC004C1 for ; Thu, 3 Sep 2020 21:00:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D4919206C0 for ; Thu, 3 Sep 2020 21:00:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728134AbgICVAO (ORCPT ); Thu, 3 Sep 2020 17:00:14 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:41422 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726489AbgICVAO (ORCPT ); Thu, 3 Sep 2020 17:00:14 -0400 Received: from andrew by vps0.lunn.ch with local (Exim 4.94) (envelope-from ) id 1kDwL5-00D6Xq-2q; Thu, 03 Sep 2020 23:00:11 +0200 Date: Thu, 3 Sep 2020 23:00:11 +0200 From: Andrew Lunn To: Marek Vasut Cc: netdev@vger.kernel.org, Christoph Niedermaier , "David S . Miller" , NXP Linux Team , Richard Leitner , Shawn Guo Subject: Re: [PATCH] net: fec: Fix PHY init after phy_reset_after_clk_enable() Message-ID: <20200903210011.GD3112546@lunn.ch> References: <20200903202712.143878-1-marex@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200903202712.143878-1-marex@denx.de> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Thu, Sep 03, 2020 at 10:27:12PM +0200, Marek Vasut wrote: > The phy_reset_after_clk_enable() does a PHY reset, which means the PHY > loses its register settings. The fec_enet_mii_probe() starts the PHY > and does the necessary calls to configure the PHY via PHY framework, > and loads the correct register settings into the PHY. Therefore, > fec_enet_mii_probe() should be called only after the PHY has been > reset, not before as it is now. I think this patch is related to what Florian is currently doing with PHY clocks. I think a better fix for the original problem is for the SMSC PHY driver to control the clock itself. If it clk_prepare_enables() the clock, it knows it will not be shut off again by the FEC run time power management. All this phy_reset_after_clk_enable() can then go away. Andrew