Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3972741pxb; Tue, 25 Jan 2022 00:20:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJx/t8nQNnOycvwaKALNAB6/ZpQBDrvKP2NU/soq2DYfT6iIFiQKfaYhp9YJpQYYo99E2KUt X-Received: by 2002:a17:907:970d:: with SMTP id jg13mr9520921ejc.573.1643098835367; Tue, 25 Jan 2022 00:20:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643098835; cv=none; d=google.com; s=arc-20160816; b=WFto9T9j/wO1zidqLS0Nm7Gd6Z7i/qY9oEqqSgHO9mqltief8DnelyBDkC4eky84Fz w7fnVm9NdAmMyh3euUwzVdfQTbetVkb3JfdRLR1G4kBhL8deHKv0bhxsZxnYu3Tdmzfp Rye7EpM1P1LAX6jdT/vu3CmatXweSZIHfv2Iri23+3Lg/MTQDmRLvYqyqfR1ePQMkcI7 /dYeWeO2EIrEJrAjh0IBODq25M8tI2I8B+jerxpf67AflHTtXOdS0HMAAoDpjorwBhPa XzFy1P8XiNX50r6ZgbKc4LiNcpbcWyfPHWvtG67oYhUV3ciKPgE6h7zCo5iS6+Jy6c1+ gXeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6ktQHqSn0K6WCovESx+VZPtJLrCZ98Kruieyrs9ZoHk=; b=REOVksBf7a+bVYSkpEmgm5XetZME10khwzFKfR2cvSiK8F2/G0w9Wg/psB4wRAdSfn 59SIfXdCqdmDHFPRP7grOTcAZ97vF//2qLbgdAFANSkOBgCAoI6ltNgYO3dCSnHd1hlP zPx57cQFYJOlgYKxJzYBeGnUHOtgQAQezFCkgzflq75BhdBcza9a6dpkwYDSEIh4fQwh w4Bf3pC27js7leW8SkCvm2QmQUE47azatDR4XR/LqT7cdbq9jjoQe7Ik3JkoNHYBlNSU qtebHN5N/zYhd+ngvb0JV2nJWGFya24pepOdbcuKETc+RTwSJsOy9/Hd0dNwgkSJc9iM 3lBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Qbau/ox+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g17si9604164ejm.445.2022.01.25.00.20.10; Tue, 25 Jan 2022 00:20:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Qbau/ox+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S3411943AbiAYAfO (ORCPT + 99 others); Mon, 24 Jan 2022 19:35:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2364046AbiAXXqi (ORCPT ); Mon, 24 Jan 2022 18:46:38 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2CDADC0613A7; Mon, 24 Jan 2022 13:41:48 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DDB88B8105C; Mon, 24 Jan 2022 21:41:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08A12C340E4; Mon, 24 Jan 2022 21:41:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643060505; bh=+xKvTa4o3uapaDC5MbBlg9DwFPgbwt6w97UiymgDyMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Qbau/ox+x+9oAWI2Z2qOTLOi9gth4ZR6jh8swySEZpL2vd9kXEOH64QSJd+kZ/K1B Nxyevixh5w5B3RpvA07XWFSZef3Z9sOsVWu6VKI6RsiW4jfD4jkQHx9gJFyEeOLxmx rAmT1tYC6ePFWWcTjuyGhuHQnthxTtO6Kkk0bH5o= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Hancock , Andrew Lunn , "David S. Miller" Subject: [PATCH 5.16 0969/1039] net: axienet: reset core on initialization prior to MDIO access Date: Mon, 24 Jan 2022 19:45:58 +0100 Message-Id: <20220124184157.863231207@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184125.121143506@linuxfoundation.org> References: <20220124184125.121143506@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: Robert Hancock commit 04cc2da39698efd7eb2e30c112538922d26f848e upstream. In some cases where the Xilinx Ethernet core was used in 1000Base-X or SGMII modes, which use the internal PCS/PMA PHY, and the MGT transceiver clock source for the PCS was not running at the time the FPGA logic was loaded, the core would come up in a state where the PCS could not be found on the MDIO bus. To fix this, the Ethernet core (including the PCS) should be reset after enabling the clocks, prior to attempting to access the PCS using of_mdio_find_device. Fixes: 1a02556086fc (net: axienet: Properly handle PCS/PMA PHY for 1000BaseX mode) Signed-off-by: Robert Hancock Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 5 +++++ 1 file changed, 5 insertions(+) --- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c @@ -2089,6 +2089,11 @@ static int axienet_probe(struct platform lp->coalesce_count_rx = XAXIDMA_DFT_RX_THRESHOLD; lp->coalesce_count_tx = XAXIDMA_DFT_TX_THRESHOLD; + /* Reset core now that clocks are enabled, prior to accessing MDIO */ + ret = __axienet_device_reset(lp); + if (ret) + goto cleanup_clk; + lp->phy_node = of_parse_phandle(pdev->dev.of_node, "phy-handle", 0); if (lp->phy_node) { ret = axienet_mdio_setup(lp);