[PATCH net v2] net: stmmac: do not overwrite phc_index when no PTP clock is registered

Gal Pressman gal at nvidia.com
Mon Sep 14 00:52:27 PDT 2026


On 14/09/2026 10:41, Lorenzo Bianconi wrote:
> stmmac_get_ts_info() reports phc_index as 0 when hardware timestamping
> is supported but no PTP clock has been registered yet (e.g. while the
> interface is down). Zero is a valid PHC index and would make userspace
> resolve the wrong clock; the absence of a clock should be reported as
> -1.
> 
> The ethtool core already initializes phc_index to -1 before invoking
> the get_ts_info callback (ethtool_init_tsinfo()), so just drop the
> erroneous assignment.
> 
> Fixes: 9364fa7fcf12 ("net: stmmac: Remove setting of RX software timestamp")
> Reviewed-by: Maxime Chevallier <maxime.chevallier at bootlin.com>
> Reviewed-by: Rahul Rameshbabu <rrameshbabu at nvidia.com>
> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi at oss.qualcomm.com>
> ---
> Changes in v2:
> - Drop phc_index assignment to -1
> - Link to v1: https://lore.kernel.org/r/20260912-stmmac-fix-phc_index-v1-1-26e1ead25324@oss.qualcomm.com
Thanks Lorenzo!
Reviewed-by: Gal Pressman <gal at nvidia.com>



More information about the linux-arm-kernel mailing list