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=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 0A326C6379D for ; Tue, 27 Oct 2020 15:58:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CA91220657 for ; Tue, 27 Oct 2020 15:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603814325; bh=yQ3Y1R0db0DuVskM0r//BVh3ASMhqaXU54hFmd+aZ3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=MFhFb0R6941SVwGGjrOs+J4BXrp8+c6aYiXl131dsMXf4/haLSze+gx+o9QNNITuD 4qA8B9/ozUY+fsIcS7fv26iHfvaenhhl5MHvThmUyeJySS5PnVByvOyoTe2P/2kDVf It2FGzRDB+uW09Ui4QfwWQBUsDHGknvoEVVa12y4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1782958AbgJ0P5A (ORCPT ); Tue, 27 Oct 2020 11:57:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:56864 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1796534AbgJ0PTP (ORCPT ); Tue, 27 Oct 2020 11:19:15 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 961832064B; Tue, 27 Oct 2020 15:19:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811955; bh=yQ3Y1R0db0DuVskM0r//BVh3ASMhqaXU54hFmd+aZ3g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GJpFgtZH94NzlP00JoWZ7GbQGAdLHxKhAQzDYmp/GO1IZK7vt3TFeDAhRwmGbI4nF 4mVtnkAZcnzaJxc8lNUTeHXdTDbNNARe9Cxj2Ute1pAr5uwIQTHjOhgz/IrvAYAd++ y37rHCHt1/aPdm/5Xwtz8VfZaiaLtnlAdQa1E7ds= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Andrew Lunn , Richard Leitner , Marek Vasut , Christoph Niedermaier , "David S. Miller" , NXP Linux Team , Shawn Guo , Jakub Kicinski Subject: [PATCH 5.9 010/757] net: fec: Fix PHY init after phy_reset_after_clk_enable() Date: Tue, 27 Oct 2020 14:44:20 +0100 Message-Id: <20201027135451.013356808@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Vasut [ Upstream commit 0da1ccbbefb662915228bc17e1c7d4ad28b3ddab ] 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. Fixes: 1b0a83ac04e3 ("net: fec: add phy_reset_after_clk_enable() support") Reviewed-by: Andrew Lunn Tested-by: Richard Leitner Signed-off-by: Marek Vasut Cc: Christoph Niedermaier Cc: David S. Miller Cc: NXP Linux Team Cc: Shawn Guo Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/freescale/fec_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) --- a/drivers/net/ethernet/freescale/fec_main.c +++ b/drivers/net/ethernet/freescale/fec_main.c @@ -3005,17 +3005,17 @@ fec_enet_open(struct net_device *ndev) /* Init MAC prior to mii bus probe */ fec_restart(ndev); - /* Probe and connect to PHY when open the interface */ - ret = fec_enet_mii_probe(ndev); - if (ret) - goto err_enet_mii_probe; - /* Call phy_reset_after_clk_enable() again if it failed during * phy_reset_after_clk_enable() before because the PHY wasn't probed. */ if (reset_again) fec_enet_phy_reset_after_clk_enable(ndev); + /* Probe and connect to PHY when open the interface */ + ret = fec_enet_mii_probe(ndev); + if (ret) + goto err_enet_mii_probe; + if (fep->quirks & FEC_QUIRK_ERR006687) imx6q_cpuidle_fec_irqs_used();