Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

clocksource/drivers/ingenic: Fix section mismatch

The function ingenic_tcu_get_clock() is annotated for the __init
section but it is actually called from the online cpu callback.

That will lead to a crash if a CPU is hotplugged after boot time.

Remove the __init annotation for the ingenic_tcu_get_clock()
function.

Fixes: f19d838d08fc (clocksource/drivers/ingenic: Add high resolution timer support for SMP/SMT)
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Reviewed-by: Paul Cercueil <paul@crapouillou.net>
Tested-by: 周琰杰 (Zhou Yanjie) <zhouyanjie@wanyeetech.com>
Link: https://lore.kernel.org/r/20201125102346.1816310-1-daniel.lezcano@linaro.org

+1 -1
+1 -1
drivers/clocksource/ingenic-timer.c
··· 127 127 return IRQ_HANDLED; 128 128 } 129 129 130 - static struct clk * __init ingenic_tcu_get_clock(struct device_node *np, int id) 130 + static struct clk *ingenic_tcu_get_clock(struct device_node *np, int id) 131 131 { 132 132 struct of_phandle_args args; 133 133