netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/3] broadcom: report the supported flags for ancillary features
@ 2025-09-19  0:33 Jacob Keller
  2025-09-19  0:33 ` [PATCH net 1/3] broadcom: fix support for PTP_PEROUT_DUTY_CYCLE Jacob Keller
                   ` (6 more replies)
  0 siblings, 7 replies; 12+ messages in thread
From: Jacob Keller @ 2025-09-19  0:33 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vadim Fedorenko,
	Kory Maincent
  Cc: Richard Cochran, Yaroslav Kolomiiets, James Clark, netdev,
	linux-kernel, Jacob Keller, Vadim Fedorenko

James Clark reported off list that the broadcom PHY PTP driver was
incorrectly handling PTP_EXTTS_REQUEST and PTP_PEROUT_REQUEST ioctls since
the conversion to the .supported_*_flags fields. This series fixes the
driver to correctly report its flags through the .supported_perout_flags
and .supported_extts_flags fields. It also contains an update to comment
the behavior of the PTP_STRICT_FLAGS being always enabled for
PTP_EXTTS_REQUEST2.

I plan to follow up this series with some improvements to the PTP
documentation better explaining each flag and the expectation of the driver
APIs.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
Jacob Keller (3):
      broadcom: fix support for PTP_PEROUT_DUTY_CYCLE
      broadcom: fix support for PTP_EXTTS_REQUEST2 ioctl
      ptp: document behavior of PTP_STRICT_FLAGS

 include/uapi/linux/ptp_clock.h | 3 +++
 drivers/net/phy/bcm-phy-ptp.c  | 6 ++----
 2 files changed, 5 insertions(+), 4 deletions(-)
---
base-commit: cbf658dd09419f1ef9de11b9604e950bdd5c170b
change-id: 20250918-jk-fix-bcm-phy-supported-flags-0796dddf7954

Best regards,
--  
Jacob Keller <jacob.e.keller@intel.com>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* [PATCH net 1/3] broadcom: fix support for PTP_PEROUT_DUTY_CYCLE
  2025-09-19  0:33 [PATCH net 0/3] broadcom: report the supported flags for ancillary features Jacob Keller
@ 2025-09-19  0:33 ` Jacob Keller
  2025-09-19 11:02   ` Vadim Fedorenko
  2025-09-19  0:33 ` [PATCH net 2/3] broadcom: fix support for PTP_EXTTS_REQUEST2 ioctl Jacob Keller
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Jacob Keller @ 2025-09-19  0:33 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vadim Fedorenko,
	Kory Maincent
  Cc: Richard Cochran, Yaroslav Kolomiiets, James Clark, netdev,
	linux-kernel, Jacob Keller, Vadim Fedorenko

The bcm_ptp_perout_locked() function has support for handling
PTP_PEROUT_DUTY_CYCLE, but its not listed in the supported_perout_flags.
Attempts to use the duty cycle support will be rejected since commit
d9f3e9ecc456 ("net: ptp: introduce .supported_perout_flags to
ptp_clock_info"), as this flag accidentally missed while doing the
conversion.

Drop the unnecessary supported flags check from the bcm_ptp_perout_locked()
function and correctly set the supported_perout_flags. This fixes use of
the PTP_PEROUT_DUTY_CYCLE support for the broadcom driver.

Reported-by: James Clark <jjc@jclark.com>
Fixes: d9f3e9ecc456 ("net: ptp: introduce .supported_perout_flags to ptp_clock_info")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/phy/bcm-phy-ptp.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/drivers/net/phy/bcm-phy-ptp.c b/drivers/net/phy/bcm-phy-ptp.c
index eba8b5fb1365..1cf695ac73cc 100644
--- a/drivers/net/phy/bcm-phy-ptp.c
+++ b/drivers/net/phy/bcm-phy-ptp.c
@@ -597,10 +597,6 @@ static int bcm_ptp_perout_locked(struct bcm_ptp_private *priv,
 
 	period = BCM_MAX_PERIOD_8NS;	/* write nonzero value */
 
-	/* Reject unsupported flags */
-	if (req->flags & ~PTP_PEROUT_DUTY_CYCLE)
-		return -EOPNOTSUPP;
-
 	if (req->flags & PTP_PEROUT_DUTY_CYCLE)
 		pulse = ktime_to_ns(ktime_set(req->on.sec, req->on.nsec));
 	else
@@ -741,6 +737,7 @@ static const struct ptp_clock_info bcm_ptp_clock_info = {
 	.n_pins		= 1,
 	.n_per_out	= 1,
 	.n_ext_ts	= 1,
+	.supported_perout_flags = PTP_PEROUT_DUTY_CYCLE,
 };
 
 static void bcm_ptp_txtstamp(struct mii_timestamper *mii_ts,

-- 
2.51.0.rc1.197.g6d975e95c9d7


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH net 2/3] broadcom: fix support for PTP_EXTTS_REQUEST2 ioctl
  2025-09-19  0:33 [PATCH net 0/3] broadcom: report the supported flags for ancillary features Jacob Keller
  2025-09-19  0:33 ` [PATCH net 1/3] broadcom: fix support for PTP_PEROUT_DUTY_CYCLE Jacob Keller
