Commit 207b45e8 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files

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: default avatarJakub Kicinski <kuba@kernel.org>
parents b65678ca cd875625
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -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,8 @@ 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,
	.supported_extts_flags = PTP_STRICT_FLAGS | PTP_RISING_EDGE,
};

static void bcm_ptp_txtstamp(struct mii_timestamper *mii_ts,
+3 −0
Original line number Diff line number Diff line
@@ -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 |	\