mirror of
https://github.com/torvalds/linux.git
synced 2026-09-23 22:14:03 +02:00
net: stmmac: do not overwrite phc_index when no PTP clock is registered
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: 9364fa7fcf ("net: stmmac: Remove setting of RX software timestamp")
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Rahul Rameshbabu <rrameshbabu@nvidia.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
Reviewed-by: Gal Pressman <gal@nvidia.com>
Link: https://patch.msgid.link/20260914-stmmac-fix-phc_index-v2-1-bf3d90373fe4@oss.qualcomm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
3f118c8217
commit
f0ef4b1eae
|
|
@ -1016,8 +1016,6 @@ static int stmmac_get_ts_info(struct net_device *dev,
|
|||
|
||||
if (priv->ptp_clock)
|
||||
info->phc_index = ptp_clock_index(priv->ptp_clock);
|
||||
else
|
||||
info->phc_index = 0;
|
||||
|
||||
info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user