@ 2025-09-19  0:33 ` Jacob Keller
  2025-09-19 11:03   ` Vadim Fedorenko
  2025-09-19  0:33 ` [PATCH net 3/3] ptp: document behavior of PTP_STRICT_FLAGS Jacob Keller
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Jacob Keller @ 2025-09-19  0:33 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vadim Fedorenko,
	Kory Maincent
  Cc: Richard Cochran, Yaroslav Kolomiiets, James Clark, netdev,
	linux-kernel, Jacob Keller, Vadim Fedorenko

Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to
ptp_clock_info") modified the PTP core kernel logic to validate the
supported flags for the PTP_EXTTS_REQUEST ioctls, rather than relying on
each individual driver correctly checking its flags.

The bcm_ptp_enable() function implements support for PTP_CLK_REQ_EXTTS, but
does not check the flags, and does not forward the request structure into
bcm_ptp_extts_locked().

When originally converting the bcm-phy-ptp.c code, it was unclear what
edges the hardware actually timestamped. Thus, no flags were initialized in
the .supported_extts_flags field. This results in the kernel automatically
rejecting all userspace requests for the PTP_EXTTS_REQUEST2 ioctl.

This occurs because the PTP_STRICT_FLAGS is always assumed when operating
under PTP_EXTTS_REQUEST2. This has been the case since the flags
introduction by commit 6138e687c7b6 ("ptp: Introduce strict checking of
external time stamp options.").

The bcm-phy-ptp.c logic never properly supported strict flag validation,
as it previously ignored all flags including both PTP_STRICT_FLAGS and the
PTP_FALLING_EDGE and PTP_RISING_EDGE flags.

Reports from users in the field prove that the hardware timestamps the
rising edge. Encode this in the .supported_extts_flags field. This
re-enables support for the PTP_EXTTS_REQUEST2 ioctl.

Reported-by: James Clark <jjc@jclark.com>
Fixes: 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 drivers/net/phy/bcm-phy-ptp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/phy/bcm-phy-ptp.c b/drivers/net/phy/bcm-phy-ptp.c
index 1cf695ac73cc..d3501f8487d9 100644
--- a/drivers/net/phy/bcm-phy-ptp.c
+++ b/drivers/net/phy/bcm-phy-ptp.c
@@ -738,6 +738,7 @@ static const struct ptp_clock_info bcm_ptp_clock_info = {
 	.n_per_out	= 1,
 	.n_ext_ts	= 1,
 	.supported_perout_flags = PTP_PEROUT_DUTY_CYCLE,
+	.supported_extts_flags = PTP_STRICT_FLAGS | PTP_RISING_EDGE,
 };
 
 static void bcm_ptp_txtstamp(struct mii_timestamper *mii_ts,

-- 
2.51.0.rc1.197.g6d975e95c9d7


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH net 3/3] ptp: document behavior of PTP_STRICT_FLAGS
  2025-09-19  0:33 [PATCH net 0/3] broadcom: report the supported flags for ancillary features Jacob Keller
  2025-09-19  0:33 ` [PATCH net 1/3] broadcom: fix support for PTP_PEROUT_DUTY_CYCLE Jacob Keller
  2025-09-19  0:33 ` [PATCH net 2/3] broadcom: fix support for PTP_EXTTS_REQUEST2 ioctl Jacob Keller
@ 2025-09-19  0:33 ` Jacob Keller
  2025-09-19 11:04   ` Vadim Fedorenko
  2025-09-19  2:56 ` [PATCH net 0/3] broadcom: report the supported flags for ancillary features Richard Cochran
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 12+ messages in thread
From: Jacob Keller @ 2025-09-19  0:33 UTC (permalink / raw)
  To: Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vadim Fedorenko,
	Kory Maincent
  Cc: Richard Cochran, Yaroslav Kolomiiets, James Clark, netdev,
	linux-kernel, Jacob Keller, Vadim Fedorenko

