Skip to content

Commit 126e799

Browse files
Niklas Söderlundkuba-moo
authored andcommitted
net: ravb: Only advertise Rx/Tx timestamps if hardware supports it
Recent work moving the reporting of Rx software timestamps to the core [1] highlighted an issue where hardware time stamping was advertised for the platforms where it is not supported. Fix this by covering advertising support for hardware timestamps only if the hardware supports it. Due to the Tx implementation in RAVB software Tx timestamping is also only considered if the hardware supports hardware timestamps. This should be addressed in future, but this fix only reflects what the driver currently implements. 1. Commit 277901e ("ravb: Remove setting of RX software timestamp") Fixes: 7e09a05 ("ravb: Exclude gPTP feature support for RZ/G2L") Signed-off-by: Niklas Söderlund <[email protected]> Reviewed-by: Paul Barker <[email protected]> Tested-by: Paul Barker <[email protected]> Reviewed-by: Sergey Shtylyov <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 217a3d9 commit 126e799

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

drivers/net/ethernet/renesas/ravb_main.c

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1750,20 +1750,19 @@ static int ravb_get_ts_info(struct net_device *ndev,
17501750
struct ravb_private *priv = netdev_priv(ndev);
17511751
const struct ravb_hw_info *hw_info = priv->info;
17521752

1753-
info->so_timestamping =
1754-
SOF_TIMESTAMPING_TX_SOFTWARE |
1755-
SOF_TIMESTAMPING_TX_HARDWARE |
1756-
SOF_TIMESTAMPING_RX_HARDWARE |
1757-
SOF_TIMESTAMPING_RAW_HARDWARE;
1758-
info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON);
1759-
info->rx_filters =
1760-
(1 << HWTSTAMP_FILTER_NONE) |
1761-
(1 << HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
1762-
(1 << HWTSTAMP_FILTER_ALL);
1763-
if (hw_info->gptp || hw_info->ccc_gac)
1753+
if (hw_info->gptp || hw_info->ccc_gac) {
1754+
info->so_timestamping =
1755+
SOF_TIMESTAMPING_TX_SOFTWARE |
1756+
SOF_TIMESTAMPING_TX_HARDWARE |
1757+
SOF_TIMESTAMPING_RX_HARDWARE |
1758+
SOF_TIMESTAMPING_RAW_HARDWARE;
1759+
info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON);
1760+
info->rx_filters =
1761+
(1 << HWTSTAMP_FILTER_NONE) |
1762+
(1 << HWTSTAMP_FILTER_PTP_V2_L2_EVENT) |
1763+
(1 << HWTSTAMP_FILTER_ALL);
17641764
info->phc_index = ptp_clock_index(priv->ptp.clock);
1765-
else
1766-
info->phc_index = 0;
1765+
}
17671766

17681767
return 0;
17691768
}

0 commit comments

Comments
 (0)