Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3685250pxb; Mon, 24 Jan 2022 15:18:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNe99ogMuliTYrpR+JrZEPiNXb35O9KhjT6yPbJe9/GBsWHoyWxmztEB74RgTBmMXLZ/Kf X-Received: by 2002:a17:902:7fc4:b0:14a:9f3d:3358 with SMTP id t4-20020a1709027fc400b0014a9f3d3358mr16537562plb.165.1643066329389; Mon, 24 Jan 2022 15:18:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643066329; cv=none; d=google.com; s=arc-20160816; b=F+hXKCvCtACaxzcpqA3fBpHgS5JS+39BoMPK0rdntEdbjqiEk26PWFw9UXslJdhNM9 vWzKUVcg2zOwCx9gDCCNl8vP6fqnnjOPTZrc9qEdZ89oOLubFkryBNNmktkMpjO1XC1T oYXAPxXeLrfArCXjb3oyiiBNj9gHeyTEYwbqpx5WFd9dq3bWva/IW8hv80FIBiLv5cNO o2K+3dKb6WXlDRbITDBcy00+kAaIqY3R6ZIkFkRE3xJJR9FRnFJTT/uQY5ei6NTlpUBF bb+P3j0OuvMrof9guexokR6xo+McIysjSxzntQFKXsV68rm6WNA0odEioIHjnLxgt/Nz 2cxQ== 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=d8ojkgTc/gc8/yXxClLIOHOK5p8M2wRuFDSZ7xi/fOs=; b=p0YzPu/yT+B77Rb24jktVBZT8Wu9ovX5InI4CqPIZEMYQ7IOknhksV207bW5NFyMwC btl5335hA7OAoR1J/FwQ8UjYsXTFrAQpZpUzRYLIA3Bu10MkXZvmTVzn1o1AbBfYESPz HLP5k+NBpFuTFqCImerTR9ghIS+lFoCtwfhmtjER1Fif8JCk+0rIIunr3N9imL1+83vT ozriQ9HOtWOcvl7KUyAzK8qo2dpxhnJhXOLopCQbzjHgyEFoAlGLRPPIFnjpcmDPN3vv QuLugun2H/dPCrIpRWTwEi4SCvuACmkp5VXJHbP/Hw6xloS7HS8FJw622rRalAKiUpvQ oqpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="cmm8p/94"; 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 l190si10371658pgd.865.2022.01.24.15.18.37; Mon, 24 Jan 2022 15:18:49 -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="cmm8p/94"; 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 S1384465AbiAXXOq (ORCPT + 99 others); Mon, 24 Jan 2022 18:14:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37132 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1584585AbiAXWV3 (ORCPT ); Mon, 24 Jan 2022 17:21:29 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 77E9AC0424DE; Mon, 24 Jan 2022 12:51:20 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 1986260C3E; Mon, 24 Jan 2022 20:51:20 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F265AC340E5; Mon, 24 Jan 2022 20:51:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643057479; bh=uKmrqgjSA/5eJeqZdMw9hagnqck9mskx6h1Fw7fRqhA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cmm8p/94TW3mErVMalZBzvfpki0B0tN8nAgnOkw7i5RVjnhdFKe65qWG5QNqhI9u5 R3cDinLk/wfzkRPlXP9NdRYVUpq/4ji6tthKKpG473QpUpvFcKOa7RTisUiE1vOGGn KXu9p5bx0GorJt5SZtDnUwWVOFKSKKqyesYR7Haw= 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.15 793/846] net: axienet: reset core on initialization prior to MDIO access Date: Mon, 24 Jan 2022 19:45:10 +0100 Message-Id: <20220124184128.306481427@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124184100.867127425@linuxfoundation.org> References: <20220124184100.867127425@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 @@ -2091,6 +2091,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);