Commit 6138e687c7b6 ("ptp: Introduce strict checking of external time stamp
options.") added the PTP_STRICT_FLAGS to the set of flags supported for the
external timestamp request ioctl.

It is only supported by PTP_EXTTS_REQUEST2, as it was introduced the
introduction of the new ioctls. Further, the kernel has always set this
flag for PTP_EXTTS_REQUEST2 regardless of whether or not the user requested
the behavior.

This effectively means that the flag is not useful for userspace. If the
user issues a PTP_EXTTS_REQUEST ioctl, the flag is ignored due to not being
supported on the old ioctl. If the user issues a PTP_EXTTS_REQUEST2 ioctl,
the flag will be set by the kernel regardless of whether the user set the
flag in their structure.

Add a comment documenting this behavior in the uAPI header file.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
---
 include/uapi/linux/ptp_clock.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h
index 18eefa6d93d6..2c3346e91dbe 100644
--- a/include/uapi/linux/ptp_clock.h
+++ b/include/uapi/linux/ptp_clock.h
@@ -37,6 +37,9 @@
 
 /*
  * flag fields valid for the new PTP_EXTTS_REQUEST2 ioctl.
+ *
+ * Note: PTP_STRICT_FLAGS is always enabled by the kernel for
+ * PTP_EXTTS_REQUEST2 regardless of whether it is set by userspace.
  */
 #define PTP_EXTTS_VALID_FLAGS	(PTP_ENABLE_FEATURE |	\
 				 PTP_RISING_EDGE |	\

-- 
2.51.0.rc1.197.g6d975e95c9d7


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH net 0/3] broadcom: report the supported flags for ancillary features
  2025-09-19  0:33 [PATCH net 0/3] broadcom: report the supported flags for ancillary features Jacob Keller
                   ` (2 preceding siblings ...)
  2025-09-19  0:33 ` [PATCH net 3/3] ptp: document behavior of PTP_STRICT_FLAGS Jacob Keller
@ 2025-09-19  2:56 ` Richard Cochran
  2025-09-19  8:39 ` Kory Maincent
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 12+ messages in thread
From: Richard Cochran @ 2025-09-19  2:56 UTC (permalink / raw)
  To: Jacob Keller
  Cc: Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vadim Fedorenko,
	Kory Maincent, Yaroslav Kolomiiets, James Clark, netdev,
	linux-kernel

On Thu, Sep 18, 2025 at 05:33:15PM -0700, Jacob Keller wrote:
> James Clark reported off list that the broadcom PHY PTP driver was
> incorrectly handling PTP_EXTTS_REQUEST and PTP_PEROUT_REQUEST ioctls since
> the conversion to the .supported_*_flags fields. This series fixes the
> driver to correctly report its flags through the .supported_perout_flags
> and .supported_extts_flags fields. It also contains an update to comment
> the behavior of the PTP_STRICT_FLAGS being always enabled for
> PTP_EXTTS_REQUEST2.
> 
> I plan to follow up this series with some improvements to the PTP
> documentation better explaining each flag and the expectation of the driver
> APIs.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

For series:

