]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
x86/rtc: Remove __init for runtime functions
authorMatija Glavinic Pecotic <matija.glavinic-pecotic.ext@nokia.com>
Thu, 6 Apr 2023 06:26:52 +0000 (08:26 +0200)
committerRoxana Nicolescu <roxana.nicolescu@canonical.com>
Wed, 17 May 2023 11:34:15 +0000 (13:34 +0200)
commit74390b233a581a9e1d20986cd62d081534b372b9
tree6085ca03e250765c7688b1763fb6ea17cfb00c8d
parentb04099e7a116492c59333251d141a9a23a33c4d2
x86/rtc: Remove __init for runtime functions

BugLink: https://bugs.launchpad.net/bugs/2017219
[ Upstream commit 775d3c514c5b2763a50ab7839026d7561795924d ]

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: c311ed6183f4 ("x86/init: Allow DT configured systems to disable RTC at boot time")
Signed-off-by: Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@nokia.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/59f7ceb1-446b-1d3d-0bc8-1f0ee94b1e18@nokia.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
arch/x86/kernel/x86_init.c