Devicetree
 help / color / mirror / Atom feed
From: netdev-bot+sashiko@kernel.org
To: arouhi@sitime.com
Cc: jiri@resnulli.us, vadim.fedorenko@linux.dev,
	arkadiusz.kubalewski@intel.com, ivecera@redhat.com,
	kuba@kernel.org, pabeni@redhat.com, robh@kernel.org,
	krzk+dt@kernel.org, conor+dt@kernel.org, cjubran@nvidia.com,
	Oleg.Zadorozhnyi@devoxsoftware.com,
	prabhakar.mahadev-lad.rj@bp.renesas.com,
	devicetree@vger.kernel.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net-next v16 01/13] dpll: omit pin phase attributes the driver has no value for
Date: Tue, 24 Nov 2026 00:40:34 +0000	[thread overview]
Message-ID: <179548083428.3135.1533890996902964782@kernel.org> (raw)
In-Reply-To: <20261119225752.41846-2-arouhi@sitime.com>

Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] This patch makes the core leave DPLL_A_PIN_PHASE_OFFSET out of a
  pin's parent-device nest, and DPLL_A_PIN_PHASE_ADJUST out of a pin…

--

dpll: omit pin phase attributes the driver has no value for

With this patch, the phase_offset_get and phase_adjust_get callbacks can
return -ENODATA. The core then leaves DPLL_A_PIN_PHASE_OFFSET or
DPLL_A_PIN_PHASE_ADJUST out of the message instead of failing the whole
pin dump. When the old value is not available, dpll_pin_phase_adj_set()
skips the comparison against it and passes the request on to the driver.

