Skip to content

Commit af2b428

Browse files
jacob-kellerPaolo Abeni
authored andcommitted
broadcom: fix supported flag check in periodic output function
In bcm_ptp_perout_locked, the driver rejects requests which have PTP_PEROUT_PHASE set. This appears to be an attempt to reject any unsupported flags. Unfortunately, this only checks one flag, but does not protect against PTP_PEROUT_ONE_SHOT, or any future flags which may be added. Fix the check to ensure that no flag other than the supported PTP_PEROUT_DUTY_CYCLE is set. Fixes: 7bfe91e ("net: phy: Add support for 1PPS out and external timestamps") Signed-off-by: Jacob Keller <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/20250312-jk-net-fixes-supported-extts-flags-v2-4-ea930ba82459@intel.com Signed-off-by: Paolo Abeni <[email protected]>
1 parent c0b4ddd commit af2b428

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,8 @@ static int bcm_ptp_perout_locked(struct bcm_ptp_private *priv,
597597

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

600-
if (req->flags & PTP_PEROUT_PHASE)
600+
/* Reject unsupported flags */
601+
if (req->flags & ~PTP_PEROUT_DUTY_CYCLE)
601602
return -EOPNOTSUPP;
602603

603604
if (req->flags & PTP_PEROUT_DUTY_CYCLE)

0 commit comments

Comments
 (0)