From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796258357; b=MyRZi8P/OvByb4UjTdTjaykDASlU3gAS4nnHjVoDC8S84PmeU52O0MD7t6f6BC8xj20x AX86I8qUYbAuaxrffSnXmlYOzPyJzR+EfnyjNLDfbaHTcFJcmb03y5GReDU39PUdmZiJ/ cf9Kygpchz44CaFxDPnFmFcgpwST2ULiJAP60n/OnCyVsw7rZpXDK7EGfqTSvMgYHS+IJ wMZ1nILi4wQDNvnWmKG24McXtMF+QS/o1Ski2GFu1uNHP6YPIR7TeyqMNWvy4hVSHtLll IwIZvTEMUVkteSO0t8eIfa0IMHkxVuF3s+D6y+BSv1n6ZQjXK3HZ5x83/NwILjkHT6w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796258357; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=jLv4B+aRlgMTZvgTMzJH1O1ICO5tfTR47Lq9M7LnIPg=; b=euBKaJrAgBcK0cFSiMalFDypzVO+2rMhOzARluRw4nGyx8g7GSiIXHZf1VbELGWN8KAS dqBA7mqJrtsQqm1AKSV5OawCkzzxoCgyZEDmC1QY7i8T+8hswBa+X5XqanQq9ZDaMsQO8 OUqsUwIoh1gckEKVWjW32hflgX9268FLRDKdV2YC7ZAElOZ252RI9rqUP9CQt/6N78gG6 1bxtllKmpriRvxj1JRHF+X4ZSqeNvp5tqs31GdXTM1mQFq5djBYGkzSa0eCVnBu+pbKbS d1wNQ4rm3160hZSTMBxc8ZcJ6sPuKyLDD9ZZvijQlF3phELZl098azbf7GSb9DMZP5A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="OkBaw/8Y"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8280F606A6B1; Thu, 3 Dec 2026 00:39:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=OkBaw/8Y Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5840C1F00934; Thu, 3 Dec 2026 00:39:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796258357; bh=jLv4B+aRlgMTZvgTMzJH1O1ICO5tfTR47Lq9M7LnIPg=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=OkBaw/8YFeVtDlM9A1zFTSU8pIEOqHqye5Oy3mLKovzlvPEhTlBGpZlOKC2KQg4Kr c0EB5dBT7nqsKG0/Y0h7GkDmHtACFIKo2kCZqjjS7htnKzd8cX/oYY6OsKjKD6P+Fk a1A96G+90WoxvSpPh/AMlbzRp88HfXqAPYIkPJMyVoqLEw1Gv6+YQJaxLCDprcGI1Y hqXvXPQ9hzB2qj0KHRIc6yQhXJEQvQbtWMTWbH0Ua/AcQPYJyI2KuUFXnhJ90QaxvQ q3Ixfx9lTyGPmuyoAy085SC4aHAbYH/NqZm9AfV4CzmufAi7rP0/I6FZ2/n9h+VVXb arGHnU+879s/w== Subject: Re: [PATCH net-next v17 11/13] dpll: sit9531x: add support to adjust output phase From: netdev-bot+sashiko@kernel.org To: arouhi@sitime.com Cc: jiri@resnulli.us, ivecera@redhat.com, vadim.fedorenko@linux.dev, arkadiusz.kubalewski@intel.com, kuba@kernel.org, pabeni@redhat.com, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, prabhakar.mahadev-lad.rj@bp.renesas.com, cjubran@nvidia.com, Oleg.Zadorozhnyi@devoxsoftware.com, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Date: Thu, 03 Dec 2026 00:39:15 +0000 Message-ID: <179625835589.3146.5844059944628280062@kernel.org> In-Reply-To: <20261201235202.97645-12-arouhi@sitime.com> References: <20261201235202.97645-12-arouhi@sitime.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found 8 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 6 · Low: 2 If you believe none of the issues are legitimate, please reply to each issue of Medium severity or higher and explain why the AI is wrong. If any of them are legitimate and you plan to respin, please let patchwork know by including "pw-bot: cr" as a separate line at the end of your reply (one such reply per series is enough). - [Medium] sit9531x_resume() in drivers/dpll/sit9531x/core.c is not updated for the state this patch adds. - [Medium] The phase-adjust uAPI attributes do not describe what the output pins do. - [Medium] In sit9531x_output_phase_adjust_set() (core.c:2637-2646), the PRG_RST_DELAY byte write can fail and its rollback in… - [Medium] sit9531x_output_phase_adjust_set() writes the PRG_RST_DELAY bytes and then SIT9531X_SMALL_UPDATE_CMD (0x02) to… - [Medium] The latch sequence for PRG_RST_DELAY differs between the two write paths. - [Medium] dpll: sit9531x: missed error-path notifications on output phase adjust - [Low] The kernel-doc of sit9531x_output_phase_read() (core.c) says the stored delay 'reads back in the form nearer to zero, as an advance… - [Low] The core.h doc of @phase_none says 'a delay or rate request that finds an Fvco clears it'. -- dpll: sit9531x: add support to adjust output phase This adds phase_adjust_get/set ops for the sit9531x output pins. They program the per-output PRG_RST_DELAY block as VCO cycles plus 30 ps fine steps, and a rate change re-encodes the delay for the new period inside the divider programming window. The poll and removal paths retry pending delay writes, divider flushes and flush undo steps. > diff --git a/drivers/dpll/sit9531x/core.c b/drivers/dpll/sit9531x/core.c > index 3316e3761e16d..96d317c9bf370 100644 > --- a/drivers/dpll/sit9531x/core.c > +++ b/drivers/dpll/sit9531x/core.c [ ... ] > @@ -1962,12 +2036,361 @@ static int sit9531x_output_divo_read(struct sit9531x_dev *sitdev, u8 out_idx, [ ... ] > +/** > + * sit9531x_output_phase_read - read an output's programmed delay back > + * @sitdev: device pointer > + * @out_idx: logical output index > + * @phase_ps: result in picoseconds > + * @beyond: set when @phase_ps is outside the advertised range > + * > + * An advance is stored as the period minus the advance; the stored delay reads > + * back in the form nearer to zero, as an advance when it is more than half the > + * period. Caller must hold sitdev->multiop_lock. [ ... ] > + if (!rc) { > + u64 t_out_ps = mul_u64_u64_div_u64(divo, 1000000000000ULL, > + fvco); > + > + if (ps >= t_out_ps) > + ps -= t_out_ps; > + if (ps > t_out_ps - ps && > + t_out_ps - ps <= SIT9531X_OUT_PHASE_ADJ_MAX_PS) { > + *phase_ps = -(s64)(t_out_ps - ps); > + return 0; > + } > + } > + *beyond = ps > SIT9531X_OUT_PHASE_ADJ_MAX_PS; > + *phase_ps = ps; [Severity: Low] Does the kernel-doc above match this code? The code uses the advance form only when the complement also fits within SIT9531X_OUT_PHASE_ADJ_MAX_PS: if (ps > t_out_ps - ps && t_out_ps - ps <= SIT9531X_OUT_PHASE_ADJ_MAX_PS) { Take an output with a period above 2 ms (below 500 Hz, such as 1 PPS) and a delay above half the period whose complement is more than 1 ms. That delay reads back as a large positive value with *beyond set, not in the form nearer to zero. The comment in sit9531x_output_phase_encode() ("Report the form nearer to zero, as the readback does") also leaves out this condition. The @phase_adj doc in core.h ("an out-of-range profile delay is held as the positive decode") does match the code. Could these comments be made to agree with each other and with the code? [ ... ] > @@ -1976,28 +2399,120 @@ int sit9531x_output_freq_set(struct sit9531x_dev *sitdev, u8 out_idx, [ ... ] > rc = sit9531x_prg_enter(sitdev); > if (rc) > return rc; > > rc = sit9531x_output_divo_write(sitdev, out_idx, divo, &back); > - /* NVM update and loop lock */ > - ret = sit9531x_prg_commit(sitdev); > + landed = !back; > + divo_in = !rc; > + if (!rc && retime) { > + rc = sit9531x_output_phase_bytes_write(sitdev, out_idx, > + new_bytes, old_bytes, > + &bytes_back); > + if (rc) { > + divo_back = bytes_back && > + !sit9531x_output_divo_write(sitdev, out_idx, > + old_divo, &back); > + landed = !divo_back; > + } else { > + bytes_in = true; > + } > + } > + /* Leave PRG_CMD; the bank update only for a divider that changed */ > + ret = landed ? sit9531x_prg_commit(sitdev) : > + sit9531x_prg_relock(sitdev); [Severity: Medium] Is the rewritten PRG_RST_DELAY block actually latched on this path? sit9531x_output_phase_adjust_set() follows Dely_program_output.py. It writes the same five bytes, then issues SIT9531X_SMALL_UPDATE_CMD to SIT9531X_REG_PRG_DIR_GEN, then flushes. This path writes the bytes inside the PRG_CMD window. They are followed only by sit9531x_prg_commit() (UPDATE_NVM_BANK, LOOP_LOCK, key close) and then sit9531x_output_phase_flush(). No small-change update is issued. The only reference given for the bank update is the divider-change flow. Nothing in the driver shows that UPDATE_NVM_BANK also latches the delay block. If it doesn't, the flush after a rate change realigns the dividers with the delay still encoded for the old period. Meanwhile out->phase_adj records the new encoding with phase_stale cleared. A later phase adjust request for the same value would then see same set, because the register bytes already match, and skip the write. Would the active delay ever get corrected in that case? [ ... ] > @@ -2041,6 +2556,137 @@ int sit9531x_output_freq_get(struct sit9531x_dev *sitdev, u8 out_idx, [ ... ] > + if (!same) { > + /* > + * Order of Dely_program_output.py: the bytes on page 3 or 4 > + * under the Page 3 debug key, the small-change update on page 3 > + * for either page, then the flush with no wait. Only a divider > + * rewrite needs the programming state. > + */ > + rc = sit9531x_outsys_debug_open(sitdev); > + if (rc) > + return rc; > + > + rc = sit9531x_output_phase_bytes_write(sitdev, out_idx, > + new_bytes, old_bytes, > + &bytes_back); > + bytes_in = !rc; > + if (!rc) > + rc = sit9531x_write_u8(sitdev, SIT9531X_REG_PRG_DIR_GEN, > + SIT9531X_SMALL_UPDATE_CMD); > + sit9531x_outsys_debug_close(sitdev); > + if (rc) { > + if (bytes_in) { > + out->phase_stale = true; > + out->retime_ps = phase_ps; > + out->retime_pending = true; > + } else if (!bytes_back) { > + out->phase_stale = true; > + chan->flush_pending = true; > + } [Severity: Medium] What rewrites the delay block when the byte write and its rollback both fail? In that case sit9531x_output_phase_bytes_write() returns with bytes_back false and the block "part old and part new". This branch sets phase_stale and chan->flush_pending. It sets neither retime_pending nor retime_ps, so sit9531x_retime_retry() returns early: if (!out->retime_pending) return; The poll's sit9531x_flush_retry() still pulses the flush on this PLL. Two later events could make the mixed bytes live. One is any later SIT9531X_SMALL_UPDATE_CMD to PRG_DIR_GEN, which the comment above says applies "for either page", for example a delay set on another output. The other is a bank update from a later rate change. A later sit9531x_output_freq_set() would also decode the mixed bytes as the current delay and re-encode them. The same failure in sit9531x_output_freq_set() does arm the retry: } else if (retime && landed) { out->retime_ps = held; out->retime_pending = true; Should this branch also set retime_ps and retime_pending so the poll repairs the block? This is still unchanged at the end of the series. > + return rc; > + } > + } > + > + /* > + * A flush pulse into open loops can be lost when they re-lock, and a > + * bank update after it changes the dividers again. > + */ > + if (sitdev->bank_pending || sitdev->loops_open) { > + rc = sit9531x_prg_retry(sitdev); > + if (rc) { > + chan->flush_pending = true; > + goto cache; > + } > + } [Severity: Medium] Is it safe to write SIT9531X_SMALL_UPDATE_CMD to SIT9531X_REG_PRG_DIR_GEN above before this loops_open / bank_pending recovery runs? PRG_DIR_GEN is the same whole-byte directive register that carries SIT9531X_PRG_CMD_STATE, SIT9531X_UPDATE_NVM_BANK and SIT9531X_LOOP_LOCK. If every LOOP_LOCK write in sit9531x_prg_relock() fails, loops_open is set and the output system stays in the programming state with its loops open. sit9531x_dev_chan_states_update() and sit9531x_dev_stop() both call sit9531x_retime_retry() even when their own prg_retry failed. A netlink request can also arrive in that state. The small-change directive would then overwrite the programming directive while the loops are open. The driver doesn't document how the part handles that. Could the delay fail to latch while the cache records it as applied? Could the part leave PRG_CMD without LOOP_LOCK? Would moving the sit9531x_prg_retry() check ahead of the byte write avoid this? [ ... ] > @@ -2605,6 +3254,24 @@ static int sit9531x_dev_state_fetch(struct sit9531x_dev *sitdev) > "Failed to fetch output %u state: %d\n", i, rc); > return rc; > } > + > + /* > + * The profile can set a delay; read it so a request of 0 ps can > + * clear it. > + */ > + mutex_lock(&sitdev->multiop_lock); > + rc = sit9531x_output_phase_read(sitdev, i, &phase_ps, &beyond); > + mutex_unlock(&sitdev->multiop_lock); > + sitdev->out[i].phase_none = rc == -ENODATA; > + if (!rc) { > + sitdev->out[i].phase_adj = phase_ps; > + sitdev->out[i].phase_armed = !beyond && phase_ps; > + } else if (rc != -ENODATA) { > + dev_err(sitdev->dev, > + "Failed to read output %u delay: %d\n", > + i, rc); > + return rc; > + } [Severity: Medium] Should sit9531x_resume() repeat this read? Resume assumes the part may have lost power and reloaded its profile. It re-reads input modes, PLL state and output state. Nothing there refreshes the new state, and it doesn't set phase_stale. That state is: out->phase_adj, phase_armed, phase_none out->retime_pending, retime_ps chan->flush_pending the flush_ctrl/flush_ctrl_pending/flush_arm_pending/flush_armed record After a profile reload over suspend, at this point in the series: - sit9531x_dpll_output_pin_phase_adjust_get() reads the hardware only when phase_stale is set, so it reports the pre-suspend phase_adj. - dpll_pin_phase_adj_set() in the core then skips a request for that same value because it looks unchanged. - phase_armed stays set, so the next sit9531x_output_freq_set() re-encodes and writes the stale delay. - A leftover flush_ctrl_pending or flush_arm_pending is replayed from the poll by sit9531x_phase_flush_undo_retry(). That writes the pre-suspend GPIO_FUNC_CTRL1 byte, which also holds the OEb bits, and the pre-suspend PHFL enables over the reloaded profile. The last patch of the series, "dpll: sit9531x: model the inter-PLL sync line as a pair of pins", appears to fix this. Its sit9531x_resume() re-reads every output delay through sit9531x_output_phase_read(). It also drops flush_pending, flush_arm_pending, flush_ctrl_pending, and any retime_pending that sit9531x_retime_kept() does not keep. Could that handling be moved into this patch so each step of the series handles resume correctly? [ ... ] > diff --git a/drivers/dpll/sit9531x/core.h b/drivers/dpll/sit9531x/core.h > index 3c2a312f392cc..562c63ee117d3 100644 > --- a/drivers/dpll/sit9531x/core.h > +++ b/drivers/dpll/sit9531x/core.h [ ... ] > @@ -128,6 +130,17 @@ struct sit9531x_ref { > * @routed: mapped to @pll_idx by the loaded configuration; an output > * unrouted at probe has no pin > * @pll_idx: PLL driving this output (0-3) > + * @phase_stale: programmed delay may differ from @phase_adj > + * @phase_none: the last delay read found no valid Fvco on the PLL, so the > + * output has no delay value and the getter leaves the attribute out; a > + * delay or rate request that finds an Fvco clears it [Severity: Low] Does the code match "a delay or rate request that finds an Fvco clears it"? sit9531x_output_phase_adjust_set() clears phase_none only at the cache: label. These paths return after sit9531x_get_fvco() has succeeded but before reaching that label: a failed sit9531x_output_divo_read() -ERANGE from sit9531x_output_phase_encode() a failed sit9531x_output_phase_bytes_read() a failed sit9531x_outsys_debug_open() a failed byte write that was rolled back In sit9531x_output_freq_set(), sit9531x_output_divo_calc() has already found an Fvco. An I/O error from sit9531x_output_phase_read() still returns there without clearing phase_none. None of these paths set phase_stale, so the getter doesn't re-read. It keeps leaving the attribute out until a later request succeeds. [ ... ] > diff --git a/drivers/dpll/sit9531x/prop.c b/drivers/dpll/sit9531x/prop.c > index 15294d07b703f..4f4d52dd284db 100644 > --- a/drivers/dpll/sit9531x/prop.c > +++ b/drivers/dpll/sit9531x/prop.c > @@ -188,6 +188,22 @@ sit9531x_pin_props_get(struct sit9531x_dev *sitdev, > props->dpll_props.capabilities = > DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE; > curr_freq = 0; > + > + /* > + * The part takes a delay anywhere within the output period; > + * +/-1 ms is a round figure within the s32 ps attribute. > + */ > + props->dpll_props.phase_range.min = > + -SIT9531X_OUT_PHASE_ADJ_MAX_PS; > + props->dpll_props.phase_range.max = > + SIT9531X_OUT_PHASE_ADJ_MAX_PS; > + /* > + * The delay grid is whole VCO cycles of the output's PLL plus > + * 30 ps steps, so it depends on the PLL; a request in 1 ps > + * units is programmed as the nearest grid point within the > + * range, which is reported. > + */ > + props->dpll_props.phase_gran = 1; [Severity: Medium] Do these attributes describe what the output pins actually do? Every output gets phase_range = +/-1e9 ps and phase_gran = 1, whatever its PLL or rate. Documentation/netlink/specs/dpll.yaml says of phase-adjust-gran: "The value of phase adjustment must be a multiple of this granularity." In practice: 1) sit9531x_output_phase_encode() quantizes every request to whole VCO cycles plus 30 ps steps. A set followed by a get therefore usually returns a different value. zl3073x, by comparison, advertises its real step. 2) The same function folds a request modulo the output period and still returns success. 3) sit9531x_output_phase_read() can return a decoded delay above 1e9 ps with *beyond set. sit9531x_dpll_output_pin_phase_adjust_get() leaves the attribute out only above S32_MAX: if (none || phase_adj > S32_MAX) return -ENODATA; A profile delay between 1e9 and S32_MAX is possible on a low-rate output such as 1 PPS, where the 34-bit coarse field allows seconds. It is then reported in the same message as a PHASE_ADJUST_MAX of 1e9. Writing that reported value back fails in dpll_pin_phase_adj_set() with -EINVAL and "phase adjust value of out range": if (phase_adj > pin->prop.phase_range.max || phase_adj < pin->prop.phase_range.min) { This is still the same at the end of the series. > } > > sit9531x_prop_pin_package_label_set(sitdev, props, dir, index); [ ... ] > diff --git a/drivers/dpll/sit9531x/dpll.c b/drivers/dpll/sit9531x/dpll.c > --- a/drivers/dpll/sit9531x/dpll.c > +++ b/drivers/dpll/sit9531x/dpll.c > @@ -790,12 +794,119 @@ sit9531x_dpll_output_pin_state_on_dpll_set(const struct dpll_pin *pin, > return rc; > } > > +/* > + * Report the delay as programmed after quantization, including one whose flush > + * is pending. An output whose PLL has no valid Fvco has no delay value. > + */ > +static int > +sit9531x_dpll_output_pin_phase_adjust_get(const struct dpll_pin *pin, > + void *pin_priv, > + const struct dpll_device *dpll, > + void *dpll_priv, s32 *phase_adjust, > + struct netlink_ext_ack *extack) > +{ > + struct sit9531x_dpll_pin *dpin = pin_priv; > + struct sit9531x_dpll *sitdpll = dpll_priv; > + struct sit9531x_dev *sitdev = sitdpll->dev; > + s64 phase_adj; > + bool none; > + int rc; > + > + mutex_lock(&sitdev->multiop_lock); > + /* > + * A pending re-time has no delay to report: its bytes are for the old > + * rate or wait for their small-change update. With no value the core > + * passes every request on, the old delay included. > + */ > + if (sitdev->out[dpin->id].retime_pending) { > + mutex_unlock(&sitdev->multiop_lock); > + return -ENODATA; > + } > + if (sitdev->out[dpin->id].phase_stale) { > + bool beyond; > + s64 phase_ps; > + > + rc = sit9531x_output_phase_read(sitdev, dpin->id, &phase_ps, > + &beyond); > + /* -ENODATA: no delay value; another error fails the pin dump */ > + if (rc && rc != -ENODATA) { > + mutex_unlock(&sitdev->multiop_lock); > + dev_warn_ratelimited(sitdev->dev, > + "out%u: delay not read back: %d\n", > + dpin->id, rc); > + return -ENODATA; > + } > + sitdev->out[dpin->id].phase_none = rc == -ENODATA; > + if (!rc) { > + sitdev->out[dpin->id].phase_adj = phase_ps; > + sitdev->out[dpin->id].phase_armed = !beyond && phase_ps; > + } > + sitdev->out[dpin->id].phase_stale = false; > + } > + none = sit9531x_out_state_get(sitdev, dpin->id)->phase_none; > + phase_adj = sit9531x_out_state_get(sitdev, dpin->id)->phase_adj; > + mutex_unlock(&sitdev->multiop_lock); > + > + /* > + * A delay found on the part is reported as found, also beyond the > + * advertised range, which bounds a request; one beyond the s32 > + * attribute is left out. > + */ > + if (none || phase_adj > S32_MAX) > + return -ENODATA; > + *phase_adjust = phase_adj; > + > + return 0; > +} > + > +/* Program the per-output PRG_RST_DELAY registers */ > +static int > +sit9531x_dpll_output_pin_phase_adjust_set(const struct dpll_pin *pin, > + void *pin_priv, > + const struct dpll_device *dpll, > + void *dpll_priv, s32 phase_adjust, > + struct netlink_ext_ack *extack) > +{ > + struct sit9531x_dpll_pin *dpin = pin_priv; > + struct sit9531x_dpll *sitdpll = dpll_priv; > + struct sit9531x_dev *sitdev = sitdpll->dev; > + const struct sit9531x_out *out; > + bool moved; > + s64 was; > + int rc; > + > + out = sit9531x_out_state_get(sitdev, dpin->id); > + > + mutex_lock(&sitdev->multiop_lock); > + was = out->phase_adj; > + rc = sit9531x_output_phase_adjust_set(sitdev, dpin->id, phase_adjust); > + moved = out->phase_adj != was || out->phase_stale; > + mutex_unlock(&sitdev->multiop_lock); > + > + if (rc) { > + struct dpll_pin *dpll_pin; > + > + NL_SET_ERR_MSG(extack, "Phase adjust failed"); > + /* The core notifies only a request that succeeded */ > + dpll_pin = READ_ONCE(dpin->dpll_pin); > + if (moved && dpll_pin && __dpll_pin_change_ntf(dpll_pin)) { > + mutex_lock(&sitdev->multiop_lock); > + sitdev->out[dpin->id].ntf_pending = true; > + mutex_unlock(&sitdev->multiop_lock); > + } > + } > + > + return rc; > +} > + > static const struct dpll_pin_ops sit9531x_dpll_output_pin_ops = { > .direction_get = sit9531x_dpll_output_pin_direction_get, > .frequency_get = sit9531x_dpll_output_pin_frequency_get, > .frequency_set = sit9531x_dpll_output_pin_frequency_set, > .state_on_dpll_get = sit9531x_dpll_output_pin_state_on_dpll_get, > .state_on_dpll_set = sit9531x_dpll_output_pin_state_on_dpll_set, > + .phase_adjust_get = sit9531x_dpll_output_pin_phase_adjust_get, > + .phase_adjust_set = sit9531x_dpll_output_pin_phase_adjust_set, > }; > > const struct dpll_pin_ops * [Severity: Medium] Can a change made on this error path go unreported? The driver re-arms ntf_pending only when __dpll_pin_change_ntf() itself returns an error. That does not cover a hardware readback that fails inside the notification. Take a byte write in sit9531x_output_phase_adjust_set() whose rollback also fails. That leaves out->phase_stale set with retime_pending clear, so moved is true and __dpll_pin_change_ntf() runs. It reaches sit9531x_dpll_output_pin_phase_adjust_get(), which sees phase_stale and calls sit9531x_output_phase_read(). If that read hits another I2C error, the getter returns -ENODATA and phase_stale stays set. The core treats -ENODATA as an absent attribute. The message goes out without DPLL_A_PIN_PHASE_ADJUST and __dpll_pin_change_ntf() returns 0. ntf_pending stays clear, so a later poll returns early from sit9531x_dpll_output_ntf_pending() and never refreshes phase_stale or sends the corrected value once the bus recovers. sit9531x_dpll_output_pin_frequency_set() has the same pattern after a failed sit9531x_output_freq_set() that leaves phase_stale set. The moved test also misses a change that leaves phase_adj alone. While retime_pending or phase_none is set, the getter returns -ENODATA but out->phase_adj keeps its old value. A later request whose quantized delay matches that old value clears both flags at the cache: label of sit9531x_output_phase_adjust_set(), and can still return an error when chan->flush_pending is set by a failed flush or sit9531x_prg_retry(). moved is then false and no notification goes out, although the attribute went from absent to present. The bytes_in branch of the error block in sit9531x_output_freq_set() can do the same. Should the error paths set ntf_pending whenever phase_stale is still set after the notification, and fold phase_none and retime_pending into the before and after comparison? -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201235202.97645-1-arouhi%40sitime.com