Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3116700pxm; Mon, 28 Feb 2022 12:22:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxRsMYNaxA65BgSwsVG3uKHe6aM4IAyljVX9fulZ1CakXgISy4k1H7ueLPk5HerI81wBrnO X-Received: by 2002:a17:902:be14:b0:14f:ce67:d0a1 with SMTP id r20-20020a170902be1400b0014fce67d0a1mr22034034pls.29.1646079735438; Mon, 28 Feb 2022 12:22:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646079735; cv=none; d=google.com; s=arc-20160816; b=mztrKe3qYLQXBFg4QV1WCENp3YzOoj1Sw3FH8yr1OBVYIL71S3jWyvQCHdmD7ITNma erfCRmV9mxc4Nzq8YKkhSdFa9nigntPC/1PGucXtrt6kmuwBfkyRMIr4n5cxp+MKRQb9 sCJXpv8lrc3Wh2KV+7dFF0h6WUG8yJ9auGUbAoJyrSkg9kSsst9r6JujlhJ0NZYM4MaV dgPcneivKZshLzPt2TpP7tG8BRjAIUgWDQdIXbmGE7HFa10cX7Ij4jevQMKES7OAGVfU swWkULd+595oG8tqRg87Xd1YtOn13ezf653gaowHw/vcWXXZK5W7t1JY7syQbLRX98WI t+aw== 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=WpL0aZoXAoOv+kfSt8BG5jAdC/Ats2X4EgEFx1d3M8E=; b=LFFCFsO2wxYVm6aDQUS/0Xih+VcNjGLEEUZM3wrZiHvsKHcs7mRjHPX1Qd4LzQsEXJ 0kZtBSSC+ezjpcVGipoOu0rnYG5nI4hDwoI6KvS7ypfhsU9DwslIUXYcPGMsvyxGe07L vhZj89obLOq8DOf4aMajjt4NSS2S6zeRb0PxD+FDu+6pl11DhC4rrM58Nw1yYUkFVKzi fWnNCd3tCvf+yeUFj/8fom1CW+z/E7oCaeuAeXSAQYAZiqLpcZrX+4CcPTkKCQD/N4YJ /bqUenwHi4InUTeFUw+bMExvyjm2WsiTeFmLX4XAcji+wjVwGuF3PnoWxNKiT+1MSsSh 2NKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ePZ7Gyi1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id i12-20020a6551cc000000b00378bc8830ebsi2201111pgq.644.2022.02.28.12.22.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Feb 2022 12:22:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ePZ7Gyi1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1: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: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AA4551C2F62; Mon, 28 Feb 2022 11:41:40 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240451AbiB1RyT (ORCPT + 99 others); Mon, 28 Feb 2022 12:54:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239046AbiB1RvA (ORCPT ); Mon, 28 Feb 2022 12:51:00 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ED9A8F639; Mon, 28 Feb 2022 09:39:14 -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 sin.source.kernel.org (Postfix) with ESMTPS id 07237CE17CB; Mon, 28 Feb 2022 17:39:13 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 296DEC340F4; Mon, 28 Feb 2022 17:39:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1646069951; bh=x3Ks4l3oF8qlXekP7bV+zF2mkX7O9rC2XCw9cam+juA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ePZ7Gyi1vTg0a0aK5WO/5fPR4QWc/UT6FVzPMzXRO4h7Jhc3HpVbtluiA2YuJVyKX m/ra5/frP1uZG8Ubr54vz9aAnB7pGSmkab33XtY2fwk1Py5Uk1aSOELjN5dm5S9HSx 2tWSgYm1JndmnRNXDzYqOJRxu9OZCTo6kYGGBRNU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Baruch Siach , Andrew Lunn , "David S. Miller" Subject: [PATCH 5.15 071/139] net: mdio-ipq4019: add delay after clock enable Date: Mon, 28 Feb 2022 18:24:05 +0100 Message-Id: <20220228172355.210584515@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220228172347.614588246@linuxfoundation.org> References: <20220228172347.614588246@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Baruch Siach commit b6ad6261d27708567b309fdb3102b12c42a070cc upstream. Experimentation shows that PHY detect might fail when the code attempts MDIO bus read immediately after clock enable. Add delay to stabilize the clock before bus access. PHY detect failure started to show after commit 7590fc6f80ac ("net: mdio: Demote probed message to debug print") that removed coincidental delay between clock enable and bus access. 10ms is meant to match the time it take to send the probed message over UART at 115200 bps. This might be a far overshoot. Fixes: 23a890d493e3 ("net: mdio: Add the reset function for IPQ MDIO driver") Signed-off-by: Baruch Siach Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/mdio/mdio-ipq4019.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) --- a/drivers/net/mdio/mdio-ipq4019.c +++ b/drivers/net/mdio/mdio-ipq4019.c @@ -200,7 +200,11 @@ static int ipq_mdio_reset(struct mii_bus if (ret) return ret; - return clk_prepare_enable(priv->mdio_clk); + ret = clk_prepare_enable(priv->mdio_clk); + if (ret == 0) + mdelay(10); + + return ret; } static int ipq4019_mdio_probe(struct platform_device *pdev)