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=1796255579; b=R+GhVGxKmdW/VTidqIMYNJSyrL6MTTY9Qt/zJBp4H3TP8h8yzEfdBbaD5+yzDu73Y72h ilL87GjLKYT1bVXoAGeHIgaaxx60hzvk91SP44qA3cqXLVrQDrtFtb6tqCKpvT7ostKrF 3etZuijZ0jY0ZzkKCjwgxKcMIQjapok1lajouzUhC9uUkCzh4c102PcgzBKgPRaUNvq1p eUx0h3kWEmJgH6T6CizqTGmQYlIVbgsNmO0A56tR7AX/j4/461yPTR1GYF6Eqoh1wTxUR STHPIpayoQ3PeHxvcg/BPyJ+4TQsU1c4EHqkW5xLiYe/1PxMGkXUr71NpESe6StEvjQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796255579; h=Received:DKIM-Signature:Message-ID:From:Subject:Reply-To:To:Cc: In-Reply-To:References:Content-Type:Content-Transfer-Encoding:Date; bh=Pa1EOreMgy7xJ9wWpl3BQZsYUDADcfNf/botoO+6Lc4=; b=Sn5gGtoXulKvDxm87JGg4BFo0gU61b8Nz2wGW5UwaqfoD0aoddJP0DoydI+i4KhuHb7b n0mCupb2dL9IMAct5ZBsoorzqZBNaFbV3X1HTnaItz8JJZMVv4klLp6SIbPyo79aamq4D u0u5f1ZS7DjRofsg1SusCm7BxecsRp5kHlc4u/vwJiuQbTa+SkzQ2urd3nT0LkMLswp2y T6SA/2gW7KcCGnKm3BTS6m3NIULJQQhYYqdVSRnAjsk83DvgC2iuxbwmq0XneJvX71rJB SJa1aD8bUMxLAll2bHP8sfBE343L1JE9jji+yezOtT+EU+JfNlFmYbBvWfxTRr6/nlA== 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=QsJDoKLp; 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 3E1F6606A322 for ; Wed, 2 Dec 2026 23:52:58 +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=QsJDoKLp Received: by smtp.kernel.org (Postfix) with ESMTPSA id 563111F00893; Wed, 2 Dec 2026 23:52:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796255578; bh=Pa1EOreMgy7xJ9wWpl3BQZsYUDADcfNf/botoO+6Lc4=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=QsJDoKLp6hBKA1g9IlXpnddE8pwk6vZ31TvP+JQK2UCX9GTYOmujQtv5NlTQUSRMQ mPzlQfpoKye1NMepe7WfeL1O+OL/UGGA76kPMbA1SOt36a1X+oLA7zLm1ZVluxN0LP +7m7JO0tLbduRNtbn3l8BYb7U0BcoQv5e5ik/FoJjO27adxxraelNj4i+oR+V5IP5c oInDICkcPDuhZGvDVriIqGfYKDxenT6b16xydayEzdINb06zTMIJ8I/eQJg3AycayU Ka8mBUna+x9SWopK62hZY8wnoDM5amUttbus0nk5HduzzbXheR4X+/JhWQVpImvWgk htxs1ZyZhAvxw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH net-next v17 07/13] dpll: sit9531x: implement input pin state on a DPLL 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-8-arouhi@sitime.com> References: <20261201235202.97645-1-arouhi@sitime.com> <20261201235202.97645-8-arouhi@sitime.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 23:52:58 +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 2 potential issues to consider: - [Medium] dpll: sit9531x: indirect manual input decoded in sit9531x_chan_select_fetch() - [Medium] dpll: sit9531x: stale priorities on re-seed in sit9531x_prio_cfg_seed() -- commit e145fff66daa4f2e791c772fadb59ceb2f603c99 Author: Oleg Zadorozhnyi dpll: sit9531x: implement input pin state on a DPLL This commit implements getting and setting DPLL input pin states and operational states by managing each PLL's hardware priority table, input receiver gating, and reference re-selection during polling. > diff --git a/drivers/dpll/sit9531x/core.c b/drivers/dpll/sit9531x/core.c > index 4ff9e251eb776..d0305cbf12d5a 100644 > --- a/drivers/dpll/sit9531x/core.c > +++ b/drivers/dpll/sit9531x/core.c [ ... ] > @@ -340,39 +490,607 @@ static u8 sit9531x_prio_slot_get(u8 val, u8 slot) [ ... ] > +/* > + * Take the configured priorities from the hardware table: a listed sour= ce gets > + * the first slot it occupies. > + */ > +static void sit9531x_prio_cfg_seed(struct sit9531x_dev *sitdev, u8 pll_i= dx, > + const u8 *srcs) > +{ > + struct sit9531x_chan *chan =3D &sitdev->chan[pll_idx]; > + u16 seeded =3D 0; > + u8 slot, src; > + > + for (slot =3D 0; slot < SIT9531X_PRIO_MAX_SLOTS; slot++) { > + src =3D srcs[slot] & SIT9531X_PRIO_NIBBLE_MASK; > + if (!sit9531x_prio_src_usable(src)) > + continue; > + src =3D sit9531x_prio_src_canon(sitdev, src); > + if (seeded & BIT(src)) > + continue; > + seeded |=3D BIT(src); > + chan->cfg_prio[src] =3D slot; > + chan->cfg_known |=3D BIT(src); > + } > + > + for (src =3D 0; src < SIT9531X_PRIO_NUM_SRC; src++) { > + if (chan->cfg_known & BIT(src)) > + continue; > + chan->cfg_prio[src] =3D SIT9531X_PRIO_MAX_SLOTS - 1; > + chan->cfg_known |=3D BIT(src); > + } > + > + memcpy(chan->seen_srcs, srcs, sizeof(chan->seen_srcs)); > + chan->seen_valid =3D true; > +} [Severity: Medium] Does sit9531x_prio_cfg_seed() leave stale entries in chan->cfg_prio[] when a modified hardware table is reloaded? The initial call at probe sets every bit in chan->cfg_known. If sit9531x_chan_state_fetch() later calls sit9531x_prio_cfg_seed() because the hardware priority table changed over suspend/resume or outside the driver, the second loop checks chan->cfg_known instead of seeded and skips every source absent from the new table. Setting such a pin to DPLL_PIN_STATE_SELECTABLE will then insert it at its old chan->cfg_prio[src] slot rather than SIT9531X_PRIO_MAX_SLOTS - 1. [ ... ] > @@ -508,7 +1226,8 @@ static int sit9531x_pll_is_active(struct sit9531x_de= v *sitdev, u8 pll_idx, > static int sit9531x_chan_select_fetch(struct sit9531x_dev *sitdev, u8 pl= l_idx) > { > struct sit9531x_chan *chan =3D &sitdev->chan[pll_idx]; > - bool manual_input =3D false; > + bool manual_input =3D false, manual_any =3D false; > + u8 manual_ref =3D SIT9531X_REF_INVALID; > u8 cfg, misc, sel; > int rc; > =20 > @@ -534,8 +1253,13 @@ static int sit9531x_chan_select_fetch(struct sit953= 1x_dev *sitdev, u8 pll_idx) > if (rc) > return rc; > manual_input =3D true; > + manual_any =3D !(sel & SIT9531X_MAN_IN_SEL_FROM_REG) || > + (sel & SIT9531X_MAN_IN_SEL_INDIRECT); > if (sel & SIT9531X_MAN_IN_SEL_FROM_REG) { > sel =3D FIELD_GET(SIT9531X_MAN_IN_SEL_MASK, sel); > + manual_ref =3D > + sit9531x_hw_src_input(sit9531x_prio_src_canon(sitdev, > + sel)); > dev_dbg(sitdev->dev, > "PLL%c: the profile selects its reference from the register, input co= de %u; reported as manual\n", > 'A' + pll_idx, sel); > @@ -544,24 +1268,81 @@ static int sit9531x_chan_select_fetch(struct sit95= 31x_dev *sitdev, u8 pll_idx) > "PLL%c: the profile selects its reference from the input-select pins;= reported as manual\n", > 'A' + pll_idx); > } > + /* > + * The select pins and the indirect choice are not read here: a PLL > + * found on them again keeps the input it last tracked. > + */ > + if (manual_any && chan->manual_input && chan->manual_any) > + manual_ref =3D chan->manual_ref; > =20 > record: > chan->manual_input =3D manual_input; > + chan->manual_any =3D manual_any; > + chan->manual_ref =3D manual_ref; [Severity: Medium] When both SIT9531X_MAN_IN_SEL_FROM_REG and SIT9531X_MAN_IN_SEL_INDIRECT are set, does sit9531x_chan_select_fetch() populate manual_ref from the low nibble instead of leaving it as SIT9531X_REF_INVALID? At probe, chan->manual_input and chan->manual_any are false, so the fallback to chan->manual_ref does not overwrite the decoded value. If the PLL is unlocked or in holdover, sit9531x_dpll_selection_state_get() will report that pin as DPLL_PIN_STATE_CONNECTED even though indirect selection is active and the selected input is unknown. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201235202.9764= 5-1-arouhi@sitime.com?part=3D7