From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) (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 3402E22083 for ; Thu, 22 Jan 2026 00:27:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769041639; cv=none; b=LNSwrIkMmAuBZeHZQhP+wxxocxDa+F0/1BM3or1splk1V3xWBK/VX+AAj+J0KfarISNRsdZ2zr1lAl4SHIep3Ln4rfkLzZ5oF2iOvdc4oOwY6OH/JuoTSuhKNIhZw/xR80kRSDYfS7kn2CAfMWJko2U0tR2MClmomxbA1ochkmU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769041639; c=relaxed/simple; bh=wAtMZUK4FV7iRWMYfcVdkDkwpZkU2TSPElEoKPCQOFs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=L8exL2TRmdQpK5mOWHLR6jeMMh/YKLPkrXJnNEbc77tAv4gL+TlItsJXnZCjzIcvB8IpMmz4zRyG/mgBqJ4AIghA6LXElc/qLp89vf4OxK/wjCpJI0fmNoeMRVKAhne39phLHvAPTjw4o4UeDZwtqZF+mGHvvja8g+EvzYjjDGY= 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=JJFMAfVi; arc=none smtp.client-ip=209.85.217.48 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="JJFMAfVi" Received: by mail-vs1-f48.google.com with SMTP id ada2fe7eead31-5eb8f9be588so296737137.3 for ; Wed, 21 Jan 2026 16:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769041637; x=1769646437; 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=tzXSISnrF9gPuh5VrYor9F9pE35gc9wpvxNp6irLpQw=; b=JJFMAfVikNsNYnt10UjnbantUgb0MCDYmnsl72W8oh4Pua0bsE7f3H0GCmpF3Eqf1B FsSEbOQeg0t+2pHKjNxsPmi8nR8HKyKgsye0Lf6IU2hkmQ9WuwduwCF6CHegeHKEk1Qk a4HCC6LIOhFhNex85+8UJ1BeDWm59s7HlZSvYy+u2c0UjWffaBovMDDfgo7oCWqRNido V+NzCjXu4RJjiDPxT2f0RaU6ZvfbjSoO3qzEoIC4yAmu/velnFLL4O+Uo8ox2/51Ou5U rsNTd54uXxJtnr/VOC1RaVzudwomjIVgP50QsNqq4k0JY17aUX4b7hTlnc63D/9LS9fg JS8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769041637; x=1769646437; 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=tzXSISnrF9gPuh5VrYor9F9pE35gc9wpvxNp6irLpQw=; b=iVtZWCMOl4zExs5Gc12EqDAevReNXPdkfUi8jmJ9MMschLI8NDAHaz5Y0x1vAFWgE6 K+4/8u3544u53fwC5fa6sKqcjAze86F6rsCSrepqNsxNt+d4LviHTN0r4zEeFgpTdcUg Y9SlrSp/GFttRScWWvLuk9c0ErHbFwGjHd+pJ7MITj31psoKRVKrSb+Yuc6GiarK3rHG PgfjVEWsWmhG00jMFxXDld05ZUikXkQJoYoAKC1FBg0/iLpI5Vd1PHeo8Mmatjw+jIeH G0w/XuFcG9QIOv4S75af60Sg6Jun9ZVjgMCo+PqLPSOUX+WL7d16E/B8E6+3zU0NArtQ kZHA== X-Forwarded-Encrypted: i=1; AJvYcCVeZTxu1vrHCsaWLMEyZsPwz+8w/XwFCi72tYuznDZTrO7vTqchhft031DmJjF/ibTYXTnHNHuwlmWm/iY=@vger.kernel.org X-Gm-Message-State: AOJu0YytRvlzbMcgjU1egOT9P3qkTwU2HTf85/iw1Nnmd/6C8VdrM1Qp JvYuVKzd9MUWbYqqiO+A97Uc66v3wxmV1xnImTRWkQljRj7zGACO0vZn X-Gm-Gg: AZuq6aLrCL7TvYG7+R/W7OdmKJk7n58c6NyEQ4hl/HuPyxYOHHT3orj/xhCy1Cpeo1f f6I4m4lJmkX7VTUhPgbs+rBUUosLxhu9lV95V578VMZ65iEfcwtNthaNXqf6rJqkACl0gq7Tooc ht1+xAYCyPki1PjVc5qzY5bKE28rh9EClenxo467pC6AILSze14cjxsJ6xzlHTefHZWv7a4j+9C XGxNCD9U+26/P6eeg1f0UTLiZKOeZ1zzAvAQoB/GvmRZ6GkpdjU2f6fJSChVOKveLT4o2/4gT2M HwCWc6YZM2OrxX3ieN6KQcfqMPbD/XWwcqDW8SWGhZx5IOCJoyh1pgH61u9Go3soAuaBrSqJfcy x+sxkRwrcovEFuwHeX8GpOkPMZ7VDpJb4jalQ3ZJ3NIJMRZm8TAp6il+q1AyTDBHht9M4VjUGqQ smEg8I1JHcHA== X-Received: by 2002:a05:7300:bc08:b0:2ae:5470:2e61 with SMTP id 5a478bee46e88-2b6b46c68e2mr15434088eec.2.1769034989298; Wed, 21 Jan 2026 14:36:29 -0800 (PST) Received: from localhost ([2001:19f0:ac00:4eb8:5400:5ff:fe30:7df3]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b6b3503a30sm25165715eec.13.2026.01.21.14.36.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Jan 2026 14:36:28 -0800 (PST) Date: Thu, 22 Jan 2026 06:36:18 +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: linux-kernel@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. Regards, Inochi > > > > + 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. > > -- > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!