From: netdev-bot+sashiko@kernel.org
To: jjc@jclark.com
Cc: andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org,
kuba@kernel.org, pabeni@redhat.com, richardcochran@gmail.com,
robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
s-vadapalli@ti.com, rogerq@kernel.org, bigeasy@linutronix.de,
martin.kaistra@linutronix.de, vadim.fedorenko@linux.dev,
r-sharma3@ti.com, robertcnelson@gmail.com, horms@kernel.org,
nm@ti.com, vigneshr@ti.com, netdev@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH net-next v3 2/3] net: ethernet: ti: am65-cpts: wait after each event FIFO pop
Date: Thu, 03 Dec 2026 02:45:44 +0000 [thread overview]
Message-ID: <179626594448.3146.5046422925015545198@kernel.org> (raw)
In-Reply-To: <11860c23c6bf9e54dfb10715615641aab8415ee1.1796179313.git.jjc@jclark.com>
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.
Low priority / nit picks for your consideration:
- [Low] Commit "net: ethernet: ti: am65-cpts: wait after each event FIFO
pop" fixes a CPTS TRM timing violation that has been in the driver…
--
net: ethernet: ti: am65-cpts: wait after each event FIFO pop
This commit adds a register read-back and a 100 ns delay after each
EVENT_POP write in am65_cpts_fifo_pop_event(). The TRM says TS_PEND is
not valid until four CPTS_RFT_CLK periods plus four CPPI_ICLK periods
have passed after a pop, and the delay is there to meet that rule.
> The TRM's procedure for reading the CPTS event FIFO says that after a
> write to EVENT_POP, TS_PEND is not valid until four CPTS_RFT_CLK periods
> plus four CPPI_ICLK periods have passed. am65_cpts_fifo_pop_event() does
> not wait, so the next read of TS_PEND in __am65_cpts_fifo_read() can
> come before it is valid.
[ ... ]
> Signed-off-by: James Clark <jjc@jclark.com>
[Severity: Low]
Should this have a Fixes: tag? The EVENT_POP write with no wait after it
in am65_cpts_fifo_pop_event() has not changed since the driver was added:
Fixes: f6bd59526ca5 ("net: ethernet: ti: introduce am654 common platform time sync driver")
Could the commit message also say what goes wrong when TS_PEND is read
too early, and whether anyone has seen it happen?
__am65_cpts_fifo_read() calls am65_cpts_fifo_pop_event() back to back:
drivers/net/ethernet/ti/am65-cpts.c:__am65_cpts_fifo_read() {
...
if (am65_cpts_fifo_pop_event(cpts, event))
break;
...
}
The TS_PEND value read at the start of each call decides whether the
event registers are read and passed to the type switch. Reading it too
early could give:
- a duplicate or garbage event
- a repeated ptp_clock_event() for EXTTS/PPS
- the "cpts: unknown event type" error from the default branch
- a drain that stops early
These effects are inferred from the TRM rule. They have not been
reproduced.
Without a description of the symptoms, it is hard to tell whether this
patch belongs in net with a Fixes: tag for stable, or is only hardening
to match the TRM.
The patch also seems to sit inside a net-next feature series. The last
patch in that series ("net: ethernet: ti: am65-cpts: implement
PTP_SYS_OFFSET_PRECISE") depends on it, because am65_cpts_gtc_push_arm()
calls __am65_cpts_fifo_read() and then reads TS_PEND straight away to
decide whether the FIFO is empty.
If this is a fix, would it be better sent to net on its own?
--
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/cover.1796179313.git.jjc%40jclark.com
next prev parent reply other threads:[~2026-12-03 2:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-02 2:42 [PATCH net-next v3 0/3] net: ethernet: ti: am65-cpts: add PTP_SYS_OFFSET_PRECISE support James Clark
2026-12-02 2:42 ` [PATCH net-next v3 1/3] dt-bindings: net: ti,k3-am654-cpts: add ti,gtc-push James Clark
2026-12-02 2:42 ` [PATCH net-next v3 2/3] net: ethernet: ti: am65-cpts: wait after each event FIFO pop James Clark
2026-12-03 2:45 ` netdev-bot+sashiko [this message]
2026-12-02 2:42 ` [PATCH net-next v3 3/3] net: ethernet: ti: am65-cpts: implement PTP_SYS_OFFSET_PRECISE James Clark
2026-12-03 2:45 ` netdev-bot+sashiko
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=179626594448.3146.5046422925015545198@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=bigeasy@linutronix.de \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=jjc@jclark.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.kaistra@linutronix.de \
--cc=netdev@vger.kernel.org \
--cc=nm@ti.com \
--cc=pabeni@redhat.com \
--cc=r-sharma3@ti.com \
--cc=richardcochran@gmail.com \
--cc=robertcnelson@gmail.com \
--cc=robh@kernel.org \
--cc=rogerq@kernel.org \
--cc=s-vadapalli@ti.com \
--cc=vadim.fedorenko@linux.dev \
--cc=vigneshr@ti.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