Acked-by: Richard Cochran <richardcochran@gmail.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net 0/3] broadcom: report the supported flags for ancillary features
  2025-09-19  0:33 [PATCH net 0/3] broadcom: report the supported flags for ancillary features Jacob Keller
                   ` (3 preceding siblings ...)
  2025-09-19  2:56 ` [PATCH net 0/3] broadcom: report the supported flags for ancillary features Richard Cochran
@ 2025-09-19  8:39 ` Kory Maincent
  2025-09-20  0:04 ` Jakub Kicinski
  2025-09-22 19:30 ` patchwork-bot+netdevbpf
  6 siblings, 0 replies; 12+ messages in thread
From: Kory Maincent @ 2025-09-19  8:39 UTC (permalink / raw)
  To: Jacob Keller
  Cc: Florian Fainelli, Broadcom internal kernel review list,
	Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Vadim Fedorenko,
	Richard Cochran, Yaroslav Kolomiiets, James Clark, netdev,
	linux-kernel

On Thu, 18 Sep 2025 17:33:15 -0700
Jacob Keller <jacob.e.keller@intel.com> wrote:

> James Clark reported off list that the broadcom PHY PTP driver was
> incorrectly handling PTP_EXTTS_REQUEST and PTP_PEROUT_REQUEST ioctls since
> the conversion to the .supported_*_flags fields. This series fixes the
> driver to correctly report its flags through the .supported_perout_flags
> and .supported_extts_flags fields. It also contains an update to comment
> the behavior of the PTP_STRICT_FLAGS being always enabled for
> PTP_EXTTS_REQUEST2.
> 
> I plan to follow up this series with some improvements to the PTP
> documentation better explaining each flag and the expectation of the driver
> APIs.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>

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] 12+ messages in thread

* Re: [PATCH net 1/3] broadcom: fix support for PTP_PEROUT_DUTY_CYCLE
  2025-09-19  0:33 ` [PATCH net 1/3] broadcom: fix support for PTP_PEROUT_DUTY_CYCLE Jacob Keller
@ 2025-09-19 11:02   ` Vadim Fedorenko
  0 siblings, 0 replies; 12+ messages in thread
From: Vadim Fedorenko @ 2025-09-19 11:02 UTC (permalink / raw)
  To: Jacob Keller, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Kory Maincent
  Cc: Richard Cochran, Yaroslav Kolomiiets, James Clark, netdev,
	linux-kernel

On 19/09/2025 01:33, Jacob Keller wrote:
> The bcm_ptp_perout_locked() function has support for handling
> PTP_PEROUT_DUTY_CYCLE, but its not listed in the supported_perout_flags.
> Attempts to use the duty cycle support will be rejected since commit
> d9f3e9ecc456 ("net: ptp: introduce .supported_perout_flags to
> ptp_clock_info"), as this flag accidentally missed while doing the
> conversion.
> 
> Drop the unnecessary supported flags check from the bcm_ptp_perout_locked()
> function and correctly set the supported_perout_flags. This fixes use of
> the PTP_PEROUT_DUTY_CYCLE support for the broadcom driver.
> 
> Reported-by: James Clark <jjc@jclark.com>
> Fixes: d9f3e9ecc456 ("net: ptp: introduce .supported_perout_flags to ptp_clock_info")
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>   drivers/net/phy/bcm-phy-ptp.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/net/phy/bcm-phy-ptp.c b/drivers/net/phy/bcm-phy-ptp.c
> index eba8b5fb1365..1cf695ac73cc 100644
> --- a/drivers/net/phy/bcm-phy-ptp.c
> +++ b/drivers/net/phy/bcm-phy-ptp.c
> @@ -597,10 +597,6 @@ static int bcm_ptp_perout_locked(struct bcm_ptp_private *priv,
>   
>   	period = BCM_MAX_PERIOD_8NS;	/* write nonzero value */
>   
> -	/* Reject unsupported flags */
> -	if (req->flags & ~PTP_PEROUT_DUTY_CYCLE)
> -		return -EOPNOTSUPP;
> -
>   	if (req->flags & PTP_PEROUT_DUTY_CYCLE)
>   		pulse = ktime_to_ns(ktime_set(req->on.sec, req->on.nsec));
>   	else
> @@ -741,6 +737,7 @@ static const struct ptp_clock_info bcm_ptp_clock_info = {
>   	.n_pins		= 1,
>   	.n_per_out	= 1,
>   	.n_ext_ts	= 1,
> +	.supported_perout_flags = PTP_PEROUT_DUTY_CYCLE,
>   };
>   
>   static void bcm_ptp_txtstamp(struct mii_timestamper *mii_ts,
> 

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net 2/3] broadcom: fix support for PTP_EXTTS_REQUEST2 ioctl
  2025-09-19  0:33 ` [PATCH net 2/3] broadcom: fix support for PTP_EXTTS_REQUEST2 ioctl Jacob Keller
@ 2025-09-19 11:03   ` Vadim Fedorenko
  0 siblings, 0 replies; 12+ messages in thread
From: Vadim Fedorenko @ 2025-09-19 11:03 UTC (permalink / raw)
  To: Jacob Keller, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Kory Maincent
  Cc: Richard Cochran, Yaroslav Kolomiiets, James Clark, netdev,
	linux-kernel

On 19/09/2025 01:33, Jacob Keller wrote:
> Commit 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to
> ptp_clock_info") modified the PTP core kernel logic to validate the
> supported flags for the PTP_EXTTS_REQUEST ioctls, rather than relying on
> each individual driver correctly checking its flags.
> 
> The bcm_ptp_enable() function implements support for PTP_CLK_REQ_EXTTS, but
> does not check the flags, and does not forward the request structure into
> bcm_ptp_extts_locked().
> 
> When originally converting the bcm-phy-ptp.c code, it was unclear what
> edges the hardware actually timestamped. Thus, no flags were initialized in
> the .supported_extts_flags field. This results in the kernel automatically
> rejecting all userspace requests for the PTP_EXTTS_REQUEST2 ioctl.
> 
> This occurs because the PTP_STRICT_FLAGS is always assumed when operating
> under PTP_EXTTS_REQUEST2. This has been the case since the flags
> introduction by commit 6138e687c7b6 ("ptp: Introduce strict checking of
> external time stamp options.").
> 
> The bcm-phy-ptp.c logic never properly supported strict flag validation,
> as it previously ignored all flags including both PTP_STRICT_FLAGS and the
> PTP_FALLING_EDGE and PTP_RISING_EDGE flags.
> 
> Reports from users in the field prove that the hardware timestamps the
> rising edge. Encode this in the .supported_extts_flags field. This
> re-enables support for the PTP_EXTTS_REQUEST2 ioctl.
> 
> Reported-by: James Clark <jjc@jclark.com>
> Fixes: 7c571ac57d9d ("net: ptp: introduce .supported_extts_flags to ptp_clock_info")
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>   drivers/net/phy/bcm-phy-ptp.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/net/phy/bcm-phy-ptp.c b/drivers/net/phy/bcm-phy-ptp.c
> index 1cf695ac73cc..d3501f8487d9 100644
> --- a/drivers/net/phy/bcm-phy-ptp.c
> +++ b/drivers/net/phy/bcm-phy-ptp.c
> @@ -738,6 +738,7 @@ static const struct ptp_clock_info bcm_ptp_clock_info = {
>   	.n_per_out	= 1,
>   	.n_ext_ts	= 1,
>   	.supported_perout_flags = PTP_PEROUT_DUTY_CYCLE,
> +	.supported_extts_flags = PTP_STRICT_FLAGS | PTP_RISING_EDGE,
>   };
>   
>   static void bcm_ptp_txtstamp(struct mii_timestamper *mii_ts,
> 

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net 3/3] ptp: document behavior of PTP_STRICT_FLAGS
  2025-09-19  0:33 ` [PATCH net 3/3] ptp: document behavior of PTP_STRICT_FLAGS Jacob Keller
