* Re: [PATCH net] net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl
2026-11-04 5:25 [PATCH net] net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl James Clark
@ 2026-11-04 8:58 ` Maxime Chevallier
2026-11-04 21:12 ` Jacob Keller
2026-11-04 9:06 ` Lorenzo Bianconi
2026-11-04 9:26 ` Kory Maincent
2 siblings, 1 reply; 5+ messages in thread
From: Maxime Chevallier @ 2026-11-04 8:58 UTC (permalink / raw)
To: James Clark, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: Maxime Coquelin, Alexandre Torgue, Richard Cochran, Jacob Keller,
Kory Maincent, netdev, linux-stm32, linux-arm-kernel,
linux-kernel
Hi James,
On 11/4/26 06:25, James Clark wrote:
> Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to
> ptp_clock_info") modified the PTP core to validate the supported flags
> of external timestamp requests, rather than relying on each driver to
> check them.
>
> stmmac_enable() and dwmac1000_ptp_enable() ignore the flags, and
> neither stmmac_ptp_clock_ops nor dwmac1000_ptp_clock_ops was given any
> .supported_extts_flags. Since PTP_EXTTS_REQUEST2 always implies
> PTP_STRICT_FLAGS, the core now rejects every PTP_EXTTS_REQUEST2 for
> this driver with -EOPNOTSUPP, where before that commit the same
> requests succeeded. Only the PTP_EXTTS_REQUEST ioctl still works.
>
> Tests on an NXP i.MX 8M Plus (FRDM-IMX8MPLUS, GMAC 5.10a) show that the
> auxiliary snapshot inputs timestamp just the rising edge. The reference
> manuals for the STM32MP13 (GMAC 4.20a) and the Cyclone V HPS (GMAC
> 3.70a, which uses dwmac1000_ptp_clock_ops) say the same.
>
> Encode this in .supported_extts_flags. A PTP_EXTTS_REQUEST2 for the
> rising edge then succeeds, and one for the falling edge or for both
> edges fails with -EOPNOTSUPP.
>
> Fixes: 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info")
> Cc: stable@vger.kernel.org
> Signed-off-by: James Clark <jjc@jclark.com>
funny this wasn't noticed before, this looks good to me :)
I've tested this on cyclone V, stm32mp157 and imx8mp,
Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
Thanks,
Maxime
> ---
> I used an LLM coding assistant to help prepare this patch.
>
> drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
> index a37405534beb..31a66e855d6b 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
> @@ -277,6 +277,7 @@ const struct ptp_clock_info stmmac_ptp_clock_ops = {
> .n_per_out = 0, /* will be overwritten in stmmac_ptp_register */
> .n_pins = 0,
> .pps = 0,
> + .supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
> .adjfine = stmmac_adjust_freq,
> .adjtime = stmmac_adjust_time,
> .gettimex64 = stmmac_get_timex,
> @@ -294,6 +295,7 @@ const struct ptp_clock_info dwmac1000_ptp_clock_ops = {
> .n_per_out = 0,
> .n_pins = 0,
> .pps = 0,
> + .supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
> .adjfine = stmmac_adjust_freq,
> .adjtime = stmmac_adjust_time,
> .gettimex64 = stmmac_get_timex,
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH net] net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl
2026-11-04 8:58 ` Maxime Chevallier
@ 2026-11-04 21:12 ` Jacob Keller
0 siblings, 0 replies; 5+ messages in thread
From: Jacob Keller @ 2026-11-04 21:12 UTC (permalink / raw)
To: Maxime Chevallier, James Clark, Andrew Lunn, David S. Miller,
Eric Dumazet, Jakub Kicinski, Paolo Abeni
Cc: Maxime Coquelin, Alexandre Torgue, Richard Cochran, Kory Maincent,
netdev, linux-stm32, linux-arm-kernel, linux-kernel
On 11/4/2026 12:58 AM, Maxime Chevallier wrote:
>> Fixes: 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: James Clark <jjc@jclark.com>
>
> funny this wasn't noticed before, this looks good to me :)
>
A lot of programs still use the older PTP_EXTTS_REQUEST ioctl which is
permissive and doesn't enforce the edge request, so i suspect a lot of
software just doesn't trigger this.
> I've tested this on cyclone V, stm32mp157 and imx8mp,
>
Great, thanks!
> Tested-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
> Reviewed-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
>
> Thanks,
>
> Maxime
>
>> ---
>> I used an LLM coding assistant to help prepare this patch.
>>
>> drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 2 ++
>> 1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
>> index a37405534beb..31a66e855d6b 100644
>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
>> @@ -277,6 +277,7 @@ const struct ptp_clock_info stmmac_ptp_clock_ops = {
>> .n_per_out = 0, /* will be overwritten in stmmac_ptp_register */
>> .n_pins = 0,
>> .pps = 0,
>> + .supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
>> .adjfine = stmmac_adjust_freq,
>> .adjtime = stmmac_adjust_time,
>> .gettimex64 = stmmac_get_timex,
>> @@ -294,6 +295,7 @@ const struct ptp_clock_info dwmac1000_ptp_clock_ops = {
>> .n_per_out = 0,
>> .n_pins = 0,
>> .pps = 0,
>> + .supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
>> .adjfine = stmmac_adjust_freq,
>> .adjtime = stmmac_adjust_time,
>> .gettimex64 = stmmac_get_timex,
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH net] net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl
2026-11-04 5:25 [PATCH net] net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl James Clark
2026-11-04 8:58 ` Maxime Chevallier
@ 2026-11-04 9:06 ` Lorenzo Bianconi
2026-11-04 9:26 ` Kory Maincent
2 siblings, 0 replies; 5+ messages in thread
From: Lorenzo Bianconi @ 2026-11-04 9:06 UTC (permalink / raw)
To: James Clark
Cc: Andrew Lunn, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, Maxime Chevallier, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Jacob Keller, Kory Maincent, netdev, linux-stm32,
linux-arm-kernel, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 2491 bytes --]
> Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to
> ptp_clock_info") modified the PTP core to validate the supported flags
> of external timestamp requests, rather than relying on each driver to
> check them.
>
> stmmac_enable() and dwmac1000_ptp_enable() ignore the flags, and
> neither stmmac_ptp_clock_ops nor dwmac1000_ptp_clock_ops was given any
> .supported_extts_flags. Since PTP_EXTTS_REQUEST2 always implies
> PTP_STRICT_FLAGS, the core now rejects every PTP_EXTTS_REQUEST2 for
> this driver with -EOPNOTSUPP, where before that commit the same
> requests succeeded. Only the PTP_EXTTS_REQUEST ioctl still works.
>
> Tests on an NXP i.MX 8M Plus (FRDM-IMX8MPLUS, GMAC 5.10a) show that the
> auxiliary snapshot inputs timestamp just the rising edge. The reference
> manuals for the STM32MP13 (GMAC 4.20a) and the Cyclone V HPS (GMAC
> 3.70a, which uses dwmac1000_ptp_clock_ops) say the same.
>
> Encode this in .supported_extts_flags. A PTP_EXTTS_REQUEST2 for the
> rising edge then succeeds, and one for the falling edge or for both
> edges fails with -EOPNOTSUPP.
>
> Fixes: 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info")
> Cc: stable@vger.kernel.org
> Signed-off-by: James Clark <jjc@jclark.com>
Reviewed-by: Lorenzo Bianconi <lorenzo.bianconi@oss.qualcomm.com>
> ---
> I used an LLM coding assistant to help prepare this patch.
>
> drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
> index a37405534beb..31a66e855d6b 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_ptp.c
> @@ -277,6 +277,7 @@ const struct ptp_clock_info stmmac_ptp_clock_ops = {
> .n_per_out = 0, /* will be overwritten in stmmac_ptp_register */
> .n_pins = 0,
> .pps = 0,
> + .supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
> .adjfine = stmmac_adjust_freq,
> .adjtime = stmmac_adjust_time,
> .gettimex64 = stmmac_get_timex,
> @@ -294,6 +295,7 @@ const struct ptp_clock_info dwmac1000_ptp_clock_ops = {
> .n_per_out = 0,
> .n_pins = 0,
> .pps = 0,
> + .supported_extts_flags = PTP_RISING_EDGE | PTP_STRICT_FLAGS,
> .adjfine = stmmac_adjust_freq,
> .adjtime = stmmac_adjust_time,
> .gettimex64 = stmmac_get_timex,
> --
> 2.56.0
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH net] net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl
2026-11-04 5:25 [PATCH net] net: stmmac: ptp: fix support for PTP_EXTTS_REQUEST2 ioctl James Clark
2026-11-04 8:58 ` Maxime Chevallier
2026-11-04 9:06 ` Lorenzo Bianconi
@ 2026-11-04 9:26 ` Kory Maincent
2 siblings, 0 replies; 5+ messages in thread
From: Kory Maincent @ 2026-11-04 9:26 UTC (permalink / raw)
To: James Clark, Andrew Lunn, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni
Cc: Maxime Chevallier, Maxime Coquelin, Alexandre Torgue,
Richard Cochran, Jacob Keller, netdev, linux-stm32,
linux-arm-kernel, linux-kernel
On 11/4/26 06:25, James Clark wrote:
> Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to
> ptp_clock_info") modified the PTP core to validate the supported flags
> of external timestamp requests, rather than relying on each driver to
> check them.
>
> stmmac_enable() and dwmac1000_ptp_enable() ignore the flags, and
> neither stmmac_ptp_clock_ops nor dwmac1000_ptp_clock_ops was given any
> .supported_extts_flags. Since PTP_EXTTS_REQUEST2 always implies
> PTP_STRICT_FLAGS, the core now rejects every PTP_EXTTS_REQUEST2 for
> this driver with -EOPNOTSUPP, where before that commit the same
> requests succeeded. Only the PTP_EXTTS_REQUEST ioctl still works.
>
> Tests on an NXP i.MX 8M Plus (FRDM-IMX8MPLUS, GMAC 5.10a) show that the
> auxiliary snapshot inputs timestamp just the rising edge. The reference
> manuals for the STM32MP13 (GMAC 4.20a) and the Cyclone V HPS (GMAC
> 3.70a, which uses dwmac1000_ptp_clock_ops) say the same.
>
> Encode this in .supported_extts_flags. A PTP_EXTTS_REQUEST2 for the
> rising edge then succeeds, and one for the falling edge or for both
> edges fails with -EOPNOTSUPP.
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Thank you!
--
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 5+ messages in thread