From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Xuanqiang Luo <xuanqiang.luo@linux.dev>
Cc: linux-renesas-soc@vger.kernel.org, netdev@vger.kernel.org,
kuba@kernel.org, vadim.fedorenko@linux.dev, paul@pbarker.dev,
andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com,
pabeni@redhat.com, richardcochran@gmail.com,
masaru.nagai.vx@renesas.com, luoxuanqiang@kylinos.cn
Subject: Re: [PATCH net v4 0/2] net: ravb: fix PTP clock lifetime
Date: Thu, 13 Aug 2026 12:41:14 +0200 [thread overview]
Message-ID: <20260813104114.GG2757863@ragnatech.se> (raw)
In-Reply-To: <20260811103733.62599-1-xuanqiang.luo@linux.dev>
Hi Xuanqiang,
Thanks for your work.
On 2026-08-11 18:37:31 +0800, Xuanqiang Luo wrote:
> From: Xuanqiang Luo <luoxuanqiang@kylinos.cn>
>
> This series fixes RAVB PTP clock lifetime handling. It reports a cached PHC
> index without accessing the clock pointer and drains PTP interrupts before
> unregistering the clock.
>
> Patch 1 caches the PHC index and handles registration failures.
>
> Patch 2 detaches the clock with xchg() and drains the PTP IRQs before
> unregistering it.
These patches are rather big change adding READ_ONCE() and WRITE_ONCE()
to avoid a LLM warning? Or have you hit a real issue? How have you
tested this work?
If you have a test-case could you share it? I have a pending series [1]
that cleans up the whole RAVB driver ptp management which have grown
rather organically. It have a small fix for the missing check of
registering the clock. Would it be possible for you to test your work
with that series too?
1. https://lore.kernel.org/all/20260811160200.2049987-1-niklas.soderlund%2Brenesas@ragnatech.se/
>
> ---
> Changes:
> v4:
> - Rebase onto Linux 7.2-rc7.
> Patch 1:
> - Cache the PHC index separately instead of locking clock access.
> (Vadim Fedorenko)
> - Reword the subject and update the commit message for the cached PHC
> index approach.
> - Add Vadim Fedorenko's Reviewed-by tag.
> Patch 2:
> - Replace priv->lock serialization with PTP interrupt disabling and IRQ
> draining before unregistering the clock. (Vadim Fedorenko)
> - Use READ_ONCE() and WRITE_ONCE() for lockless clock pointer access and
> xchg() to detach the clock atomically.
> - Track the error and management IRQs and synchronize all IRQs that can
> invoke the PTP handler.
> - Update the commit message to describe the interrupt handler race and
> the new teardown sequence.
>
> v3: https://lore.kernel.org/all/20260806095126.57803-1-xuanqiang.luo@linux.dev/
> Patch 1:
> - Omit Niklas Söderlund's Reviewed-by tag because the implementation he
> reviewed has changed.
> - Describe the NULL pointer dereference before the first open as the most
> likely failure mode in the commit message. (Jakub Kicinski, Sashiko)
> - Normalize PTP clock registration failures to NULL.
> (Jakub Kicinski, Sashiko)
> - Keep hardware timestamping capabilities independent of PHC
> availability. (Jakub Kicinski, Sashiko)
> Patch 2 (new):
> - Serialize PTP clock publication and access with priv->lock, and detach
> the clock before unregistering it. (Jakub Kicinski, Sashiko)
>
> v2: https://lore.kernel.org/all/20260802090750.116215-1-xuanqiang.luo@linux.dev/
> - Only advertise hardware timestamping support when a PHC is available
> (Niklas Söderlund).
>
> v1: https://lore.kernel.org/all/20260731063254.71260-1-xuanqiang.luo@linux.dev/
>
> Xuanqiang Luo (2):
> net: ravb: avoid dereferencing an invalid PTP clock
> net: ravb: serialize PTP clock teardown
>
> drivers/net/ethernet/renesas/ravb.h | 3 ++
> drivers/net/ethernet/renesas/ravb_main.c | 9 +++--
> drivers/net/ethernet/renesas/ravb_ptp.c | 44 ++++++++++++++++++++----
> 3 files changed, 47 insertions(+), 9 deletions(-)
>
>
> base-commit: db2ddb87143519e20a95aa36c60b36107b736a58
> --
> 2.43.0
--
Kind Regards,
Niklas Söderlund
next prev parent reply other threads:[~2026-08-13 10:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-11 10:37 [PATCH net v4 0/2] net: ravb: fix PTP clock lifetime Xuanqiang Luo
2026-08-11 10:37 ` [PATCH net v4 1/2] net: ravb: avoid dereferencing an invalid PTP clock Xuanqiang Luo
2026-08-11 10:37 ` [PATCH net v4 2/2] net: ravb: serialize PTP clock teardown Xuanqiang Luo
2026-08-13 10:41 ` Niklas Söderlund [this message]
2026-08-14 8:37 ` [PATCH net v4 0/2] net: ravb: fix PTP clock lifetime luoxuanqiang
2026-08-17 22:50 ` patchwork-bot+netdevbpf
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=20260813104114.GG2757863@ragnatech.se \
--to=niklas.soderlund@ragnatech.se \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=luoxuanqiang@kylinos.cn \
--cc=masaru.nagai.vx@renesas.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=paul@pbarker.dev \
--cc=richardcochran@gmail.com \
--cc=vadim.fedorenko@linux.dev \
--cc=xuanqiang.luo@linux.dev \
/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