Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1383158pxb; Thu, 24 Mar 2022 19:22:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRVsXqyt4IO+OboLgE0/F5VhS93wkkUqGq45Y7K+LTnfDVz94SwuJOhgVXcFp4E6S6AHWa X-Received: by 2002:a05:6a00:1acd:b0:4f7:c17b:28e5 with SMTP id f13-20020a056a001acd00b004f7c17b28e5mr8060843pfv.78.1648174943413; Thu, 24 Mar 2022 19:22:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648174943; cv=none; d=google.com; s=arc-20160816; b=RwUBbufWqauyfYXfGxLHDfPezhevDg5wTdWmU+5yq/4MfsXcc1Lpr+pnqFO4j0fWGK PiQ39sZ1t91dsVWuptqMsPA9G3GW7RTXlxucMjyD2KaOQj6aXiGBpvM6gz23qsMqQC68 BFzRDpn/tiVylMVH5AnvXPjZrI4e931xYDQeuMFFKS2ZlBqGTIY19TF0k4OFi5pMyeIx 1u/6oUCh73QLacKtbjwKo2kf+Srdpf8qlpoQ+zP68IhIOjACLogSMCAcblY/KzXdDOyA sj2tPq57Bv9cgQBGYA3OakaEYcXXy8ZkklUDAeL9yTtbZTR7UCsKR5mnhv6w+WBdakOv kmSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=Y7FIzF9vShJDyNSTAI9Bl+NsBsiiQpO5BNc3AiMxftk=; b=blpybz0mJbLTzIkzaM1ZgZjQ9EG0CggeEOogS2Ba5cur3VEVOLApbbM7L7Ud4GezaV UFgQ0hYnfEt9TzdGriQiKyMRWZZkZfJ9WOjgv00gAz/3icAJ+f45rO+JR72x17xIneTJ /13+oG4y2MaUoP1AFVl/ykvFAYm7LHJNZXAOfd0NPRv0g23+9tv1xiiV+EvdfubkT0Nz p3vTbSw8vlsLh/jkmj6fRNIh9iPvcy4b6WJXLYYHbhVHaDH4mtfja+YuMmXPqldX1wnu 8lprBsHHjOp4amFgd71IYPjOjLlPuVGWvmQHTUe3cdYxShiE9xrCRYTPQV9/AselrIRK 1nug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ySe6RJRC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hk2-20020a17090b224200b001c6570bf8cbsi1590989pjb.7.2022.03.24.19.22.09; Thu, 24 Mar 2022 19:22:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ySe6RJRC; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233759AbiCXJjz (ORCPT + 99 others); Thu, 24 Mar 2022 05:39:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242606AbiCXJjx (ORCPT ); Thu, 24 Mar 2022 05:39:53 -0400 Received: from mail-oa1-x33.google.com (mail-oa1-x33.google.com [IPv6:2001:4860:4864:20::33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E20B26101 for ; Thu, 24 Mar 2022 02:38:20 -0700 (PDT) Received: by mail-oa1-x33.google.com with SMTP id 586e51a60fabf-d6ca46da48so4379495fac.12 for ; Thu, 24 Mar 2022 02:38:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Y7FIzF9vShJDyNSTAI9Bl+NsBsiiQpO5BNc3AiMxftk=; b=ySe6RJRCAPeeLMB9SnC6/a97PstVNOtFinmQGKjn4YHaVL5NF/NRb1UE0H5QkUUNvC 0I4WCRX0oOxH9jch86Tf3ubEmYnn8Ogc5SVYD8hp0IBZ4AVOXnNZdjEXADL4uTErQS8Z hJIs38kB4wWnvCaRW2cNFiIa1GLWSUdlQNA2A7zJkUDRlVgcvEgckZ//dyLusfEbRDEK MzMiCFGieWDb974RyoZxZsC/zMu4JfHhA06g5iGNywzu+Ufqn5L3lgCBe5xaT9hWhtdI YRkdcexVpMd2wAN5ml3iEKn8lC9hd8ABjp9X4RKVsG6XT7ueMz6uJTsHF5iBikpCHu2j qiSA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y7FIzF9vShJDyNSTAI9Bl+NsBsiiQpO5BNc3AiMxftk=; b=5msR6oXAjLOl/VobW2924RNAFF+ScBhiGxO1JUhxppm+Yvxr87LhBNCgXz73q8W71a J5CNGj4cSBWNmZcLE1Q/jEBmEew/FaErZ5HKCGIpLWM1EOIz//DeoXFUf632fUONqbOb CZYvlznUg4nLr7l7EiiQA8VGCl7D07qANnoVPS3JO17WKKxBxUBk1lK14yMZ9gn4jpe5 WTduqJzvGM+SwpTEVk7cdYsn6sIVCKYrhAL9gET48dgHXrgyrh+vjBdWRmj5wDQ8QxTL 3fMGwqc15DeWLKdbDcGhRknZHE/lP1TZdzxaxsgfS/oyLhoSuiU5ycpWxI4nGmtZU6mi VpYw== X-Gm-Message-State: AOAM533yL3cC3fUk34OQrHo+Pki3N6YJaZ/ravCePeoS04kP9t87Kts+ zVmEKWkHPaZLX0mdBP+8w8BqUNNQx+Pd97pnky9SIklXTcU= X-Received: by 2002:a05:6870:3323:b0:de:282:34f0 with SMTP id x35-20020a056870332300b000de028234f0mr1941298oae.147.1648114699587; Thu, 24 Mar 2022 02:38:19 -0700 (PDT) MIME-Version: 1.0 References: <20220323033255.2282930-1-bjorn.andersson@linaro.org> In-Reply-To: <20220323033255.2282930-1-bjorn.andersson@linaro.org> From: Bhupesh Sharma Date: Thu, 24 Mar 2022 15:08:08 +0530 Message-ID: Subject: Re: [PATCH] net: stmmac: dwmac-qcom-ethqos: Enable RGMII functional clock on resume To: Bjorn Andersson Cc: Vinod Koul , Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, stable , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, 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 +Cc: stable tree as I think this is an important fix for stmmac dwmac-qcom-ethernet driver and affects ethernet functionality on QCOM boards which use this driver. More below.. On Wed, 23 Mar 2022 at 09:01, Bjorn Andersson wrote: > > When the Qualcomm ethqos driver is properly described in its associated > GDSC power-domain, the hardware will be powered down and loose its state > between qcom_ethqos_probe() and stmmac_init_dma_engine(). > > The result of this is that the functional clock from the RGMII IO macro > is no longer provides and the DMA software reset in dwmac4_dma_reset() > will time out, due to lacking clock signal. > > Re-enable the functional clock, as part of the Qualcomm specific clock > enablement sequence to avoid this problem. > > The final clock configuration will be adjusted by ethqos_fix_mac_speed() > once the link is being brought up. > > Fixes: a7c30e62d4b8 ("net: stmmac: Add driver for Qualcomm ethqos") > Signed-off-by: Bjorn Andersson > --- > drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > index 0cc28c79cc61..835caa15d55f 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > @@ -487,6 +487,13 @@ static int ethqos_clks_config(void *priv, bool enabled) > dev_err(ðqos->pdev->dev, "rgmii_clk enable failed\n"); > return ret; > } > + > + /* Enable functional clock to prevent DMA reset to timeout due > + * to lacking PHY clock after the hardware block has been power > + * cycled. The actual configuration will be adjusted once > + * ethqos_fix_mac_speed() is invoked. > + */ > + ethqos_set_func_clk_en(ethqos); > } else { > clk_disable_unprepare(ethqos->rgmii_clk); > } > -- > 2.33.1 Thanks for the catch, Bjorn. I tested this on the SA8155p-ADP board and the eth interface can be moved from 'on' to 'off' state and vice-versa properly after this change and we no longer need the EMAC GDSC quirk, so: Tested-and-Reviewed-by: Bhupesh Sharma Regards.