Disabling an SMA input clears its mux field. Zero is also the selector for 10 MHz on FB and ADVA, so a DPLL read reports 10 MHz while sysfs reports None. The DPLL core then skips a 10 MHz request as unchanged, leaving the input disabled. Substitute SMA_DISABLE for disabled inputs before the frequency lookup, as the sysfs path already does, so the None entry reports zero Hz. The preceding initialization fix also recovers this state on rebind. For ADVA X1, the earlier combined-input fix already returns zero Hz for a zero input selector and permits later frequency changes. This patch does not fix another X1 -EINVAL failure; it uses the explicit None entry without changing that result. X1's lost state across rebind is addressed separately by the initialization fix. Source-derived tests with stubbed MMIO and the DPLL core get-before-set function reproduce the FB/ADVA disabled-input error and pass under ASan/UBSan. No physical card was tested. The issue and inaccurate incremental description were reported by Sashiko review. Codex assisted with the correction, tests and changelog. Fixes: 09eeb3aecc6c ("ptp_ocp: implement DPLL ops") Link: https://lore.kernel.org/r/179502617840.3136.12704245716223038161@kernel.org Link: https://lore.kernel.org/r/179548551472.3135.11972018356692852897@kernel.org Signed-off-by: Ahmad Byagowi --- Changes in v5: - Split the DPLL substitution from v4 patch 3's initialization fix. - Retain the DPLL introduction Fixes tag for this part only. - Correct the incremental X1 description: patch 4 already handles its zero selector; the additional zero-as-10-MHz correction is for FB/ADVA. Testing: disabled-input get/compare/set and re-enable, including the X1 series boundary. Stubbed MMIO only, no physical card test. 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 c4c9d3501edf..e27abe2c24c7 100644 --- a/drivers/ptp/ptp_ocp.c +++ b/drivers/ptp/ptp_ocp.c @@ -5897,6 +5897,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) {