diff options
| author | Dario Binacchi <dario.binacchi@amarulasolutions.com> | 2026-09-04 12:06:31 +0200 |
|---|---|---|
| committer | Brian Masney <bmasney@redhat.com> | 2026-09-29 12:47:55 -0400 |
| commit | 109124b8ff43fb911d5b8790bb5e4c5684f72d88 (patch) | |
| tree | 7fc951e54f298de3bdc0a741ca08ebd6259dc720 /include/linux | |
| parent | 7b283b8ce37d40d22f41bdc20b407cd76fe86e68 (diff) | |
clk: validate spread spectrum configuration
The spread spectrum configuration is passed to the provider's
set_spread_spectrum() callback without any validation, as clk-conf.c
only skips all-zero triplets from "assigned-clock-sscs". An invalid
device tree can hand providers a zero modulation frequency or a spread
ratio above 100%, and each provider would have to add the same checks
to protect e.g. divisions in its rate computations.
The KUnit test data for assigned-clock-sscs uses spread values of 30000
and 40000 permyriad (300% and 400%), which the new check rejects, as
reported by Sashiko, so fix them to 300 and 400 (3% and 4%). Also use
a realistic 6% value for the initial settings of the skip tests, for
consistency.
Fixes: c86814e70390 ("clk: Introduce clk_hw_set_spread_spectrum")
Reported-by: Sashiko <sashiko-bot@kernel.org>
Closes: https://lore.kernel.org/r/20260901155657.6A5981F00A3A@smtp.kernel.org
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Brian Masney <bmasney@redhat.com>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions
