Skip to content

Commit 207b45e

Browse files
committed
Merge branch 'broadcom-report-the-supported-flags-for-ancillary-features'
Jacob Keller says: ==================== broadcom: report the supported flags for ancillary features 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. ==================== Link: https://patch.msgid.link/20250918-jk-fix-bcm-phy-supported-flags-v1-0-747b60407c9c@intel.com Signed-off-by: Jakub Kicinski <[email protected]>
2 parents b65678c + cd87562 commit 207b45e

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

drivers/net/phy/bcm-phy-ptp.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -597,10 +597,6 @@ static int bcm_ptp_perout_locked(struct bcm_ptp_private *priv,
597597

598598
period = BCM_MAX_PERIOD_8NS; /* write nonzero value */
599599

600-
/* Reject unsupported flags */
601-
if (req->flags & ~PTP_PEROUT_DUTY_CYCLE)
602-
return -EOPNOTSUPP;
603-
604600
if (req->flags & PTP_PEROUT_DUTY_CYCLE)
605601
pulse = ktime_to_ns(ktime_set(req->on.sec, req->on.nsec));
606602
else
@@ -741,6 +737,8 @@ static const struct ptp_clock_info bcm_ptp_clock_info = {
741737
.n_pins = 1,
742738
.n_per_out = 1,
743739
.n_ext_ts = 1,
740+
.supported_perout_flags = PTP_PEROUT_DUTY_CYCLE,
741+
.supported_extts_flags = PTP_STRICT_FLAGS | PTP_RISING_EDGE,
744742
};
745743

746744
static void bcm_ptp_txtstamp(struct mii_timestamper *mii_ts,

include/uapi/linux/ptp_clock.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737

3838
/*
3939
* flag fields valid for the new PTP_EXTTS_REQUEST2 ioctl.
40+
*
41+
* Note: PTP_STRICT_FLAGS is always enabled by the kernel for
42+
* PTP_EXTTS_REQUEST2 regardless of whether it is set by userspace.
4043
*/
4144
#define PTP_EXTTS_VALID_FLAGS (PTP_ENABLE_FEATURE | \
4245
PTP_RISING_EDGE | \

0 commit comments

Comments
 (0)