Commit 6e6c88d8 authored by Jacob Keller's avatar Jacob Keller Committed by Jakub Kicinski
Browse files

broadcom: fix support for PTP_PEROUT_DUTY_CYCLE



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
d9f3e9ec ("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: default avatarJames Clark <jjc@jclark.com>
Fixes: d9f3e9ec ("net: ptp: introduce .supported_perout_flags to ptp_clock_info")
Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Reviewed-by: default avatarVadim Fedorenko <vadim.fedorenko@linux.dev>
Acked-by: default avatarRichard Cochran <richardcochran@gmail.com>
Reviewed-by: default avatarKory Maincent <kory.maincent@bootlin.com>
Tested-by: default avatarJames Clark <jjc@jclark.com>
Link: https://patch.msgid.link/20250918-jk-fix-bcm-phy-supported-flags-v1-1-747b60407c9c@intel.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent b65678ca
Loading
Loading
Loading
Loading
+1 −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,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,