Commit c43cf7c2 authored by Matija Glavinic Pecotic's avatar Matija Glavinic Pecotic Committed by sanglipeng
Browse files

x86/rtc: Remove __init for runtime functions

stable inclusion
from stable-v5.10.178
commit b4210b10dc7ed1439c45c0f840a16d9542868c53
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8ALH3

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b4210b10dc7ed1439c45c0f840a16d9542868c53



--------------------------------

[ Upstream commit 775d3c51 ]

set_rtc_noop(), get_rtc_noop() are after booting, therefore their __init
annotation is wrong.

A crash was observed on an x86 platform where CMOS RTC is unused and
disabled via device tree. set_rtc_noop() was invoked from ntp:
sync_hw_clock(), although CONFIG_RTC_SYSTOHC=n, however sync_cmos_clock()
doesn't honour that.

  Workqueue: events_power_efficient sync_hw_clock
  RIP: 0010:set_rtc_noop
  Call Trace:
   update_persistent_clock64
   sync_hw_clock

Fix this by dropping the __init annotation from set/get_rtc_noop().

Fixes: c311ed61 ("x86/init: Allow DT configured systems to disable RTC at boot time")
Signed-off-by: default avatarMatija Glavinic Pecotic <matija.glavinic-pecotic.ext@nokia.com>
Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/59f7ceb1-446b-1d3d-0bc8-1f0ee94b1e18@nokia.com


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent c5f16eed
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment