From: 李志 <lizhi2@eswincomputing.com>
To: "Jakub Kicinski" <kuba@kernel.org>, andrew+netdev@lunn.ch
Cc: devicetree@vger.kernel.org, davem@davemloft.net,
edumazet@google.com, robh@kernel.org, krzk+dt@kernel.org,
conor+dt@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com,
mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com,
rmk+kernel@armlinux.org.uk, pjw@kernel.org, palmer@dabbelt.com,
aou@eecs.berkeley.edu, alex@ghiti.fr,
linux-riscv@lists.infradead.org,
linux-stm32@st-md-mailman.stormreply.com,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, maxime.chevallier@bootlin.com,
ningyu@eswincomputing.com, linmin@eswincomputing.com,
pinkesh.vaghela@einfochips.com, pritesh.patel@einfochips.com,
weishangjuan@eswincomputing.com, horms@kernel.org
Subject: Re: Re: [PATCH net-next v7 2/4] net: stmmac: eic7700: enable clocks before syscon access and correct RX sampling timing
Date: Thu, 30 Apr 2026 14:43:50 +0800 (GMT+08:00) [thread overview]
Message-ID: <2117464.7991.19ddd2125d1.Coremail.lizhi2@eswincomputing.com> (raw)
In-Reply-To: <20260428180625.738223cf@kernel.org>
> -----原始邮件-----
> 发件人: "Jakub Kicinski" <kuba@kernel.org>
> 发送时间:2026-04-29 09:06:25 (星期三)
> 收件人: lizhi2@eswincomputing.com
> 抄送: devicetree@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, mcoquelin.stm32@gmail.com, alexandre.torgue@foss.st.com, rmk+kernel@armlinux.org.uk, pjw@kernel.org, palmer@dabbelt.com, aou@eecs.berkeley.edu, alex@ghiti.fr, linux-riscv@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, maxime.chevallier@bootlin.com, ningyu@eswincomputing.com, linmin@eswincomputing.com, pinkesh.vaghela@einfochips.com, pritesh.patel@einfochips.com, weishangjuan@eswincomputing.com, horms@kernel.org
> 主题: Re: [PATCH net-next v7 2/4] net: stmmac: eic7700: enable clocks before syscon access and correct RX sampling timing
>
>
> Why Fixes? If eth1 never worked this is not a fix but new functionality
> If you want to make this a fix to prevent incompatibility - cut it down
> just to the eth0 changes.
>
Thank you for the suggestion.
You're right that eth1 never worked at Gigabit speed, so this should
not be treated as a fix.
In v8, I will split the changes into two patches within the same series:
- Patch 1 will contain only the fixes affecting the existing eth0
functionality, and will keep the Fixes tag.
- Patch 2 will add the eth1 support (RX clock inversion workaround)
as new functionality, without a Fixes tag.
Please let me know if you would prefer a different split or ordering.
>
> AI says:
>
> The step unit is being silently changed from 0.1 ns (delay_ps / 100)
> to 0.02 ns (delay_ps / 20). The same DT value now programs 5x the number
> of delay steps into the hardware.
>
This change is intentional. The previous driver used an incorrect
conversion (100ps per step), while the actual hardware step is 20ps.
This patch corrects the delay calculation to match the hardware.
The DT binding is updated accordingly to reflect the correct
20ps granularity and enforce valid values.
This binding has not yet been used in any upstream DTS, so there
are no in-tree users relying on the previous behavior.
I will clarify this explicitly in the v8 commit message.
>
> AI says
>
> In the default case this logs "invalid speed %u" but then falls
> through and still executes the regmap_write() with the base dly_param. An
> unsupported speed reports an error and reprograms the hardware anyway.
>
> Should the default path return without writing, or should the write be
> moved into the valid cases only?
>
The default case should not reprogram any hardware registers.
I will change the implementation so that register writes are only
performed for valid speeds (SPEED_10/100/1000). For unsupported
speeds, the function will only log the error and return without
any side effects.
>
> AI says:
>
> First, rx-internal-delay-ps and tx-internal-delay-ps are silently
> demoted from required to optional. The previous driver returned
> -EINVAL with "missing required property ..." when either was absent;
> the else branches have been removed, so missing properties now leave
> eth_clk_dly_param at zero and fix_mac_speed() programs zero delay
> without diagnostic. Is this intentional, and if so should the commit
> message and the DT binding reflect it?
>
> Second, the previous code silently clamped out-of-range values via
> min() and only required non-zero step units by integer truncation.
> The new code rejects non-multiples of 20 and values greater than 2540
> ps with -EINVAL at probe time. DTBs that previously probed with
> clamped delays will now fail probe. Should this stricter validation
> also be called out in the commit message?
>
Yes, this change is intentional.
The previous implementation used incorrect delay semantics
(100ps step and implicit clamping), which does not match the
actual hardware behavior.
The new implementation corrects the hardware programming to use
the real 20ps step granularity and enforces valid ranges.
Regarding the DT binding change (required → optional) and the
stricter validation, this is also intentional. Zero delay is a
valid hardware configuration, and the stricter checks are added
to avoid silently masking invalid values.
Importantly, this binding has not been used by any upstream DTS
yet, so there are no in-tree users affected by this change.
I will explicitly document both the semantic change and the
compatibility notes in the v8 commit message and update the
binding description accordingly.
>
> AI says:
>
> The eswin,hsp-sp-csr phandle-args layout is expanded from 4 cells
> (phandle + 3 offsets) to 6 cells (phandle + 5 offsets), with new
> indices 3/4/5 now required. Any DTB produced against the original
> ea77dbbdbc4e binding will fail probe here with -EINVAL.
The previous phandle-args layout (4 cells) was based on an
incomplete initial design and did not fully describe all required
hardware register offsets.
The updated 6-cell format reflects the complete hardware CSR layout
and allows explicit configuration of additional control registers.
Importantly, this binding has not been used by any upstream DTS,
so there are no in-tree users affected by this change.
I agree that this is a DT ABI change, and I will explicitly document
the compatibility impact and updated binding description in the v8
series to make this clear.
next prev parent reply other threads:[~2026-04-30 6:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 7:23 [PATCH net-next v7 0/4] net: stmmac: eic7700: fix EIC7700 eth1 RX sampling timing lizhi2
2026-04-27 7:24 ` [PATCH net-next v7 1/4] dt-bindings: ethernet: eswin: add clock sampling control lizhi2
2026-04-29 1:28 ` Andrew Lunn
2026-04-27 7:25 ` [PATCH net-next v7 2/4] net: stmmac: eic7700: enable clocks before syscon access and correct RX sampling timing lizhi2
2026-04-29 1:06 ` Jakub Kicinski
2026-04-30 6:43 ` 李志 [this message]
2026-04-27 7:25 ` [PATCH net-next v7 3/4] dt-bindings: mfd: syscon: add ESWIN EIC7700 compatible lizhi2
2026-04-27 19:05 ` Conor Dooley
2026-04-27 7:26 ` [PATCH net-next v7 4/4] riscv: dts: eswin: eic7700-hifive-premier-p550: enable Ethernet controller lizhi2
2026-04-29 1:41 ` Andrew Lunn
2026-04-30 7:05 ` 李志
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2117464.7991.19ddd2125d1.Coremail.lizhi2@eswincomputing.com \
--to=lizhi2@eswincomputing.com \
--cc=alex@ghiti.fr \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=aou@eecs.berkeley.edu \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linmin@eswincomputing.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=maxime.chevallier@bootlin.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=ningyu@eswincomputing.com \
--cc=pabeni@redhat.com \
--cc=palmer@dabbelt.com \
--cc=pinkesh.vaghela@einfochips.com \
--cc=pjw@kernel.org \
--cc=pritesh.patel@einfochips.com \
--cc=rmk+kernel@armlinux.org.uk \
--cc=robh@kernel.org \
--cc=weishangjuan@eswincomputing.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox