Re: [PATCH net v2] net: macb: fix ordering around PTP timestamp read
From: Jakub Kicinski
Date: Mon Sep 14 2026 - 20:40:02 EST
On Thu, 10 Sep 2026 11:06:52 +0700 James Clark wrote:
> + /* ptp_read_system_prets() uses smp_rmb() internally,
> + * which does not guarantee ordering against MMIO reads.
> + */
IMHO the fact that the gem_readl() is a relaxed read is more relevant /
unusual in this case?
Also clashiko points out that this function may be called per packet
with sts as NULL so it's worth wrapping these barriers in if, I think
that's a good suggestion?
https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260910040658.18359-1-jjc@xxxxxxxxxx
> + rmb();
> first = gem_readl(bp, TN);
> + /* Ensure the PHC read completes before taking
> + * the post timestamp.
> + */
> + rmb();
--
pw-bot: cr