Re: [PATCH net RESEND 2/2] net: macb: Use all-frame timestamping for PTPv1 RX filters

From: Nicolai Buchwitz

Date: Fri Sep 11 2026 - 05:56:50 EST


Hi Kimwoo

On 11.9.2026 10:04, kimwooseok wrote:
gem_set_hwtst() accepts HWTSTAMP_FILTER_PTP_V1_L4_SYNC and
HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ without changing rx_bd_control from
TSTAMP_DISABLED. A successful request thus disables receive timestamping
while reporting the requested nonempty filter to userspace.

Handle these two filters through the existing all-frame fallback used
for HWTSTAMP_FILTER_PTP_V1_L4_EVENT. This enables receive timestamping
for a superset of the requested packets and returns HWTSTAMP_FILTER_ALL
to describe the configuration actually selected.

Fixes: ab91f0a9b5f4 ("net: macb: Add hardware PTP support")
Assisted-by: GPT-6 Astra
Signed-off-by: kimwooseok <5mghybrid@xxxxxxxxx>
---
Resending as plain text because the previous webmail submission included
HTML and quoted and rewrapped the patch. No code changes; the Assisted-by
trailer now names the tool.

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 51659bb..2ffc46b 100644
--- a/drivers/net/ethernet/cadence/macb_ptp.c
+++ b/drivers/net/ethernet/cadence/macb_ptp.c
@@ -430,10 +430,6 @@ int gem_set_hwtst(struct net_device *netdev,
switch (tstamp_config->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:
@@ -448,6 +444,8 @@ int gem_set_hwtst(struct net_device *netdev,
regval = macb_readl(bp, NCR);
macb_writel(bp, NCR, (regval | 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;


Reviewed-by: Nicolai Buchwitz <nb@xxxxxxxxxx>
Tested-by: Nicolai Buchwitz <nb@xxxxxxxxxxx> # Raspberry Pi CM5

Thanks,
Nicolai