mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ali Rouhi <arouhi@sitime.com>
To: Jakub Kicinski <kuba@kernel.org>
Cc: "jiri@resnulli.us" <jiri@resnulli.us>,
	"vadim.fedorenko@linux.dev" <vadim.fedorenko@linux.dev>,
	"arkadiusz.kubalewski@intel.com" <arkadiusz.kubalewski@intel.com>,
	"ivecera@redhat.com" <ivecera@redhat.com>,
	"pabeni@redhat.com" <pabeni@redhat.com>,
	"robh@kernel.org" <robh@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"cjubran@nvidia.com" <cjubran@nvidia.com>,
	"Oleg.Zadorozhnyi@devoxsoftware.com"
	<Oleg.Zadorozhnyi@devoxsoftware.com>,
	"prabhakar.mahadev-lad.rj@bp.renesas.com"
	<prabhakar.mahadev-lad.rj@bp.renesas.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next v15 03/13] dt-bindings: dpll: add SiTime SiT95316 clock generator
Date: Thu, 19 Nov 2026 21:20:15 +0000	[thread overview]
Message-ID: <20261119212014.13180-1-arouhi@sitime.com> (raw)
In-Reply-To: <20261117021806.2220034-1-kuba@kernel.org>

On Mon, 16 Nov 2026 18:18:06 -0800, Jakub Kicinski wrote:

> > +            maxItems: 1
> > +            description:
> > +              The rate wired to the input, in Hz, as a single entry.  An
> > +              input runs at the rate the board feeds it and has no
> > +              frequency to select, so that entry is what the pin reports
> > +              as its frequency.
>
> [Severity: Low]
> Does maxItems: 1 actually limit this to a single rate?
>
> dpll-pin.yaml gives supported-frequencies-hz no explicit type, so the type
> comes from the dtschema -hz unit-suffix rule. If that rule makes it a uint32
> matrix, a top-level maxItems only counts bracket groups. A list written the
> way microchip,zl30731.yaml writes one would then count as a single group and
> pass:
>
>     supported-frequencies-hz = <10000000 25000000>;
>
> This depends on how dtschema types -hz properties, so it may not apply.
>
> If it does, the driver later in the series takes freqs[0] as the input's rate.
> It still advertises every listed value as a supported frequency, even though
> sit9531x_dpll_input_pin_ops has no .frequency_set.
>
> Would limiting the inner dimension (for example items: [ maxItems: 1 ]) or
> giving an explicit shape guarantee a single value?

dtschema applies maxItems of an integer array to the cells, not only to
the bracket groups: an input pin with `<10000000 25000000>` fails
dt_binding_check. No change.

> > +        output-pins:
> > +          patternProperties:
> > +            "^pin@[0-9a-f]+$":
> > +              properties:
> > +                reg:
> > +                  enum: [0, 3, 4, 5, 7, 8, 9, 11]
>
> [Severity: Low]
> On the SiT95317, don't the two numberings in this node collide?
>
> Output pin reg is the die output index. The vddoN-supply names follow the
> SiT95317 datasheet numbering, VDDO0 to VDDO7.
>
> So output-pins/pin@3 is datasheet OUT1. But vddo3-supply powers datasheet
> OUT3, which is die output 5. The same thing happens for 4/7, 5/8 and 7/11.
>
> One supply name also maps to different outputs on the two parts. vddo3 feeds
> reg 3 on the SiT95316 but reg 5 on the SiT95317.
>
> This enum accepts 0, 3, 4, 5 and 7, which are also valid datasheet output
> numbers. A board DT that numbers SiT95317 output pins by datasheet OUTn would
> pass validation for five of the eight outputs. Its label, frequency and
> enable state would then describe a different physical output. Only datasheet
> OUT1, OUT2 and OUT6 would be rejected.
>
> The driver does not enable the supplies today. A later change that looks up
> per-output supplies by pin reg would work on the SiT95316 but switch the wrong
> output driver on the SiT95317.
>
> Could one numbering be used for both reg and the supply names on the
> SiT95317?

Both numberings are intended and the binding text gives the mapping in
both places: reg is the die output, which is what the registers and the
shared SiT95316 numbering use, and a supply is named after the package
pin (VDDOn) as supplies are. A board author reads the pin names from the
datasheet, so renaming VDDO3 to match reg 5 would be the surprising
choice.

