diff options
author | Alexandre Mergnat <amergnat@baylibre.com> | 2023-05-26 15:10:43 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2023-06-12 21:22:03 +0200 |
commit | 3d6f6d2b584e7a629158be8a3f44f5de00b337ee (patch) | |
tree | efbe0f5819e8503c641aa859e18514996c96a30b /drivers/clk/clk-composite.c | |
parent | Linux 6.4-rc1 (diff) | |
download | linux-3d6f6d2b584e7a629158be8a3f44f5de00b337ee.tar.xz linux-3d6f6d2b584e7a629158be8a3f44f5de00b337ee.zip |
clk: mediatek: mt8365: Fix index issue
Before the patch [1], the clock probe was done directly in the
clk-mt8365 driver. In this probe function, the array which stores the
data clocks is sized using the higher defined numbers (*_NR_CLOCK) in
the clock lists [2]. Currently, with the patch [1], the specific
clk-mt8365 probe function is replaced by the mtk generic one [3], which
size the clock data array by adding all the clock descriptor array size
provided by the clk-mt8365 driver.
Actually, all clock indexes come from the header file [2], that mean, if
there are more clock (then more index) in the header file [2] than the
number of clock declared in the clock descriptor arrays (which is the
case currently), the clock data array will be undersized and then the
generic probe function will overflow when it will try to write in
"clk_data[CLK_INDEX]". Actually, instead of crashing at boot, the probe
function returns an error in the log which looks like:
"of_clk_hw_onecell_get: invalid index 135", then this clock isn't
enabled.
Solve this issue by adding in the driver the missing clocks declared in
the header clock file [2].
[1]: Commit ffe91cb28f6a ("clk: mediatek: mt8365: Convert to
mtk_clk_simple_{probe,remove}()")
[2]: include/dt-bindings/clock/mediatek,mt8365-clk.h
[3]: drivers/clk/mediatek/clk-mtk.c
Fixes: ffe91cb28f6a ("clk: mediatek: mt8365: Convert to mtk_clk_simple_{probe,remove}()")
Signed-off-by: Alexandre Mergnat <amergnat@baylibre.com>
Link: https://lore.kernel.org/r/20230517-fix-clk-index-v3-1-be4df46065c4@baylibre.com
Tested-by: Markus Schneider-Pargmann <msp@baylibre.com>
Reviewed-by: Markus Schneider-Pargmann <msp@baylibre.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/clk-composite.c')
0 files changed, 0 insertions, 0 deletions