From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dl1-f50.google.com (mail-dl1-f50.google.com [74.125.82.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B10F3451047 for ; Wed, 21 Jan 2026 23:56:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769039821; cv=none; b=LpPVrT3iSH2xs1u1zUHdKoTlRpGlePsbbGC/LxJhxcsIV3UhFTdWZBRPv/ltn5F3vmIishVQeaZz9QWu9+Fw1WuvvlTvt2cg1V1q5h3z4gUFotWIgGGjkJCpizlRwthOoD+4q2MZRYizCAjQWzShEgMYmlK6Eca1VrfQbhJryo8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769039821; c=relaxed/simple; bh=SeCqNM8GWvX5mggx4Dkj2yTgrU7KsCaM5jxCJB7vXaA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=LnNive7g3M/LQD1B4tp3iTGucDliCqzdpENxHcELLUfpUrqn1m6soCCWwd0MGbGEarEGG1p1aywyY6bJMqRe1fRk6TzL/Cj08ZpEh3MZe3y/hD2JUR9nckJrxY7WZS/XrJjo+jik5ilSuzESi+e0XRxEh+bHoeF1o4QAhmcQBgw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=ft9/Dp86; arc=none smtp.client-ip=74.125.82.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ft9/Dp86" Received: by mail-dl1-f50.google.com with SMTP id a92af1059eb24-12448c4d404so445497c88.1 for ; Wed, 21 Jan 2026 15:56:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769039817; x=1769644617; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=jp0I2O5rvzmCmzT9e9dhaVxnINQFtm8fPyCPAakfKbA=; b=ft9/Dp86rVU7vchnIfAccFy6xz88bv1vzC07AdmLho+Rg2/nfdAZQ6KcYQ3D6l6/Jw T0ueosBtycoxEzWx+LB2NakaFmFVUFb/CP3K38lstAqBgOSvGt5nifn+2D96NyvFPzLz 2qkSM/3mq9xJ6lN37UKmEDKpLjEeO+n8i1NIKOY79CPsruWGW5nWArkKR7Yj7Yw+umG9 GZwrx7FcTkNu7Papsy3sWMJXJRoQn99IuMiYoIHPxEn37w8j8yv6vcJckKmpTWyKdIZS KmHabxjabvfhRL0JLIsAF0XnsvErv6OtQdaXdhueMcMLBSe5wXOr7LrT364lzESCIH43 MwnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769039817; x=1769644617; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=jp0I2O5rvzmCmzT9e9dhaVxnINQFtm8fPyCPAakfKbA=; b=sOChjGBWsYTUzGGCJnrXwpQyOlXqV2fNEdM3d8vd696al6HCx3MHEX/TNCPErib6o6 EdZA2E41VrXWyBVWTvrCGtQcrLdpGCG6ifFO921Vtmp/Usgni5IEOvwdRv9vK8o5EC0N 6wy6hbJmsgnHZ1P7pj/K1sEWNjTk4VqJY096XikeJO1IikmkXOriHkXT1gDKg9k1q8W/ aYoElRjdPl+pBDJX4GTls39SyoZIrBwcuEq3tp3Cm9p91FggR+cpniLtYXQ+DuMdamW6 LpLKJ+IQrB+TSVzVnurw5fKdfKADtn6/0duyHOUA/9oHZS4XrGmQtGClS2aUX4iZvC5r vC2Q== X-Forwarded-Encrypted: i=1; AJvYcCW0nC0klW4q04H9d/WPhi+hZMqN3lLQDLtu3RGO7Ws2uGbmTCRbTNuhY9+2hGO+mdsqy63I77mTuhDu@vger.kernel.org X-Gm-Message-State: AOJu0YxfU7xmLgXHzAJn6iTf6qjg6v8UZwdHvAmih0OupJYFcspGL3Hv gvRNB7GmNp63mmI+PyUXikprsiVkbu2t402metDLgURJ9CVYeoxIYPRr X-Gm-Gg: AZuq6aIJACucoJjcTO9pv2RBqpAuW75pMGRjs/BHvKw6qBJjneu8LPt0WScCbqSlmp8 7qs4ix58t7IE+G7IoQV3Pfy5D6ouZx6b967iHLscnbZbiV+fdr5rxf+Booxv+DFvuudqLXL/dey RaCb3JTvPhvGQ9L4wwYc7o6iK8aRLOmJJ4GfaXeAMBLAhHpqDbnYK+mjEIZon4Qpq4t6CXTijdA Wh/yvDt65CzBrJU9yT0y4120c6FahQ1Eq2zwH4E3VnrfIiG0NaTFE8VD2CxMl4tLk12ZLMI4W07 Dzz/Q/1pGOwPSg9HyPIXKOVR3JCSHCU4KklHdGS4VPBlu25C/Bk7adomzzCpF0rf21EH+gQwMGT MEPLkqA25tTyH2kdkm2J8WKOHCi/o65HgZFgvr7QFBM+bS8VMuLobh3M2JiDRddgd1MfgBeTTX5 Jx4qcxhNbu9w== X-Received: by 2002:a05:7022:4389:b0:122:33e:6d41 with SMTP id a92af1059eb24-1246aaac67cmr4335389c88.23.1769039816566; Wed, 21 Jan 2026 15:56:56 -0800 (PST) Received: from localhost ([2001:19f0:ac00:4eb8:5400:5ff:fe30:7df3]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1244ac5842csm27914226c88.1.2026.01.21.15.56.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jan 2026 15:56:56 -0800 (PST) Date: Thu, 22 Jan 2026 07:56:45 +0800 From: Inochi Amaoto To: "Russell King (Oracle)" , Inochi Amaoto Cc: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Yixun Lan , Maxime Coquelin , Alexandre Torgue , Richard Cochran , Paul Walmsley , Palmer Dabbelt , Albert Ou , Alexandre Ghiti , Yanteng Si , Yao Zi , Vladimir Oltean , Lad Prabhakar , Choong Yong Liang , Maxime Chevallier , Chen-Yu Tsai , Shangjuan Wei , Boon Khai Ng , Quentin Schulz , Giuseppe Cavallaro , Jose Abreu , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, Longbin Li Subject: Re: [PATCH net-next 3/3] net: stmmac: Add glue layer for Spacemit K3 SoC Message-ID: References: <20260120043609.910302-1-inochiama@gmail.com> <20260120043609.910302-4-inochiama@gmail.com> Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Jan 21, 2026 at 12:03:36PM +0000, Russell King (Oracle) wrote: > On Tue, Jan 20, 2026 at 01:05:39PM +0800, Inochi Amaoto wrote: > > > > + mask = RGMII_RX_DLINE_STEP | RGMII_TX_DLINE_CODE | RGMII_TX_DLINE_EN | > > > > + RGMII_TX_DLINE_STEP | RGMII_RX_DLINE_CODE | RGMII_RX_DLINE_EN; > > > > + val = FIELD_PREP(RGMII_TX_DLINE_CODE, tx_config) | > > > > + FIELD_PREP(RGMII_TX_DLINE_CODE, tx_code) | RGMII_TX_DLINE_EN | > > > > + FIELD_PREP(RGMII_TX_DLINE_CODE, rx_config) | > > > > + FIELD_PREP(RGMII_RX_DLINE_CODE, rx_code) | RGMII_RX_DLINE_EN; > > > > > > These FIELD_PREP() fields look wrong. Did you mean to use DLINE_CODE > > > both tx_config and tx_code, and did you mean to use TX_DLINE_CODE for > > > rx_config ? > > > > > > > This should be RGMII_TX_DLINE_CODE. This is a copy paste error, I > > will fix it. > > Are you sure? > > In that case, please change this to: > > val = FIELD_PREP(RGMII_TX_DLINE_CODE, tx_config | tx_code | > rx_config | rx_code) | > RGMII_TX_DLINE_EN | RGMII_RX_DLINE_EN; > > If that isn't what you meant, then your reply is wrong, and it seems > you're confused, which makes me then question how reliable your > replies are. > That's wrong, I think I have reply it in a wrong way, it should be RGMII_TX_DLINE_STEP -> tx_config RGMII_TX_DLINE_CODE -> tx_code RGMII_RX_DLINE_STEP -> rx_config RGMII_RX_DLINE_CODE -> rx_code The RGMII_[RX|TX]_DLINE_STEP register selects which step is used for rx/tx delay. The RGMII_[RX|TX]_DLINE_CODE register provides the factor used for calculating the delay. These register are computed in the spacemit_dwmac_detected_delay_value(). And finally we can got a delay with "code * step / 10 * 0.9" for both rx and tx. > > > > + plat_dat->clk_tx_i = devm_clk_get_enabled(&pdev->dev, "tx"); > > > > + if (IS_ERR(plat_dat->clk_tx_i)) > > > > + return dev_err_probe(&pdev->dev, PTR_ERR(plat_dat->clk_tx_i), > > > > + "failed to get tx clock\n"); > > > > > > You set plat_dat->clk_tx_i, but you don't point > > > plat_dat->set_clk_tx_rate at anything, which means the stmmac core > > > does nothing with this. > > > > > > > Yes, the vendor told me that the internal tx clock rate will be auto > > changed when the speed rate is changed. So no software interaction > > is needed. > > Please do not assign a clock to clk_tx_i that is not the dwmac > clk_tx_i input. clk_tx_i is a name used by the Synopsys DWMAC for a > specific clock. > > As you don't need to do anything with it other than to get and enable > it, consider using just a local variable here. > OK, I will use a local variable here. Regards, Inochi