Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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
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>
Reviewed-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
Acked-by: Richard Cochran <richardcochran@gmail.com>
Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>
Tested-by: James Clark <jjc@jclark.com>
Link: https://patch.msgid.link/20250918-jk-fix-bcm-phy-supported-flags-v1-1-747b60407c9c@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Jacob Keller and committed by
Jakub Kicinski
6e6c88d8 b65678ca

+1 -4
+1 -4
drivers/net/phy/bcm-phy-ptp.c
··· 597 597 598 598 period = BCM_MAX_PERIOD_8NS; /* write nonzero value */ 599 599 600 - /* Reject unsupported flags */ 601 - if (req->flags & ~PTP_PEROUT_DUTY_CYCLE) 602 - return -EOPNOTSUPP; 603 - 604 600 if (req->flags & PTP_PEROUT_DUTY_CYCLE) 605 601 pulse = ktime_to_ns(ktime_set(req->on.sec, req->on.nsec)); 606 602 else ··· 737 741 .n_pins = 1, 738 742 .n_per_out = 1, 739 743 .n_ext_ts = 1, 744 + .supported_perout_flags = PTP_PEROUT_DUTY_CYCLE, 740 745 }; 741 746 742 747 static void bcm_ptp_txtstamp(struct mii_timestamper *mii_ts,