Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2761416rdb; Fri, 8 Dec 2023 20:20:25 -0800 (PST) X-Google-Smtp-Source: AGHT+IF/aFS/1lmhYKgoXu4+TTEWwwdJvCRyeBJvdIQcZ9QyZIMnOaUqUvbDRsiPGXOG5/eysG3s X-Received: by 2002:a05:6a00:d76:b0:6ce:f665:ab1 with SMTP id n54-20020a056a000d7600b006cef6650ab1mr8129pfv.11.1702095624907; Fri, 08 Dec 2023 20:20:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702095624; cv=none; d=google.com; s=arc-20160816; b=erYV4M0IjU2VUSFQlFtdaMjSPKGfdXm2AWnGH81kFDYas/Zwsa48l9ChdLSqfKAST5 0zzQo9wD45WrhZQLQxWcxaW+XLeFBbBor7suLTcnL9Yt5YPJuXgwz4NptRxMRHpm5kWs V34MxCNPjhqW7LFZKfI2gLctpPvAWrm8jMAfeW9WAUfNJcOPaE8A7iLPHfci9XkTH018 LvwO3GJmXsVCUREvSeyhZFgJh/ywYFCJGhbYKBeUi47cDjBTQiNSo9qYPN8GiBK1wdL+ l1YbhFl3Pskzv/DaCJ6z6vzk7mAbe1DBJB3ga24PtnYtUg6VDIISHF3A00i9rl8bbX/9 PTdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=C2z39iC1zUW19f+EMaL0jcGu7aCnzVThTA+on4NLpkY=; fh=oUQXlm9N18NE8BciMxTG8yakJePvyLDL7KOQwgHv8WI=; b=pzMTM7DcDM4CcfJcw73vWPOqkMIaMlJUFJyHn8IRlNA3rKGFq0Pw04cyEJ2gIfbM9F QtvG3/kgVaRVPCHMKvmTO1YkiH84H6haSRpK9pkUU203+N848KYRueOmknv0+enLyWtl WoX3UCEDPHzO9GwVfE6L25Y/PKiv9N6sS1uLFLX/BoYxkmCgvE2OWGL//44IGSBL6g0+ HnX5sp9AJ60WDKUIqP881/xcIUOt4jLaLZazQY+I06JIRGA5JNwfHyEr8oizyG+M8Oe5 2CUlbQTG323EkvfpL+GlQQg2Won8aOax0XdT3RfuPuNLChotmzpjmPkVB3v82QsNnIlu z1Jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SZq+7p+N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id ct19-20020a056a000f9300b006ce36ffa533si2544929pfb.374.2023.12.08.20.20.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 20:20:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SZq+7p+N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 791E0820003E; Fri, 8 Dec 2023 20:20:22 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229868AbjLIEUK (ORCPT + 99 others); Fri, 8 Dec 2023 23:20:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229731AbjLIEUI (ORCPT ); Fri, 8 Dec 2023 23:20:08 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2F61E7 for ; Fri, 8 Dec 2023 20:20:12 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C8C7FC433C8; Sat, 9 Dec 2023 04:20:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702095612; bh=TdKoeYJCmyQ3JKD16K1s4NTFRZ9JYlkC3z82L25IMLk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SZq+7p+NKT2MXm0FV9mEvEHC6nMEhkB/wQW6MCdKZV0MpgZo+hJJdiR6SDe+wG56Z o95UHAJKMTANcMMg4g7KDlIhEkB3M1nrgHznj/2uQghQIrEwTwMei7n9+pJXcaZE8X D1sf9eBnbI7SmjIKgVJMxPNR87poc8/HAGwgiurxtN/kw97wsW6PckiDGBfr3kl2lV giLvCprU9zZlk25TzEfPGaWJWD5+0ooGkXlKyLjNJzDpDc+puDAeWlQB/Ylk28H9wZ Y1maZVajOiyHsmoPipm3viNTC+0JKXC3JRaKLt+M3sDkKEnoqi1JDWYwBYFnqUZrap x4IK5+QJl42sw== Date: Fri, 8 Dec 2023 20:24:44 -0800 From: Bjorn Andersson To: Sneh Shah Cc: Vinod Koul , Bhupesh Sharma , Alexandre Torgue , Jose Abreu , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , netdev@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel@quicinc.com, Andrew Halaney Subject: Re: [PATCH net v3] net: stmmac: update Rx clk divider for 10M SGMII Message-ID: <5luxwdjyzkg5o6w27mqixggr65ebosnn53vaqrbtsclfudet4v@kse23pgyj7ld> References: <20231208062502.13124-1-quic_snehshah@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231208062502.13124-1-quic_snehshah@quicinc.com> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Fri, 08 Dec 2023 20:20:22 -0800 (PST) On Fri, Dec 08, 2023 at 11:55:02AM +0530, Sneh Shah wrote: > SGMII 10MBPS mode needs RX clock divider to avoid drops in Rx. > Update configure SGMII function with rx clk divider programming. Are you trying saying that the RX clock is completely wrong in 10MBps mode? Or is the RX clock good, but without some division of some other clock signal you loose some packets now and then? Please write your commit message such that it describe the actual problem you're having. This will help others to know if this fix is applicable to some issue they are seeing on their hardware, now and in the future. > > Fixes: 463120c31c58 ("net: stmmac: dwmac-qcom-ethqos: add support for SGMII") > Signed-off-by: Sneh Shah > --- > v3 changelog: > - Added comment to explain why MAC needs to be reconfigured for SGMII > v2 changelog: > - Use FIELD_PREP to prepare bifield values in place of GENMASK > - Add fixes tag > --- > 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 d3bf42d0fceb..ab2245995bc6 100644 > --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-qcom-ethqos.c > @@ -34,6 +34,7 @@ > #define RGMII_CONFIG_LOOPBACK_EN BIT(2) > #define RGMII_CONFIG_PROG_SWAP BIT(1) > #define RGMII_CONFIG_DDR_MODE BIT(0) > +#define RGMII_CONFIG_SGMII_CLK_DVDR GENMASK(18, 10) This new bitfield overlaps with existing fields, is it the same register? Did the fields move? Is it applicable to all versions? What will existing writes to RGMII_IO_MACRO_CONFIG do to this new layout? What will the new write do to hardware with the existing field layout? > > /* SDCC_HC_REG_DLL_CONFIG fields */ > #define SDCC_DLL_CONFIG_DLL_RST BIT(30) > @@ -598,6 +599,9 @@ static int ethqos_configure_rgmii(struct qcom_ethqos *ethqos) > return 0; > } > > +/* On interface toggle MAC registetrs gets reset. > + * Configure MAC block for SGMII on ethernet phy link up > + */ > static int ethqos_configure_sgmii(struct qcom_ethqos *ethqos) > { > int val; > @@ -617,6 +621,9 @@ static int ethqos_configure_sgmii(struct qcom_ethqos *ethqos) > case SPEED_10: > val |= ETHQOS_MAC_CTRL_PORT_SEL; > val &= ~ETHQOS_MAC_CTRL_SPEED_MODE; > + rgmii_updatel(ethqos, RGMII_CONFIG_SGMII_CLK_DVDR, > + FIELD_PREP(RGMII_CONFIG_SGMII_CLK_DVDR, 0x31), Is this just a magic constant, or does 0x31 of some convenient unit? Could we give it name/define? Regards, Bjorn > + RGMII_IO_MACRO_CONFIG); > break; > } > > -- > 2.17.1 > >