From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-vs1-f54.google.com (mail-vs1-f54.google.com [209.85.217.54]) (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 ED7B227B327 for ; Thu, 22 Jan 2026 00:19:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.217.54 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769041142; cv=none; b=Y6YG8VZNdWXxm8tX4YlFzCNNzipJpsVeO8WQb5h10MN5rcy1Ga1Cpg5MYRn2Ao3pK83olqDEO3WFoHME6ch17myAwPSQijRlzqY7SXXvr86DXARXEijlcI5VM8M8HWrmU6//XhfBo775bOkFmiJhysIW8cOjogtnjTRlHAcUVKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769041142; c=relaxed/simple; bh=wAtMZUK4FV7iRWMYfcVdkDkwpZkU2TSPElEoKPCQOFs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ngzbF7U6X4mhucUW2I+3RmdJcqZvhTT13jY/mhT1WyYLE+xEClo6/rKaTeHqJd76qKIQejl2qQusZzVVlqNREBx4zteBIBnu4KEOWjK9sRi9C6VPiSBKonJcyyEtethTiQL+1QvAtaDwO4EFS1+CLz3QMBTiVsfPY4AIbC7/9Dc= 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=V7IIWcPX; arc=none smtp.client-ip=209.85.217.54 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="V7IIWcPX" Received: by mail-vs1-f54.google.com with SMTP id ada2fe7eead31-5ed065f1007so245413137.1 for ; Wed, 21 Jan 2026 16:19:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1769041140; x=1769645940; 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=V7IIWcPX0D/G24B3lrbd8j/I/4eqS5ToJJ0Xd+pEYTv5P1/Qzmzapb4IIVMi1uw6nl 1z35kBZ2v/YVeUDhBqZyCbYlzeK7rGyL8DUOKHLkMVgVLxrsSLTZ1DqWqGjkhZhhRBBT w9IRKS8fhaylF4i4AhHn5eloyQp34W83cts2/wBLqjN6n5My7lV/7+ddJMCGNBBEg/3B 2u8uzSjnxm/0VGI6sjaDsSkDpS36qy/TmxQjF90N5P4ZfbJNWJS6DB7UD8zO8ujipMiG 69FXNKKXVNiM5RKBp/OOsn8bufHK7tkXKyUu1FwieQ1Ub+RgSoY/Kv9osA2UCR68Idoo ITkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769041140; x=1769645940; 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=dWdXG3dJtiYU2J8vnNPkzBgoHXKM5kcfS69IZf/jIw2rfp66ZGgskGH8HO6dNHFWla MoSnWBoNX8nZuvAkXhdL9uaFMGY9DjHG2mDQqJnHz8gz3URi94JXUzVpPz389LgHKfAU MUcIEc5rbtcdqaDjjecAsUcpYQRSNGampHv5rXdYDtYVEEqJiIaaq80JelSceW59C7R6 ueidqyLIL1wvPQhyZAmPfUWghtTeP34Fwk07CjQCyafjdp4ltWLQFvn+JvzF+RTVWODf b0rq+HBCpWSnfK7a19dMMuBSZJ0vXRd22es1c3Qftv3/lb2PTDdRG6RT0yNr9J/4ET9j RkBQ== X-Forwarded-Encrypted: i=1; AJvYcCVh2RBWqgK5HcTOIWCaFaJSp8s4hqHbUz3ppMzmGhGhTWmW8CrAuqPrvUQ9jznLqYiG7YrUVRY=@vger.kernel.org X-Gm-Message-State: AOJu0YxcfakfTgFvEeXpq9tBJsntwL6L7SMfXlrwlFwe/09KECtvQ8Sc xgBQ5mKAVtLnLAxde+i85NAvm3VAoFCi2swcYxPgPXZZ21wyDcM1dPI9HzoFeGHI X-Gm-Gg: AZuq6aJJw5pXDm34F8Ddfneh1OTJicT67G4tBaMEFeiBUDPyp0pIFVVs2b/zBmOFl7D n7j5SCqs4ci5NaWIcw9OrsIKN7UuLJt8X+ubvhnI9Y/F1HsBKYzWOkLbfGvUjM5GPq3guUsmLqa UwflpSm0Wf1lWyTpoaz57WvrDBQzFRQP5FMRqvjzZMq2O0vchXPjrAECKQq6t5uievwJBR5ZlHu fEle+zCdO/0H8EenLNNcHX6MAlU88Em8Bt7XyWeev95w01jxjjBYQTQ5nLkT2HY7GnS1PRXx4Pl OjnOcCSnmCPtAoJQ4g4pT7qXKRh8+vDgkbgDKO9WZB0Qt1tGc4M59wc39U9pDcC7ry08kME/3HE 0G/L5elsgEyUKdrTvN04AlcnrNF9zHd0FKZNKMduzT1f41KJjj+cRRpTPD8OjhN/9gHtIHQehRh Kesi38OhKEpg== 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: netdev@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!