From: sashiko-bot@kernel.org
To: "Ali Rouhi" <arouhi@sitime.com>
Cc: "devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH net-next v13 12/12] dpll: sit9531x: model the inter-PLL sync net as a pair of pins
Date: Wed, 14 Oct 2026 22:41:49 +0000 [thread overview]
Message-ID: <sashiko-outbox-172000@kernel.org> (raw)
In-Reply-To: <20261013224131.27149-13-arouhi@sitime.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] dpll: sit9531x: stale INTSYNC state cache on resume error due to missing read-through
--
commit e06eb4f817583cad992628e6390b7200bbd62de7
Author: Oleg Zadorozhnyi <Oleg.Zadorozhnyi@devoxsoftware.com>
dpll: sit9531x: model the inter-PLL sync net as a pair of pins
This commit models the internal inter-PLL synchronization network in the
sit9531x device as a pair of pins (output on source, input on destination).
It adds logic to detect, configure, and restore the INTSYNC state across
various operations and suspend/resume cycles.
> diff --git a/drivers/dpll/sit9531x/core.c b/drivers/dpll/sit9531x/core.c
> index a744de2c75858..a7b0b2d35cb7c 100644
> --- a/drivers/dpll/sit9531x/core.c
> +++ b/drivers/dpll/sit9531x/core.c
> @@ -4882,8 +5266,34 @@ static int sit9531x_suspend(struct device *dev)
> static int sit9531x_resume(struct device *dev)
> {
> struct sit9531x_dev *sitdev = dev_get_drvdata(dev);
> + int rc;
> + u8 i;
>
> sit9531x_page_cache_drop(sitdev);
> +
> + /*
> + * A part that lost power across suspend comes back with its
> + * profile's INTSYNC routing and output mutes, not with what the
> + * caches say, and the poll watches neither. Read them back here;
> + * a cache that cannot be read is left for the getter's read-through.
> + * Nothing races this: the poll is parked and the IRQ disabled.
> + */
> + mutex_lock(&sitdev->multiop_lock);
> + rc = sit9531x_intsync_src_detect(sitdev);
> + if (rc)
> + dev_warn(sitdev->dev,
> + "INTSYNC source not re-detected on resume: %d\n", rc);
[Severity: Medium]
If sit9531x_intsync_src_detect() fails to read from the device, the code
logs a warning but leaves sitdev->intsync_src holding its pre-suspend value.
Unlike the output mutes right below which set a state_stale flag, is there
anything triggering a subsequent read if this initial resume read fails?
> + for (i = 0; i < sitdev->info->num_outputs; i++) {
> + rc = sit9531x_output_state_refresh(sitdev, i);
> + if (rc) {
> + dev_warn(sitdev->dev,
> + "Output %u mute state not read on resume: %d\n",
> + i, rc);
> + sitdev->out[i].state_stale = true;
> + }
> + }
> + mutex_unlock(&sitdev->multiop_lock);
> +
> if (sitdev->irq > 0)
> enable_irq(sitdev->irq);
[ ... ]
> diff --git a/drivers/dpll/sit9531x/dpll.c b/drivers/dpll/sit9531x/dpll.c
> index dc8d84133b72b..5f530c4a8271d 100644
> --- a/drivers/dpll/sit9531x/dpll.c
> +++ b/drivers/dpll/sit9531x/dpll.c
[ ... ]
> @@ -869,8 +940,325 @@ sit9531x_dpll_output_pin_direction_get(const struct dpll_pin *pin,
> +static int
> +sit9531x_dpll_intsync_src_state_on_dpll_get(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)
> +{
> + struct sit9531x_dpll *sitdpll = dpll_priv;
> + struct sit9531x_dev *sitdev = sitdpll->dev;
> +
> + mutex_lock(&sitdev->multiop_lock);
> + if (sit9531x_dpll_intsync_src_connected(sitdev, sitdpll))
> + *state = DPLL_PIN_STATE_CONNECTED;
> + else
> + *state = DPLL_PIN_STATE_DISCONNECTED;
> + mutex_unlock(&sitdev->multiop_lock);
[Severity: Medium]
The comment in sit9531x_resume() states that "a cache that cannot be read
is left for the getter's read-through." However, this getter directly
returns the cached intsync_src value without attempting to read from the
hardware if the cache is stale.
Because the resume path does not invalidate the cache on failure, could this
result in reporting an incorrect, out-of-sync INTSYNC state to user space
and erroneously accepting or rejecting configuration requests?
> +
> + return 0;
> +}
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261013224131.27149-1-arouhi@sitime.com?part=12
next prev parent reply other threads:[~2026-10-14 22:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-13 22:41 [PATCH net-next v13 00/12] dpll: add SiTime SiT9531x DPLL clock driver Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 01/12] dt-bindings: vendor-prefixes: add SiTime Corporation Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 03/12] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 02/12] dt-bindings: dpll: add SiTime SiT95316 clock generator Ali Rouhi
2026-10-14 22:41 ` sashiko-bot
2026-10-13 22:41 ` [PATCH net-next v13 04/12] dpll: sit9531x: read DPLL types and pin properties from system firmware Ali Rouhi
2026-10-14 22:41 ` sashiko-bot
2026-10-13 22:41 ` [PATCH net-next v13 06/12] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 05/12] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-10-14 22:41 ` sashiko-bot
2026-10-13 22:41 ` [PATCH net-next v13 07/12] dpll: sit9531x: add support to get and set priority on input pins Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 08/12] dpll: sit9531x: add support to get and set frequency on pins Ali Rouhi
2026-10-14 22:41 ` sashiko-bot
2026-10-13 22:41 ` [PATCH net-next v13 09/12] dpll: sit9531x: implement output pin state on a DPLL Ali Rouhi
2026-10-13 22:41 ` [PATCH net-next v13 10/12] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-10-14 22:41 ` sashiko-bot
2026-10-13 22:41 ` [PATCH net-next v13 12/12] dpll: sit9531x: model the inter-PLL sync net as a pair of pins Ali Rouhi
2026-10-14 22:41 ` sashiko-bot [this message]
2026-10-13 22:41 ` [PATCH net-next v13 11/12] dpll: sit9531x: add support to get phase offset on the connected input pin Ali Rouhi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=sashiko-outbox-172000@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=arouhi@sitime.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=robh@kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox