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=1796255580; b=rWjEAoFtyLMkZUp3+ZGFrHRY1ml8BEXkSbpttMCxxckvLlU2tQlpYCEgzaQf/Hw4hP/5 ZlmfIIsBV3vYsqni7PrFH71PmIFc5xk+WHgXLBLpbait4TfJ3u/M9twqnleTrmNEXvRYL Az1Ka75fCeGtUqoKUfDj6CFwaAus06Xy+DQpgSMzDldQeWB8TZeIiZ7Z/cMmRQ7OaXOCY 57F4j/mknqzQXvTBKOsmyKxo/rGNAyCNEaTtsA8CB34BffDQDfzBOGek7ugIu4xJYsNDG 1Z6SOzWzsdJuCIBgIj0rDEw/x6FLgwdYh36ihhoXfpZwgrgMH+zRQnNvI8CQgy5qxqA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796255580; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=UrMksgEMHxut7PXCyKUiRA7EylNnPv/PU2aemFg03m0=; b=Y5D8TnfeJqMrHhmXjsuMR+UBxnsyDdd1sUmdVSjtKUIG7YtvLKkZnkmQyfsolceblA6u 8qiN3gRHB38L4hn127QHEXKJ+OiC5mIxXnbrpEihhgkRMEc1Bsz4qYAoiNIttMHLGO8yo PKE2UvRXHr8YE5DPvsWNwX/Il65fIas1Lj1jtexmJv6Hzr3t2NF/uxURuNN48CeOm9Fz7 S8QgRzhSUYXMKsq77XxtdUUUc690hsxxCuml88BAV5GsY/7GB9N9oQYzfZ3bF5jKX2bDx Wnq7kaxuPuUmDzP8hm5ieMAdwRJXfNMT9iKzQsPpLQSKKKko0RVPFVTHJCDb+g5/GMA== 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=a+W+kZcG; 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 D15B3606A330 for ; Wed, 2 Dec 2026 23:53:00 +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=a+W+kZcG Received: by smtp.kernel.org (Postfix) with ESMTPSA id D79281F00897; Wed, 2 Dec 2026 23:52:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796255580; bh=UrMksgEMHxut7PXCyKUiRA7EylNnPv/PU2aemFg03m0=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=a+W+kZcGGcnfzY45oojTw70WqAjNzkO1T0Zc7Pt/nirtGZzY+v8E22jjhFwnRjOGp 3IeRfpebqsvNShK1xjQtJFGRisvBw/Jk6+ewjJn1F5BgI1xsNqsHYi376Rjd4W+AOl vywbxZQPacY3PLocpyRjaASvl8cP3X2qmXQEumlV3Qus0IUR8JWqnt/C10fx+eDyAM Amiv2che29x09hZdYPCDwGxOxzaUFEe/GjV1O6h3pVz36E1SF7JFO1GQQZJjliVYhW oTlLAjxK1OddY/yH3Eenoh50o0JxWtrHldXSmiPG5d/afyDK8cRrr+eClEX9dDEGnj 8RVzRfkCMc9Pg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net-next v17 11/13] dpll: sit9531x: add support to adjust output phase Reply-To: sashiko-reviews@lists.linux.dev To: "Ali Rouhi" Cc: =?utf-8?b?ZGV2aWNldHJlZUB2Z2VyLmtlcm5lbC5vcmc=?= , robh@kernel.org, conor+dt@kernel.org In-Reply-To: <20261201235202.97645-12-arouhi@sitime.com> References: <20261201235202.97645-1-arouhi@sitime.com> <20261201235202.97645-12-arouhi@sitime.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 23:52:59 +0000 X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Medium] dpll: sit9531x: missed error-path notifications on output phase adjust -- commit f7ad586c8e835e06e0aa7cf8709834f57ca7e16b Author: Oleg Zadorozhnyi dpll: sit9531x: add support to adjust output phase This commit adds output phase-adjust get and set support to the sit9531x DPLL driver, including delay quantization, re-timing across output rate changes, and poll/removal retries for pending phase updates and flushes. > diff --git a/drivers/dpll/sit9531x/dpll.c b/drivers/dpll/sit9531x/dpll.c > index b0403c0bc1320..502b25f22be4a 100644 > --- 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 s= truct dpll_pin *pin, > return rc; > } > =20 > +/* > + * Report the delay as programmed after quantization, including one whos= e 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 =3D pin_priv; > + struct sit9531x_dpll *sitdpll =3D dpll_priv; > + struct sit9531x_dev *sitdev =3D 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 =3D sit9531x_output_phase_read(sitdev, dpin->id, &phase_ps, > + &beyond); > + /* -ENODATA: no delay value; another error fails the pin dump */ > + if (rc && rc !=3D -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 =3D rc =3D=3D -ENODATA; > + if (!rc) { > + sitdev->out[dpin->id].phase_adj =3D phase_ps; > + sitdev->out[dpin->id].phase_armed =3D !beyond && phase_ps; > + } > + sitdev->out[dpin->id].phase_stale =3D false; > + } > + none =3D sit9531x_out_state_get(sitdev, dpin->id)->phase_none; > + phase_adj =3D 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 =3D 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 =3D pin_priv; > + struct sit9531x_dpll *sitdpll =3D dpll_priv; > + struct sit9531x_dev *sitdev =3D sitdpll->dev; > + const struct sit9531x_out *out; > + bool moved; > + s64 was; > + int rc; > + > + out =3D sit9531x_out_state_get(sitdev, dpin->id); > + > + mutex_lock(&sitdev->multiop_lock); > + was =3D out->phase_adj; > + rc =3D sit9531x_output_phase_adjust_set(sitdev, dpin->id, phase_adjust); > + moved =3D out->phase_adj !=3D 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 =3D 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 =3D true; > + mutex_unlock(&sitdev->multiop_lock); > + } > + } > + > + return rc; > +} [Severity: Medium] Can the error-path notification in sit9531x_dpll_output_pin_phase_adjust_se= t() (and sit9531x_dpll_output_pin_frequency_set()) leave out->phase_stale set without arming out->ntf_pending? When a setter fails after touching the hardware registers, out->phase_stale= is set and the error path calls __dpll_pin_change_ntf(). That invokes sit9531x_dpll_output_pin_phase_adjust_get(), which tries to refresh out->phase_stale via sit9531x_output_phase_read(). If that I2C read also fa= ils, sit9531x_dpll_output_pin_phase_adjust_get() leaves out->phase_stale set and returns -ENODATA. Because dpll_msg_add_pin_phase_adjust() treats -ENODATA a= s 0 and omits the attribute, __dpll_pin_change_ntf() returns 0, so out->ntf_pen= ding is never armed and sit9531x_dpll_output_ntf_pending() will not retry the notification once the bus recovers. Also, moved only compares out->phase_adj !=3D was || out->phase_stale, with= out checking whether out->phase_none or out->retime_pending changed. If one of those flags was set while out->phase_adj still held its previous value, and= a new request latches a delay equal to was (clearing phase_none and retime_pending) before failing at the phase flush, moved is false and no notification is sent even though the phase-adjust attribute transitioned fr= om absent to present. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201235202.9764= 5-1-arouhi@sitime.com?part=3D11