[PATCH net] net: stmmac: report phc_index as -1 when no PTP clock is registered

Lorenzo Bianconi lorenzo.bianconi at oss.qualcomm.com
Mon Sep 14 00:11:00 PDT 2026


On Sep 14, Gal Pressman wrote:
> On 13/09/2026 0:16, Lorenzo Bianconi wrote:
> > When hardware timestamping is supported but no PTP clock has been
> > registered yet (e.g. while the interface is down), stmmac_get_ts_info()
> > currently reports phc_index as 0. Zero is a valid PHC index and would
> > make userspace resolve the wrong clock; the absence of a clock should
> > be reported as -1, matching ethtool_init_tsinfo() and
> > ethtool_op_get_ts_info().
> > 
> > Report -1 when no PTP clock is available.
> > 
> > Fixes: 9364fa7fcf12 ("net: stmmac: Remove setting of RX software timestamp")
> > Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi at oss.qualcomm.com>
> In all other drivers I just removed the assignment, why not do the same
> here?

Ack, I agree. Since we run ethtool_init_tsinfo() before running the
get_ts_info() callback, we can drop phc_index initialization to -1.
I will fix it in v2.

Regards,
Lorenzo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260914/609f0dc9/attachment.sig>


More information about the linux-arm-kernel mailing list