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=1796258353; b=N6oc4ZAR0cvX+FESG5HSDffKUrOPiA2Lq+IylzyQBcMIkeYDK9hgiS9AUOYiKJUCXj9v uB8UKSdJvAq0/uoB6xnu8bxzCl9x/MFpEd4AU3SqvJOV/W0QMCFtzx//upEiYhXzDGPRe ME4wVO8icjj9PB2fgBDTUJYCIH4Hgl1Xia48UO3oeJ7g8AfVtUwI9xnAutlMW5KdVDg7S BWW/bswOVvz5VJAxOlvMfQQgRVnuceTRnhQpY59p/f0Jd/U2iZqidLOP9qMgqOyNy05GS Lzv+9kMvhqd7iIiGtqrZY/Fl93ghUuUwgQBndir2Gk3KJ5jtoMmzv3zFrrK1S3Qi3yA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796258353; 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=Do/SnznItmfmEDLACJoEm9dY4fPmTP+L3LkFqsglhZQ=; b=YCI2wm4RCT/A0cErFY6zGc1PNhRYGPAK/CzWDBs9W6kOGRNe4GZDwQwB/kJpHYEMmkA0 oyn3pjXM+j0NT/gp/FiMqNVYfIWupAWkkUl2EACuX1gN+8F2n4CAz5qiQiKZtorP7qAXv /rAUpz66eZlxdp5ifJZQ3okj12HOYPEGsNuzZ+T6I0roRsYsVm5GfATPQE1OQlVi40sB2 HU1SdA0G4ew5D8AXSoHVpqJWni2gGHOC6+jP/OL7af/HxPl6B4+6KmKeFjcGD2X0NtyqA ySSF8zIxsZgn87/qZVUzdXrxKS3H6Hbfp1mdgr0SYgdV0Wl6yLah5l9k8vVHL7I+jqw== 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=cwluuReI; 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 09C6A606A687; Thu, 3 Dec 2026 00:39:12 +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=cwluuReI Received: by smtp.kernel.org (Postfix) with ESMTPSA id C73EE1F00937; Thu, 3 Dec 2026 00:39:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796258352; bh=Do/SnznItmfmEDLACJoEm9dY4fPmTP+L3LkFqsglhZQ=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=cwluuReIvhSR9C5LSCLMzmhSPuxHfNnGgujLRiofqlUuw33y8m5rAUmCp4f+xB66P fOfjq/eSBDDb3OMv8oEeE/VxPedUr7Tp0MjW6qev9ikqc8mhsAmQH9ZkQ6LheSiZol WiZibp6tXuwpBOZOJxUfYAHNOhgwDEiaXzsQi4K1sXHG+Rgnyolze7so/LDNRdbIpz a5iNMwItlBw+puaGNrAd55IBTRtsFAPL92HX5cB4u3QwTPjc2elU0By/RD3b/puR9R n99k5M2B/9xG0766Hw6G3wzq8FMueW4CY3NhGMmZFgokHYq57mk77Ejli1f/+aEg14 jwhGcYkcY1c7w== Subject: Re: [PATCH net-next v17 10/13] dpll: sit9531x: implement output pin state on a DPLL 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:11 +0000 Message-ID: <179625835133.3146.1308915527518454647@kernel.org> In-Reply-To: <20261201235202.97645-11-arouhi@sitime.com> References: <20261201235202.97645-11-arouhi@sitime.com> X-sashiko-severity: Medium Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: devicetree@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 3 potential issue(s) to consider. Critical: 0 · High: 0 · Medium: 2 · Low: 1 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] The output mute state is decided without looking at which CMOS pads ODRn_MISC0 actually enables. - [Medium] sit9531x_resume() keeps or re-takes an output's pre-mute Hi-Z record based on the cached out->enabled (`if (rc || (!enabled &&… - [Low] sit9531x_dpll_output_pin_state_on_dpll_set() returns a bare -EINVAL for any state other than CONNECTED or DISCONNECTED, with no… -- dpll: sit9531x: implement output pin state on a DPLL This patch adds state_on_dpll_get/set for sit9531x output pins and starts registering output pins. An output is muted by forcing its slot's Hi-Z pairs. The configuration's Hi-Z overrides are recorded at probe and put back on unmute. The patch also folds the Page 3 debug key open/close into common helpers that the poll and removal paths retry. > diff --git a/drivers/dpll/sit9531x/core.c b/drivers/dpll/sit9531x/core.c > index bce58b3371130..3316e3761e16d 100644 > --- a/drivers/dpll/sit9531x/core.c > +++ b/drivers/dpll/sit9531x/core.c [ ... ] > @@ -439,14 +440,16 @@ static int sit9531x_hiz_pair_forced(struct sit9531x_dev *sitdev, > static int sit9531x_output_forced_hiz(struct sit9531x_dev *sitdev, > u8 out_idx, bool *muted, bool *part) > { > + const struct sit9531x_out *out = &sitdev->out[out_idx]; > struct sit9531x_hiz_pair p[SIT9531X_HIZ_PAIRS]; > bool pad_p, pad_n; > + u8 keep; > int rc; [ ... ] > @@ -457,44 +460,91 @@ static int sit9531x_output_forced_hiz(struct sit9531x_dev *sitdev, > if (rc) > return rc; > > + /* A pad the loaded configuration forces is not a part mute */ > + keep = out->hiz_mask & ~out->hiz_state; > *muted = pad_p && pad_n; > - *part = pad_p != pad_n; > + *part = pad_p != pad_n && > + !(keep & BIT(pad_p ? SIT9531X_HIZ_CMOS_P : > + SIT9531X_HIZ_CMOS_N)); [Severity: Medium] Can a CMOS output that uses only one pad be reported CONNECTED while that pad is tri-stated? sit9531x_output_mode_fetch() merges the two pad enables into one bool: sitdev->out[out_idx].cmos = !!(val & (SIT9531X_OUT_CMOS_ENP | SIT9531X_OUT_CMOS_ENN)); regs.h documents a single-pad CMOS mode ("Either set: single-ended (one pad, or both as CMOS)"). Here, muted needs both pads forced. So an output with ENP=1 and ENN=0 whose OutP pair is forced (MASK=1, STATE=0) gets muted=false. sit9531x_out_state_fetch() then sees the output as not muted and records the OutP MASK bit in hiz_mask as a configuration force. keep then covers OutP, so part is false too. As a result, a CONNECTED request takes the early return in sit9531x_dpll_output_pin_state_on_dpll_set(): if (!sit9531x_output_state_refresh(sitdev, dpin->id) && sitdev->out[dpin->id].enabled == enable && !sitdev->out[dpin->id].part_muted) { A DISCONNECTED->CONNECTED cycle does not help either. On unmute, sit9531x_output_hiz_write() writes the recorded force back onto OutP. Is there any way to make such an output drive through the DPLL API? An external tool that tri-states only the used pad can leave the output in this state. So can this driver's own mute: if the CMOS_N write fails, the undo of CMOS_P also fails ("Hi-Z override left part applied"), and the driver is then rebound. Could ENP and ENN be tracked separately, so that muted is decided from the pads that are actually enabled? sit9531x_output_mode_fetch() and sit9531x_output_forced_hiz() look the same at the end of the series, in "dpll: sit9531x: model the inter-PLL sync line as a pair of pins". [ ... ] > @@ -3771,17 +3991,26 @@ static int sit9531x_resume(struct device *dev) > sit9531x_ref_pll_mask_rebuild(sitdev); > for (i = 0; i < sitdev->info->num_outputs; i++) { > struct sit9531x_out *out = &sitdev->out[i]; > + u8 hiz_mask = out->hiz_mask, hiz_state = out->hiz_state; > + bool enabled = out->enabled; > bool routed = out->routed; > u8 pll_idx = out->pll_idx; > > rc = sit9531x_out_state_fetch(sitdev, i); > - if (rc) > + /* A muted output keeps the Hi-Z record taken before the mute */ > + if (rc || (!enabled && !out->enabled)) { > + out->hiz_mask = hiz_mask; > + out->hiz_state = hiz_state; > + } [Severity: Medium] Should this condition also check out->state_stale? enabled is the value cached before suspend, and it can be stale. sit9531x_output_disable() can write the Hi-Z pairs and then fail the readback. In that case it only sets state_stale, and enabled stays true: } else { sitdev->out[index].state_stale = true; The error path's __dpll_pin_change_ntf() can fail as well, or the poll may not have refreshed the cache yet. sit9531x_suspend() then cancels the poll with kthread_cancel_delayed_work_sync(), so the cache is still stale at suspend. On resume, enabled is the stale true, so this condition is false. sit9531x_out_state_fetch() has already cleared hiz_mask and hiz_state. It finds the output muted and skips the MASK bit of every pair with STATE clear: if (state_val & BIT(p[i].bit)) out->hiz_state |= BIT(i); else if (muted) continue; That drops the pre-mute record, including the bit for a pad the configuration forced, such as one OutN pad of a two-pad CMOS output. Would the next unmute through sit9531x_output_hiz_write() then release and drive that pad? If __dpll_pin_change_ntf() succeeds, the state_on_dpll_get callback refreshes the stale state while the message is built. So the window is limited to the failed or not yet retried notification path. The final version of sit9531x_resume() in the series seems to keep this. It computes outs_unread from state_stale but still uses "!(outs_was & BIT(i)) && !out->enabled" as the restore condition. [ ... ] > diff --git a/drivers/dpll/sit9531x/dpll.c b/drivers/dpll/sit9531x/dpll.c > index 25bee483bb5a7..b0403c0bc1320 100644 > --- a/drivers/dpll/sit9531x/dpll.c > +++ b/drivers/dpll/sit9531x/dpll.c [ ... ] > @@ -676,8 +679,112 @@ sit9531x_dpll_output_pin_frequency_set(const struct dpll_pin *pin, [ ... ] > +static int > +sit9531x_dpll_output_pin_state_on_dpll_set(const struct dpll_pin *pin, > + void *pin_priv, > + const struct dpll_device *dpll, > + void *dpll_priv, > + enum dpll_pin_state state, > + struct netlink_ext_ack *extack) > +{ [ ... ] > + /* An output is routed explicitly, not a selection candidate */ > + if (!enable && state != DPLL_PIN_STATE_DISCONNECTED) > + return -EINVAL; [Severity: Low] This isn't a functional problem, but could this refusal set an extack message? The DPLL netlink policy passes SELECTABLE through to the driver, and userspace gets a bare -EINVAL here. The INTSYNC source pin callback, added later in the series in "dpll: sit9531x: model the inter-PLL sync line as a pair of pins", explains the same refusal: NL_SET_ERR_MSG(extack, "A PLL drives INTSYNC or not; use connected or disconnected"); The input pins also explain why they refuse CONNECTED ("Device selects its reference by priority; use selectable"). [ ... ] -- Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261201235202.97645-1-arouhi%40sitime.com