From 059a5a238c22c11e29e55fe6908e4b73cb763ad5 Mon Sep 17 00:00:00 2001 From: Kim Wooseok <5mghybrid@khu.ac.kr> Date: Wed, 23 Sep 2026 18:13:26 +0900 Subject: [PATCH] net: macb: Enable RX timestamping for specific PTPv1 filters MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Selecting a PTPv1 Sync or Delay_Req filter in gem_set_hwtst() returns success, but leaves rx_bd_control at its initial value of TSTAMP_DISABLED. The requested filter therefore appears to have been applied, even though received packets have no hardware timestamps. The PTPv1 event case already enables timestamping for all frames, so use that path for Sync and Delay_Req as well. This enables timestamping for both requests and returns HWTSTAMP_FILTER_ALL to tell the caller which filter was actually applied. Reviewed-by: Nicolai Buchwitz Reviewed-by: Théo Lebrun Tested-by: Nicolai Buchwitz Signed-off-by: Kim Wooseok <5mghybrid@khu.ac.kr> Link: https://patch.msgid.link/20260923-macb-hwtstamp-rework-v2-2-75c909b2676d@khu.ac.kr Signed-off-by: Jakub Kicinski --- drivers/net/ethernet/cadence/macb_ptp.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_ptp.c b/drivers/net/ethernet/cadence/macb_ptp.c index 02face93a53a..af2e36f81096 100644 --- a/drivers/net/ethernet/cadence/macb_ptp.c +++ b/drivers/net/ethernet/cadence/macb_ptp.c @@ -421,10 +421,6 @@ int gem_set_hwtst(struct net_device *netdev, switch (rx_filter) { case HWTSTAMP_FILTER_NONE: break; - case HWTSTAMP_FILTER_PTP_V1_L4_SYNC: - break; - case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: - break; case HWTSTAMP_FILTER_PTP_V2_EVENT: case HWTSTAMP_FILTER_PTP_V2_L2_EVENT: case HWTSTAMP_FILTER_PTP_V2_L4_EVENT: @@ -439,6 +435,8 @@ int gem_set_hwtst(struct net_device *netdev, ncr_mask |= MACB_BIT(SRTSM); ncr_bits |= MACB_BIT(SRTSM); break; + case HWTSTAMP_FILTER_PTP_V1_L4_SYNC: + case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: case HWTSTAMP_FILTER_PTP_V1_L4_EVENT: case HWTSTAMP_FILTER_ALL: rx_bd_control = TSTAMP_ALL_FRAMES;