@ 2025-09-19 11:04   ` Vadim Fedorenko
  0 siblings, 0 replies; 12+ messages in thread
From: Vadim Fedorenko @ 2025-09-19 11:04 UTC (permalink / raw)
  To: Jacob Keller, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Kory Maincent
  Cc: Richard Cochran, Yaroslav Kolomiiets, James Clark, netdev,
	linux-kernel

On 19/09/2025 01:33, Jacob Keller wrote:
> Commit 6138e687c7b6 ("ptp: Introduce strict checking of external time stamp
> options.") added the PTP_STRICT_FLAGS to the set of flags supported for the
> external timestamp request ioctl.
> 
> It is only supported by PTP_EXTTS_REQUEST2, as it was introduced the
> introduction of the new ioctls. Further, the kernel has always set this
> flag for PTP_EXTTS_REQUEST2 regardless of whether or not the user requested
> the behavior.
> 
> This effectively means that the flag is not useful for userspace. If the
> user issues a PTP_EXTTS_REQUEST ioctl, the flag is ignored due to not being
> supported on the old ioctl. If the user issues a PTP_EXTTS_REQUEST2 ioctl,
> the flag will be set by the kernel regardless of whether the user set the
> flag in their structure.
> 
> Add a comment documenting this behavior in the uAPI header file.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> ---
>   include/uapi/linux/ptp_clock.h | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h
> index 18eefa6d93d6..2c3346e91dbe 100644
> --- a/include/uapi/linux/ptp_clock.h
> +++ b/include/uapi/linux/ptp_clock.h
> @@ -37,6 +37,9 @@
>   
>   /*
>    * flag fields valid for the new PTP_EXTTS_REQUEST2 ioctl.
> + *
> + * Note: PTP_STRICT_FLAGS is always enabled by the kernel for
> + * PTP_EXTTS_REQUEST2 regardless of whether it is set by userspace.
>    */
>   #define PTP_EXTTS_VALID_FLAGS	(PTP_ENABLE_FEATURE |	\
>   				 PTP_RISING_EDGE |	\
> 

Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net 0/3] broadcom: report the supported flags for ancillary features
  2025-09-19  0:33 [PATCH net 0/3] broadcom: report the supported flags for ancillary features Jacob Keller
                   ` (4 preceding siblings ...)
  2025-09-19  8:39 ` Kory Maincent
@ 2025-09-20  0:04 ` Jakub Kicinski
  2025-09-21  1:26   ` James Clark
  2025-09-22 19:30 ` patchwork-bot+netdevbpf
  6 siblings, 1 reply; 12+ messages in thread
From: Jakub Kicinski @ 2025-09-20  0:04 UTC (permalink / raw)
  To: James Clark
  Cc: Jacob Keller, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Paolo Abeni, Vadim Fedorenko, Kory Maincent, Richard Cochran,
	Yaroslav Kolomiiets, netdev, linux-kernel

On Thu, 18 Sep 2025 17:33:15 -0700 Jacob Keller wrote:
> James Clark reported off list that the broadcom PHY PTP driver was
> incorrectly handling PTP_EXTTS_REQUEST and PTP_PEROUT_REQUEST ioctls since
> the conversion to the .supported_*_flags fields. This series fixes the
> driver to correctly report its flags through the .supported_perout_flags
> and .supported_extts_flags fields. It also contains an update to comment
> the behavior of the PTP_STRICT_FLAGS being always enabled for
> PTP_EXTTS_REQUEST2.

James, would you be willing to test and send an official Tested-by tag?

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net 0/3] broadcom: report the supported flags for ancillary features
  2025-09-20  0:04 ` Jakub Kicinski
@ 2025-09-21  1:26   ` James Clark
  0 siblings, 0 replies; 12+ messages in thread
From: James Clark @ 2025-09-21  1:26 UTC (permalink / raw)
  To: Jakub Kicinski
  Cc: Jacob Keller, Florian Fainelli,
	Broadcom internal kernel review list, Andrew Lunn,
	Heiner Kallweit, Russell King, David S. Miller, Eric Dumazet,
	Paolo Abeni, Vadim Fedorenko, Kory Maincent, Richard Cochran,
	Yaroslav Kolomiiets, netdev, linux-kernel

