[PATCH net v4 1/5] dpll: zl3073x: do not offer 0 Hz as a supported pin frequency
From: Ivan Vecera
Date: Fri Oct 09 2026 - 15:38:46 EST
zl3073x_pin_props_get() always adds the current pin frequency to the
supported list without checking it. A sub-Hz frequency reads back as
0 Hz, so 0 Hz can then be requested and the output frequency set
callback divides by zero.
Do not add a 0 Hz current frequency. If the list ends up empty, do not
publish it at all, as the DPLL core rejects an empty non-NULL list.
Fixes: 85a9aaac4a38 ("dpll: zl3073x: Include current frequency in supported frequencies list")
Reviewed-by: Petr Oros <poros@xxxxxxxxxx>
Signed-off-by: Ivan Vecera <ivecera@xxxxxxxxxx>
---
drivers/dpll/zl3073x/prop.c | 21 ++++++++++++++++++---
1 file changed, 18 insertions(+), 3 deletions(-)
diff --git a/drivers/dpll/zl3073x/prop.c b/drivers/dpll/zl3073x/prop.c
index ac9d41d0f978..18a1bf310332 100644
--- a/drivers/dpll/zl3073x/prop.c
+++ b/drivers/dpll/zl3073x/prop.c
@@ -295,13 +295,20 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev,
goto err_alloc_ranges;
}
- /* Start with current frequency at index 0 */
- ranges[0] = (struct dpll_pin_frequency)DPLL_PIN_FREQUENCY(curr_freq);
+ /* Start with current frequency at index 0. A sub-Hz frequency is
+ * read back as 0 Hz and cannot be set, so it is not offered.
+ */
+ j = 0;
+ if (curr_freq) {
+ struct dpll_pin_frequency freq = DPLL_PIN_FREQUENCY(curr_freq);
+
+ ranges[j++] = freq;
+ }
/* Add frequencies from firmware node, skipping current frequency
* and filtering out frequencies not representable by device
*/
- for (i = 0, j = 1; i < num_freqs; i++) {
+ for (i = 0; i < num_freqs; i++) {
struct dpll_pin_frequency freq = DPLL_PIN_FREQUENCY(freqs[i]);
if (freqs[i] == curr_freq)
@@ -312,6 +319,14 @@ struct zl3073x_pin_props *zl3073x_pin_props_get(struct zl3073x_dev *zldev,
}
}
+ /* The DPLL core rejects a non-NULL list without entries, so do
+ * not publish the array at all when nothing is settable.
+ */
+ if (!j) {
+ kfree(ranges);
+ ranges = NULL;
+ }
+
/* Save number of freq ranges and pointer to them into pin properties */
props->dpll_props.freq_supported = ranges;
props->dpll_props.freq_supported_num = j;
--
2.56.0