Re: [PATCH net-next v15 05/13] dpll: sit9531x: read DPLL types and pin properties from system firmware

From: Jakub Kicinski

Date: Mon Nov 16 2026 - 21:18:30 EST


This is an AI-generated review of your patch. The human sending this
email has considered the AI review valid, or at least plausible.
---
dpll: sit9531x: read DPLL types and pin properties from system firmware

This commit adds prop.c. It reads the DPLL type from "dpll-types". From the
input-pins and output-pins firmware sub-nodes it reads each pin's label,
connection type and supported frequencies. It also builds package labels
for the inputs, the outputs, the XO and the INTSYNC pins, and gives outputs
with no supported-frequencies-hz a 1 Hz to 1 GHz range.

> Read the DPLL type and, for each pin, its label, direction, capabilities
> and supported frequencies from the firmware node, with defaults for a
> node that gives none.

[Severity: Low]
Does this description match what sit9531x_pin_props_get() does?

The direction is not read from the firmware node. It is the dir argument
passed in by the caller. It only selects which sub-node ("input-pins" or
"output-pins") sit9531x_prop_pin_fwnode_get() searches.

The capabilities are not read from firmware either. Each pin class gets a
fixed value: DPLL_PIN_CAPABILITIES_STATE_CAN_CHANGE, or 0 for the XO.

The message also leaves out two things the code does:

- It parses the per-pin connection-type property into DPLL_PIN_TYPE_*.

- The getter writes sitdev->ref[index].freq, using the first
supported-frequencies-hz entry.

Could the commit message be updated to match the code?

> diff --git a/drivers/dpll/sit9531x/prop.c b/drivers/dpll/sit9531x/prop.c
> new file mode 100644
> index 0000000000000..b9405eba49a39
> --- /dev/null
> +++ b/drivers/dpll/sit9531x/prop.c
> @@ -0,0 +1,327 @@

[ ... ]

> + if (!fwnode_property_present(props->fwnode,
> + "supported-frequencies-hz"))
> + goto skip_fwnode_props;
> +
> + /* A -hz property is 32-bit; no rate of this part needs more. */
> + num_freqs = fwnode_property_count_u32(props->fwnode,
> + "supported-frequencies-hz");

[ ... ]

> + rc = fwnode_property_read_u32_array(props->fwnode,
> + "supported-frequencies-hz",
> + freqs, num_freqs);
> + if (rc) {
> + dev_warn(sitdev->dev,
> + "failed to parse supported-frequencies-hz for %s: %d\n",
> + props->package_label, rc);
> + goto err_alloc_ranges;
> + }
> +
> + /* The first listed rate seeds the input's rate */
> + if (num_freqs > 0 && dir == DPLL_PIN_DIRECTION_INPUT && !xo)
> + curr_freq = freqs[0];

[Severity: Medium]
This reads supported-frequencies-hz as u32. Does that match the other
driver that uses this generic property?

The property is defined in the shared dpll-pin.yaml, which does not give a
cell width. zl3073x_pin_props_get() reads the same property as u64:

drivers/dpll/zl3073x/prop.c:zl3073x_pin_props_get() {
...
num_freqs = fwnode_property_count_u64(props->fwnode,
"supported-frequencies-hz");
...
fwnode_property_read_u64_array(props->fwnode,
"supported-frequencies-hz", freqs,
num_freqs);
...
}

The microchip,zl30731.yaml examples also use /bits/ 64 for it.

Suppose a SiT9531x board DT follows that convention:

supported-frequencies-hz = /bits/ 64 <10000000>;

That is one item, so it passes the sitime binding's maxItems: 1. But
fwnode_property_count_u32() returns 2, and freqs[] becomes {0, 10000000}.

curr_freq = freqs[0] is then 0, so sitdev->ref[index].freq never gets
set. The pin also advertises a DPLL_PIN_FREQUENCY(0) entry next to the
real rate.

The reverse also breaks: zl3073x would read a 32-bit cell list as packed
u64 values.

Should the shared binding define one width that both drivers follow, or
should the sitime binding state the 32-bit width explicitly?

[ ... ]