> diff --git a/drivers/dpll/dpll_netlink.c b/drivers/dpll/dpll_netlink.c
> index e5380d95f238b..acf71a93f2300 100644
> --- a/drivers/dpll/dpll_netlink.c
> +++ b/drivers/dpll/dpll_netlink.c
> @@ -388,8 +388,11 @@ dpll_msg_add_pin_phase_adjust(struct sk_buff *msg, struct dpll_pin *pin,
>  	ret = ops->phase_adjust_get(pin, dpll_pin_on_dpll_priv(dpll, pin),
>  				    dpll, dpll_priv(dpll),
>  				    &phase_adjust, extack);
> -	if (ret)
> +	if (ret) {
> +		if (ret == -ENODATA)
> +			return 0;
>  		return ret;
> +	}
>  	if (nla_put_s32(msg, DPLL_A_PIN_PHASE_ADJUST, phase_adjust))
>  		return -EMSGSIZE;
>  
> @@ -411,8 +414,11 @@ dpll_msg_add_phase_offset(struct sk_buff *msg, struct dpll_pin *pin,
>  	ret = ops->phase_offset_get(pin, dpll_pin_on_dpll_priv(dpll, pin),
>  				    dpll, dpll_priv(dpll), &phase_offset,
>  				    extack);
> -	if (ret)
> +	if (ret) {
> +		if (ret == -ENODATA)
> +			return 0;
>  		return ret;
> +	}
>  	if (nla_put_64bit(msg, DPLL_A_PIN_PHASE_OFFSET, sizeof(phase_offset),
>  			  &phase_offset, DPLL_A_PIN_PAD))
>  		return -EMSGSIZE;

[Severity: Low]
Should Documentation/driver-api/dpll.rst be updated along with these two
-ENODATA paths? Right now it still promises that both attributes are
always present.

The "Phase offset measurement and adjustment" section says:

  If pin-dpll phase offset measurement is supported, it shall be
  provided with DPLL_A_PIN_PHASE_OFFSET attribute for each parent dpll
  device.

and:

  Configured phase adjust value is provided with
  DPLL_A_PIN_PHASE_ADJUST attribute of a pin

The "Phase offset monitor" section says:

  Once enabled the phase offset measurements for the input shall be
  returned in the DPLL_A_PIN_PHASE_OFFSET attribute.

After this change, dpll_cmd_pin_get_one() can still send
DPLL_A_PIN_PHASE_ADJUST_MIN/MAX/GRAN from pin->prop without
DPLL_A_PIN_PHASE_ADJUST. It can also send a DPLL_A_PIN_PARENT_DEVICE nest
without DPLL_A_PIN_PHASE_OFFSET, even though ops->phase_offset_get is
implemented.

The new driver-facing rule, that -ENODATA from these callbacks means "no
value, omit the attribute", also isn't written down anywhere. The
phase_offset_get and phase_adjust_get members of struct dpll_pin_ops in
include/linux/dpll.h have no comment describing it. The netlink spec in
Documentation/netlink/specs/dpll.yaml doesn't say these attributes may be
absent.

None of the later patches in the series, up to and including "dpll:
sit9531x: model the inter-PLL sync line as a pair of pins", touches
dpll.rst, include/linux/dpll.h or dpll.yaml. The sit9531x driver added
later in the series returns -ENODATA from phase_offset_get, and from
phase_adjust_get when the delay is above S32_MAX. Once the series lands,
the documented guarantee no longer holds for an in-tree driver.

Could the documentation and the callback descriptions be updated to cover
the -ENODATA case?

-- 
Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261119225752.41846-1-arouhi%40sitime.com

  reply	other threads:[~2026-11-24  0:40 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 22:57 [PATCH net-next v16 00/13] dpll: add SiTime SiT9531x DPLL clock driver Ali Rouhi
2026-11-19 22:57 ` [PATCH net-next v16 01/13] dpll: omit pin phase attributes the driver has no value for Ali Rouhi
2026-11-24  0:40   ` netdev-bot+sashiko [this message]
2026-11-19 22:57 ` [PATCH net-next v16 02/13] dt-bindings: vendor-prefixes: add SiTime Corporation Ali Rouhi
2026-11-19 22:57 ` [PATCH net-next v16 04/13] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-11-20 22:58   ` sashiko-bot
2026-11-24  0:40   ` netdev-bot+sashiko
2026-11-19 22:57 ` [PATCH net-next v16 03/13] dt-bindings: dpll: add SiTime SiT95316 clock generator Ali Rouhi
2026-11-24  0:40   ` netdev-bot+sashiko
2026-11-19 22:57 ` [PATCH net-next v16 05/13] dpll: sit9531x: read DPLL types and pin properties from system firmware Ali Rouhi
2026-11-24  0:40   ` netdev-bot+sashiko
2026-11-19 22:57 ` [PATCH net-next v16 06/13] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-11-20 22:58   ` sashiko-bot
2026-11-24  0:40   ` netdev-bot+sashiko
2026-11-19 22:57 ` [PATCH net-next v16 08/13] dpll: sit9531x: add support to get and set priority on input pins Ali Rouhi
2026-11-24  0:40   ` netdev-bot+sashiko
2026-11-19 22:57 ` [PATCH net-next v16 07/13] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-11-20 22:58   ` sashiko-bot
2026-11-24  0:40   ` netdev-bot+sashiko
2026-11-19 22:57 ` [PATCH net-next v16 09/13] dpll: sit9531x: add support to get and set frequency on pins Ali Rouhi
2026-11-20 22:58   ` sashiko-bot
2026-11-24  0:40   ` netdev-bot+sashiko
2026-11-19 22:57 ` [PATCH net-next v16 10/13] dpll: sit9531x: implement output pin state on a DPLL Ali Rouhi
2026-11-20 22:58   ` sashiko-bot
2026-11-24  0:40   ` netdev-bot+sashiko
2026-11-19 22:58 ` [PATCH net-next v16 11/13] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-11-20 22:58   ` sashiko-bot
2026-11-24  0:40   ` netdev-bot+sashiko
2026-11-19 22:58 ` [PATCH net-next v16 13/13] dpll: sit9531x: model the inter-PLL sync line as a pair of pins Ali Rouhi
2026-11-20 22:58   ` sashiko-bot
2026-11-24  0:40   ` netdev-bot+sashiko
2026-11-19 22:58 ` [PATCH net-next v16 12/13] dpll: sit9531x: add support to get phase offset on the connected input Ali Rouhi
2026-11-24  0:40   ` netdev-bot+sashiko

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=179548083428.3135.1533890996902964782@kernel.org \
    --to=netdev-bot+sashiko@kernel.org \
    --cc=Oleg.Zadorozhnyi@devoxsoftware.com \
    --cc=arkadiusz.kubalewski@intel.com \
    --cc=arouhi@sitime.com \
    --cc=cjubran@nvidia.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ivecera@redhat.com \
    --cc=jiri@resnulli.us \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.com \
    --cc=robh@kernel.org \
    --cc=vadim.fedorenko@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