> > +                /* IN0P and IN0N: pair 0 runs single-ended */
> > +                pin@0 {
> > +                    reg = <0>;
> > +                    label = "clkin0";
> > +                    connection-type = "ext";
> > +                    supported-frequencies-hz = <10000000>;
>
> [Severity: Medium]
> Should the cell width of supported-frequencies-hz be fixed here before this
> becomes ABI?
>
> This example uses 32-bit cells. The only other in-tree DPLL binding that
> uses the same dpll-pin.yaml property, microchip,zl30731.yaml, uses 64-bit
> cells:
>
>     supported-frequencies-hz = /bits/ 64 <10000 10000000>;
>
> Its consumer, zl3073x_pin_props_get() in drivers/dpll/zl3073x/prop.c, reads
> the property with fwnode_property_count_u64(). dpll-pin.yaml gives the
> property no type, and this binding does not say which width a SiT9531x node
> has to use.
>
> The SiT9531x driver added later in this series reads it as u32:
>
> drivers/dpll/sit9531x/prop.c:
> 	/* A -hz property is 32-bit; no rate of this part needs more. */
> 	num_freqs = fwnode_property_count_u32(props->fwnode,
> 					      "supported-frequencies-hz");
>
> Suppose a SiT9531x node is written the way zl30731.yaml does it:
>
>     supported-frequencies-hz = /bits/ 64 <10000000>;
>
> The u32 count is then 2, and fwnode_property_read_u32_array() returns
> {0, 10000000}, because the high word comes first.
>
> With that input, curr_freq = freqs[0] is 0 and the reference frequency is
> never seeded. sit9531x_dpll_input_pin_frequency_get() then reports 0 Hz, and
> the pin also advertises a 0 Hz supported frequency next to the real one.
>
> Output pins have no item limit on this property, so that encoding would pass
> dt_binding_check there too.

Correct that the driver does not detect it. An input written in 64-bit
cells fails dt_binding_check, since the single item is then two 32-bit
cells. An output passes and advertises an extra 0 Hz entry beside each
rate; the rates themselves still work and a request for 0 Hz is refused,
so a check in the driver is not worth the code. No change.

  reply	other threads:[~2026-11-19 21:20 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-10 20:26 [PATCH net-next v15 00/13] dpll: add SiTime SiT9531x DPLL clock driver Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 01/13] dpll: omit pin phase attributes the driver has no value for Ali Rouhi
2026-11-11 15:35   ` Ivan Vecera
2026-11-10 20:26 ` [PATCH net-next v15 02/13] dt-bindings: vendor-prefixes: add SiTime Corporation Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 04/13] dpll: add basic SiTime SiT9531x support Ali Rouhi
2026-11-17  2:18   ` Jakub Kicinski
2026-11-19 21:20     ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 03/13] dt-bindings: dpll: add SiTime SiT95316 clock generator Ali Rouhi
2026-11-17  2:18   ` Jakub Kicinski
2026-11-19 21:20     ` Ali Rouhi [this message]
2026-11-10 20:26 ` [PATCH net-next v15 05/13] dpll: sit9531x: read DPLL types and pin properties from system firmware Ali Rouhi
2026-11-17  2:18   ` Jakub Kicinski
2026-11-19 21:20     ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 06/13] dpll: sit9531x: register DPLL devices and pins Ali Rouhi
2026-11-17  2:18   ` Jakub Kicinski
2026-11-19 21:20     ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 07/13] dpll: sit9531x: implement input pin state on a DPLL Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 09/13] dpll: sit9531x: add support to get and set frequency on pins Ali Rouhi
2026-11-17  2:18   ` Jakub Kicinski
2026-11-19 21:20     ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 08/13] dpll: sit9531x: add support to get and set priority on input pins Ali Rouhi
2026-11-17  2:18   ` Jakub Kicinski
2026-11-19 21:20     ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 10/13] dpll: sit9531x: implement output pin state on a DPLL Ali Rouhi
2026-11-17  2:18   ` Jakub Kicinski
2026-11-19 21:20     ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 11/13] dpll: sit9531x: add support to adjust output phase Ali Rouhi
2026-11-17  2:18   ` Jakub Kicinski
2026-11-19 21:20     ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 12/13] dpll: sit9531x: add support to get phase offset on the connected input pin Ali Rouhi
2026-11-17  2:18   ` Jakub Kicinski
2026-11-19 21:20     ` Ali Rouhi
2026-11-10 20:26 ` [PATCH net-next v15 13/13] dpll: sit9531x: model the inter-PLL sync line as a pair of pins Ali Rouhi
2026-11-17  2:18   ` Jakub Kicinski
2026-11-19 21:20     ` Ali Rouhi
2026-11-17  9:27 ` [PATCH net-next v15 00/13] dpll: add SiTime SiT9531x DPLL clock driver Paolo Abeni

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=20261119212014.13180-1-arouhi@sitime.com \
    --to=arouhi@sitime.com \
    --cc=Oleg.Zadorozhnyi@devoxsoftware.com \
    --cc=arkadiusz.kubalewski@intel.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

all inboxes | Powered by JetHome®