[PATCH net v6 5/8] ptp: ocp: report disabled SMA inputs as zero Hz

From: Ahmad Byagowi

Date: Thu Nov 26 2026 - 11:43:07 EST


From: ahmadexp <ahmadexp@xxxxxxxxx>

A disabled SMA input has no active signal and should report zero frequency through DPLL. The DPLL core reads the current frequency before applying a new value, so reporting the stale selector frequency can prevent a disabled input from being re-enabled.

Report zero for disabled input pins while leaving output and enabled-input reporting unchanged. This complements the separate initialization fix for preserving disabled state across rebind.

A coding assistant helped check the DPLL get-before-set behavior, develop the regression test and prepare this changelog.

Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops")
Signed-off-by: Ahmad Byagowi <ahmadexp@xxxxxxxxx>
---
drivers/ptp/ptp_ocp.c | 2 ++
1 file changed, 2 insertions(+)

diff --git a/drivers/ptp/ptp_ocp.c b/drivers/ptp/ptp_ocp.c
index aa18c5e5eba4..3457c351958d 100644
--- a/drivers/ptp/ptp_ocp.c
+++ b/drivers/ptp/ptp_ocp.c
@@ -5924,6 +5924,8 @@ static int ptp_ocp_dpll_frequency_get(const struct dpll_pin *pin,

val = bp->sma_op->get(bp, sma_nr + 1);
val &= SMA_SELECT_MASK;
+ if (sma->mode == SMA_MODE_IN && sma->disabled)
+ val = SMA_DISABLE;
tbl = bp->sma_op->tbl[sma->mode];
for (i = 0; tbl[i].name; i++)
if (val == tbl[i].value) {
--
2.54.0 (Apple Git-157)