diff options
| author | Wayne Wang(SW-TEGRA) <waywang@nvidia.com> | 2021-10-18 01:56:53 -0400 |
|---|---|---|
| committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2021-10-21 10:10:13 -0400 |
| commit | 0899e4aa2a41b66c2ff465c8fdfb86f2f2954d71 (patch) | |
| tree | bb7af51d1add86f4230defbea74622e7af9aa15f | |
| parent | 3477d4b47e8112357a1e21bea291f72ed897763b (diff) | |
net: eqos: ethtool: resolve the fixed ptp clock issue
When using ethtool to determine which ptp clock is register to the eqos. It will always report ptp0.
And it may not be true.
This causes issues when using ptp4l as the clocks do not line up with the interfaces.
Bug 3392620
Change-Id: I97192952817dadea9ce795cff548e97d2cd65477
Signed-off-by: Wayne Wang(SW-TEGRA) <waywang@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2612151
Reviewed-by: Sushil Kumar Singh <sushilkumars@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
| -rw-r--r-- | drivers/net/ethernet/nvidia/eqos/ethtool.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/net/ethernet/nvidia/eqos/ethtool.c b/drivers/net/ethernet/nvidia/eqos/ethtool.c index e692c54a8..83c5013bd 100644 --- a/drivers/net/ethernet/nvidia/eqos/ethtool.c +++ b/drivers/net/ethernet/nvidia/eqos/ethtool.c | |||
| @@ -276,13 +276,20 @@ static const struct eqos_stats eqos_mmc[] = { | |||
| 276 | static int eqos_get_ts_info(struct net_device *net, | 276 | static int eqos_get_ts_info(struct net_device *net, |
| 277 | struct ethtool_ts_info *info) | 277 | struct ethtool_ts_info *info) |
| 278 | { | 278 | { |
| 279 | struct eqos_prv_data *pdata = netdev_priv(net); | ||
| 280 | |||
| 279 | info->so_timestamping = | 281 | info->so_timestamping = |
| 280 | SOF_TIMESTAMPING_TX_SOFTWARE | | 282 | SOF_TIMESTAMPING_TX_SOFTWARE | |
| 281 | SOF_TIMESTAMPING_RX_SOFTWARE | | 283 | SOF_TIMESTAMPING_RX_SOFTWARE | |
| 282 | SOF_TIMESTAMPING_SOFTWARE | | 284 | SOF_TIMESTAMPING_SOFTWARE | |
| 283 | SOF_TIMESTAMPING_TX_HARDWARE | | 285 | SOF_TIMESTAMPING_TX_HARDWARE | |
| 284 | SOF_TIMESTAMPING_RX_HARDWARE | SOF_TIMESTAMPING_RAW_HARDWARE; | 286 | SOF_TIMESTAMPING_RX_HARDWARE | SOF_TIMESTAMPING_RAW_HARDWARE; |
| 285 | info->phc_index = 0; | 287 | |
| 288 | if (pdata && pdata->ptp_clock) | ||
| 289 | info->phc_index = ptp_clock_index(pdata->ptp_clock); | ||
| 290 | else | ||
| 291 | info->phc_index = -1; | ||
| 292 | |||
| 286 | 293 | ||
| 287 | info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON); | 294 | info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON); |
| 288 | 295 | ||
