linux-stable/drivers/clk
Binbin Zhou 2a809ddca0 clk: clk-loongson2: Zero init clk_init_data
As clk_core_populate_parent_map() checks clk_init_data.num_parents
first, and checks clk_init_data.parent_names[] before
clk_init_data.parent_data[] and clk_init_data.parent_hws[].

Therefore the clk_init_data structure needs to be explicitly initialised
to prevent an unexpected crash if clk_init_data.parent_names[] is a
random value.

 CPU 0 Unable to handle kernel paging request at virtual address 0000000000000dc0, era == 9000000002986290, ra == 900000000298624c
 Oops[#1]:
 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.4.0-rc2+ #4582
 pc 9000000002986290 ra 900000000298624c tp 9000000100094000 sp 9000000100097a60
 a0 9000000104541e00 a1 0000000000000000 a2 0000000000000dc0 a3 0000000000000001
 a4 90000001000979f0 a5 90000001800977d7 a6 0000000000000000 a7 900000000362a000
 t0 90000000034f3548 t1 6f8c2a9cb5ab5f64 t2 0000000000011340 t3 90000000031cf5b0
 t4 0000000000000dc0 t5 0000000000000004 t6 0000000000011300 t7 9000000104541e40
 t8 000000000005a4f8 u0 9000000104541e00 s9 9000000104541e00 s0 9000000104bc4700
 s1 9000000104541da8 s2 0000000000000001 s3 900000000356f9d8 s4 ffffffffffffffff
 s5 0000000000000000 s6 0000000000000dc0 s7 90000000030d0a88 s8 0000000000000000
    ra: 900000000298624c __clk_register+0x228/0x84c
   ERA: 9000000002986290 __clk_register+0x26c/0x84c
  CRMD: 000000b0 (PLV0 -IE -DA +PG DACF=CC DACM=CC -WE)
  PRMD: 00000004 (PPLV0 +PIE -PWE)
  EUEN: 00000000 (-FPE -SXE -ASXE -BTE)
  ECFG: 00071c1c (LIE=2-4,10-12 VS=7)
 ESTAT: 00010000 [PIL] (IS= ECode=1 EsubCode=0)
  BADV: 0000000000000dc0
  PRID: 0014a000 (Loongson-64bit, )
 Modules linked in:
 Process swapper/0 (pid: 1, threadinfo=(____ptrval____), task=(____ptrval____))
 Stack : 90000000031c1810 90000000030d0a88 900000000325bac0 90000000034f3548
         90000001002ab410 9000000104541e00 0000000000000dc0 9000000003150098
         90000000031c1810 90000000031a0460 900000000362a000 90000001002ab410
         900000000362a000 9000000104541da8 9000000104541de8 90000001002ab410
         900000000362a000 9000000002986a68 90000000034f3ed8 90000000030d0aa8
         9000000104541da8 900000000298d3b8 90000000031c1810 0000000000000000
         90000000034f3ed8 90000000030d0aa8 0000000000000dc0 90000000030d0a88
         90000001002ab410 900000000298d401 0000000000000000 6f8c2a9cb5ab5f64
         90000000034f4000 90000000030d0a88 9000000003a48a58 90000001002ab410
         9000000104bd81a8 900000000298d484 9000000100020260 0000000000000000
         ...
 Call Trace:
 [<9000000002986290>] __clk_register+0x26c/0x84c
 [<9000000002986a68>] devm_clk_hw_register+0x5c/0xe0
 [<900000000298d3b8>] loongson2_clk_register.constprop.0+0xdc/0x10c
 [<900000000298d484>] loongson2_clk_probe+0x9c/0x4ac
 [<9000000002a4eba4>] platform_probe+0x68/0xc8
 [<9000000002a4bf80>] really_probe+0xbc/0x2f0
 [<9000000002a4c23c>] __driver_probe_device+0x88/0x128
 [<9000000002a4c318>] driver_probe_device+0x3c/0x11c
 [<9000000002a4c5dc>] __driver_attach+0x98/0x18c
 [<9000000002a49ca0>] bus_for_each_dev+0x80/0xe0
 [<9000000002a4b0dc>] bus_add_driver+0xfc/0x1ec
 [<9000000002a4d4a8>] driver_register+0x68/0x134
 [<90000000020f0110>] do_one_initcall+0x50/0x188
 [<9000000003150f00>] kernel_init_freeable+0x224/0x294
 [<90000000030240fc>] kernel_init+0x20/0x110
 [<90000000020f1568>] ret_from_kernel_thread+0xc/0xa4

Fixes: acc0ccffec ("clk: clk-loongson2: add clock controller driver support")
Cc: stable@vger.kernel.org
Cc: Yinbo Zhu <zhuyinbo@loongson.cn>
Signed-off-by: Binbin Zhou <zhoubinbin@loongson.cn>
Link: https://lore.kernel.org/r/20230524014924.2869051-1-zhoubinbin@loongson.cn
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
2023-06-12 18:30:46 -07:00
..
actions
analogbits
at91 clk: at91: clk-sam9x60-pll: fix return value check 2023-03-06 12:30:01 -08:00
axis
axs10x clk: axs10x: Use managed of_clk_add_hw_provider() 2023-04-10 12:45:12 -07:00
baikal-t1 clk: baikal-t1: Convert to platform device driver 2022-09-30 14:20:56 -07:00
bcm Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
berlin
davinci clk: remove davinci dm3xx drivers 2023-01-12 10:53:12 +01:00
hisilicon Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
imgtec
imx A couple more patches that would be good to get into -rc1. 2023-05-07 10:31:45 -07:00
ingenic clk: ingenic: jz4760: Update M/N/OD calculation algorithm 2023-01-25 16:08:27 -08:00
keystone clk: keystone: Convert to platform remove callback returning void 2023-03-28 19:23:38 -07:00
mediatek clk: mediatek: mt8365: Fix inverted topclk operations 2023-06-12 18:12:09 -07:00
meson clk: meson: clk-cpu-dyndiv: switch from .round_rate to .determine_rate 2023-01-13 15:14:12 +01:00
microchip Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
mmp clk: mmp: Convert to platform remove callback returning void 2023-03-28 19:31:44 -07:00
mstar clk: mstar: msc313 cpupll clk driver 2022-10-27 11:44:27 -07:00
mvebu clk: mvebu: Convert to platform remove callback returning void 2023-03-28 19:31:44 -07:00
mxs
nxp clk: nxp: fix typo in comment 2022-10-03 12:34:32 -07:00
pistachio clk: pistachio: Fix initconst confusion 2022-09-28 18:35:45 -07:00
pxa clk: pxa: add a check for the return value of kzalloc() 2022-10-03 12:32:03 -07:00
qcom clk: qcom: gcc-sc8280xp: Add EMAC GDSCs 2023-04-24 07:22:01 -07:00
ralink clk: ralink: fix 'mt7621_gate_is_enabled()' function 2023-02-10 16:07:56 -08:00
renesas Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
rockchip Merge branches 'clk-of', 'clk-samsung', 'clk-rockchip' and 'clk-qcom' into clk-next 2023-04-25 11:52:25 -07:00
samsung clk: samsung: exynos850: Make PMU_ALIVE_PCLK critical 2023-03-13 08:24:57 +01:00
sifive clk: sifive: make SiFive clk drivers depend on ARCH_ symbols 2023-04-10 13:00:59 -07:00
socfpga clk: socfpga: arria10: use of_clk_add_hw_provider and improve error handling 2023-03-21 16:47:48 -07:00
spear clk: spear: Fix SSP clock definition on SPEAr600 2022-11-22 18:03:52 -08:00
sprd Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
st clk: st: Fix memory leak in st_of_quadfs_setup() 2022-12-07 18:27:11 -08:00
starfive clk: starfive: Fix RESET_STARFIVE_JH7110 can't be selected in a specified case 2023-05-02 18:34:49 -07:00
stm32 clk: stm32: Convert to platform remove callback returning void 2023-03-28 19:31:44 -07:00
sunxi
sunxi-ng clk: sunxi-ng: d1: Add CAN bus gates and resets 2023-01-08 22:06:10 +01:00
tegra Merge branches 'clk-xilinx', 'clk-broadcom' and 'clk-platform' into clk-next 2023-04-25 11:50:36 -07:00
ti Merge branches 'clk-xilinx', 'clk-broadcom' and 'clk-platform' into clk-next 2023-04-25 11:50:36 -07:00
uniphier clk: uniphier: Use managed of_clk_add_hw_provider() 2023-04-10 12:56:25 -07:00
ux500
versatile
visconti clk: visconti: remove unused visconti_pll_provider::regmap 2023-03-06 11:43:29 -08:00
x86 clk: x86: Convert to platform remove callback returning void 2023-03-28 19:31:45 -07:00
xilinx Merge branches 'clk-xilinx', 'clk-broadcom' and 'clk-platform' into clk-next 2023-04-25 11:50:36 -07:00
zynq
zynqmp clk: zynqmp: pll: Remove the limit 2023-03-27 12:08:28 -07:00
.kunitconfig
clk-apple-nco.c
clk-asm9260.c clk: asm9260: use parent index to link the reference clock 2022-09-29 17:55:26 -07:00
clk-aspeed.c
clk-aspeed.h
clk-ast2600.c clk: ast2600: Add comment about combined clock + reset handling 2023-03-06 14:11:29 -08:00
clk-axi-clkgen.c clk: axi-clkgen: Use managed of_clk_add_hw_provider() 2023-04-10 12:45:12 -07:00
clk-axm5516.c clk: axm5516: Use managed of_clk_add_hw_provider() 2023-04-10 12:45:12 -07:00
clk-bd718x7.c
clk-bm1880.c clk: bm1880: remove MODULE_LICENSE in non-modules 2023-04-13 13:13:50 -07:00
clk-bulk.c clk: bulk: Use dev_err_probe() helper in __clk_bulk_get() 2022-10-17 16:07:51 -07:00
clk-cdce706.c clk: cdce706: Use managed of_clk_add_hw_provider() 2023-04-10 12:45:12 -07:00
clk-cdce925.c clk: cdce925: simplify using devm_regulator_get_enable() 2022-10-17 16:06:49 -07:00
clk-clps711x.c
clk-composite.c clk: composite: Fix handling of high clock rates 2023-06-12 17:42:10 -07:00
clk-conf.c clk: add missing of_node_put() in "assigned-clocks" property parsing 2023-03-29 13:53:28 -07:00
clk-cs2000-cp.c
clk-devres.c
clk-divider.c
clk-en7523.c
clk-fixed-factor.c clk: fixed-factor: Convert to platform remove callback returning void 2023-03-28 19:23:36 -07:00
clk-fixed-mmio.c Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
clk-fixed-rate.c clk: fixed-rate: Convert to platform remove callback returning void 2023-03-28 19:23:36 -07:00
clk-fractional-divider.c clk: Compute masks for fractional_divider clk when needed. 2023-04-05 12:09:26 -07:00
clk-fractional-divider.h
clk-fsl-flexspi.c
clk-fsl-sai.c kbuild, clk: remove MODULE_LICENSE in non-modules 2023-03-06 11:29:18 -08:00
clk-gate.c
clk-gate_test.c
clk-gemini.c
clk-gpio.c
clk-hi655x.c
clk-highbank.c
clk-hsdk-pll.c clk: hsdk-pll: Use managed of_clk_add_hw_provider() 2023-04-10 12:45:12 -07:00
clk-k210.c clk: k210: remove an implicit 64-bit division 2023-03-06 14:41:20 -08:00
clk-lan966x.c clk: allow building lan966x as a module 2022-10-03 14:14:02 -07:00
clk-lmk04832.c clk: lmk04832: Use managed of_clk_add_hw_provider() 2023-04-10 12:45:13 -07:00
clk-lochnagar.c
clk-loongson1.c clk: loongson1: Re-implement the clock driver 2023-03-21 16:34:23 -07:00
clk-loongson2.c clk: clk-loongson2: Zero init clk_init_data 2023-06-12 18:30:46 -07:00
clk-max9485.c
clk-max77686.c
clk-milbeaut.c clock: milbeaut: use devm_platform_get_and_ioremap_resource() 2023-03-29 14:48:32 -07:00
clk-moxart.c
clk-multiplier.c
clk-mux.c
clk-nomadik.c clk: nomadik: correct struct name kernel-doc warning 2022-12-09 10:26:25 -08:00
clk-npcm7xx.c clk: clk-npcm7xx: Remove unused struct npcm7xx_clk_gate_data and npcm7xx_clk_div_fixed_data 2022-09-28 17:39:04 -07:00
clk-nspire.c
clk-oxnas.c
clk-palmas.c clk: palmas: Convert to platform remove callback returning void 2023-03-28 19:23:37 -07:00
clk-plldig.c
clk-pwm.c clk: pwm: Convert to platform remove callback returning void 2023-03-28 19:23:37 -07:00
clk-qoriq.c
clk-renesas-pcie.c Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
clk-rk808.c
clk-s2mps11.c clk: s2mps11: Convert to platform remove callback returning void 2023-03-28 19:23:37 -07:00
clk-scmi.c
clk-scpi.c clk: scpi: Convert to platform remove callback returning void 2023-03-28 19:23:37 -07:00
clk-si514.c clk: si514: Use managed of_clk_add_hw_provider() 2023-04-10 12:56:24 -07:00
clk-si521xx.c clk: si521xx: Clock driver for Skyworks Si521xx I2C PCIe clock generators 2023-03-27 10:47:42 -07:00
clk-si544.c
clk-si570.c clk: si570: Use managed of_clk_add_hw_provider() 2023-04-10 12:56:24 -07:00
clk-si5341.c
clk-si5351.c clk: si5351: Use managed of_clk_add_hw_provider() 2023-04-10 12:56:25 -07:00
clk-si5351.h
clk-sp7021.c clk: sp7021: Adjust width of _m in HWM_FIELD_PREP() 2023-05-02 18:34:26 -07:00
clk-sparx5.c
clk-stm32f4.c
clk-stm32h7.c clk: stm32h7: Remove an unused field in struct stm32_fractional_divider 2023-04-03 14:10:42 -07:00
clk-stm32mp1.c clk: stm32mp1: Convert to platform remove callback returning void 2023-03-28 19:23:37 -07:00
clk-tps68470.c
clk-twl6040.c
clk-versaclock5.c clk: vc5: Add support for 5P49V60 2023-01-18 10:49:52 -08:00
clk-versaclock7.c Here's the main clk pull request for this merge window. We have some 2022-10-08 10:06:48 -07:00
clk-vt8500.c
clk-wm831x.c
clk-xgene.c clk: clk-xgene: simplify if-if to if-else 2022-10-03 14:13:29 -07:00
clk.c Merge branches 'clk-cleanup', 'clk-aspeed', 'clk-dt', 'clk-renesas' and 'clk-skyworks' into clk-next 2023-04-25 11:49:50 -07:00
clk.h
clk_test.c clk: tests: Add tests for notifiers 2022-10-10 20:37:50 -07:00
clkdev.c clkdev: Simplify devm_clk_hw_register_clkdev() function 2022-09-30 14:50:11 -07:00
Kconfig Nothing looks out of the ordinary in this batch of clk driver updates. There 2023-04-29 17:29:39 -07:00
Makefile Merge branches 'clk-starfive', 'clk-fractional' and 'clk-devmof' into clk-next 2023-04-25 11:50:49 -07:00