On Sat, Sep 20, 2025 at 7:04 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Thu, 18 Sep 2025 17:33:15 -0700 Jacob Keller wrote:
> > James Clark reported off list that the broadcom PHY PTP driver was
> > incorrectly handling PTP_EXTTS_REQUEST and PTP_PEROUT_REQUEST ioctls since
> > the conversion to the .supported_*_flags fields. This series fixes the
> > driver to correctly report its flags through the .supported_perout_flags
> > and .supported_extts_flags fields. It also contains an update to comment
> > the behavior of the PTP_STRICT_FLAGS being always enabled for
> > PTP_EXTTS_REQUEST2.
>
> James, would you be willing to test and send an official Tested-by tag?

I have tested this on a Raspberry Pi CM4: PTP_EXTTS_REQUEST2 and
PTP_PEROUT_REQUEST2 both work. Thanks!

Going forward, I have got myself setup to be able to build and install
a vanilla kernel on a CM4, so if there is stuff that needs testing on
bcm-phy-ptp, just Cc me.

Tested-by: James Clark <jjc@jclark.com>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH net 0/3] broadcom: report the supported flags for ancillary features
  2025-09-19  0:33 [PATCH net 0/3] broadcom: report the supported flags for ancillary features Jacob Keller
                   ` (5 preceding siblings ...)
  2025-09-20  0:04 ` Jakub Kicinski
@ 2025-09-22 19:30 ` patchwork-bot+netdevbpf
  6 siblings, 0 replies; 12+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-09-22 19:30 UTC (permalink / raw)
  To: Jacob Keller
  Cc: florian.fainelli, bcm-kernel-feedback-list, andrew, hkallweit1,
	linux, davem, edumazet, kuba, pabeni, vadim.fedorenko,
	kory.maincent, richardcochran, yrk, jjc, netdev, linux-kernel

Hello:

This series was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Thu, 18 Sep 2025 17:33:15 -0700 you wrote:
> James Clark reported off list that the broadcom PHY PTP driver was
> incorrectly handling PTP_EXTTS_REQUEST and PTP_PEROUT_REQUEST ioctls since
> the conversion to the .supported_*_flags fields. This series fixes the
> driver to correctly report its flags through the .supported_perout_flags
> and .supported_extts_flags fields. It also contains an update to comment
> the behavior of the PTP_STRICT_FLAGS being always enabled for
> PTP_EXTTS_REQUEST2.
> 
> [...]

Here is the summary with links:
  - [net,1/3] broadcom: fix support for PTP_PEROUT_DUTY_CYCLE
    https://git.kernel.org/netdev/net/c/6e6c88d85623
  - [net,2/3] broadcom: fix support for PTP_EXTTS_REQUEST2 ioctl
    https://git.kernel.org/netdev/net/c/3200fdd4021d
  - [net,3/3] ptp: document behavior of PTP_STRICT_FLAGS
    https://git.kernel.org/netdev/net/c/cd875625b475

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-09-22 19:30 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-19  0:33 [PATCH net 0/3] broadcom: report the supported flags for ancillary features Jacob Keller
2025-09-19  0:33 ` [PATCH net 1/3] broadcom: fix support for PTP_PEROUT_DUTY_CYCLE Jacob Keller
2025-09-19 11:02   ` Vadim Fedorenko
2025-09-19  0:33 ` [PATCH net 2/3] broadcom: fix support for PTP_EXTTS_REQUEST2 ioctl Jacob Keller
2025-09-19 11:03   ` Vadim Fedorenko
2025-09-19  0:33 ` [PATCH net 3/3] ptp: document behavior of PTP_STRICT_FLAGS Jacob Keller
2025-09-19 11:04   ` Vadim Fedorenko
2025-09-19  2:56 ` [PATCH net 0/3] broadcom: report the supported flags for ancillary features Richard Cochran
2025-09-19  8:39 ` Kory Maincent
2025-09-20  0:04 ` Jakub Kicinski
2025-09-21  1:26   ` James Clark
2025-09-22 19:30 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).