|
Jiri Slaby |
0c90d3 |
From: Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@nokia.com>
|
|
Jiri Slaby |
0c90d3 |
Date: Thu, 6 Apr 2023 08:26:52 +0200
|
|
Jiri Slaby |
0c90d3 |
Subject: [PATCH] x86/rtc: Remove __init for runtime functions
|
|
Jiri Slaby |
0c90d3 |
References: bsc#1012628
|
|
Jiri Slaby |
0c90d3 |
Patch-mainline: 6.2.12
|
|
Jiri Slaby |
0c90d3 |
Git-commit: 775d3c514c5b2763a50ab7839026d7561795924d
|
|
Jiri Slaby |
0c90d3 |
|
|
Jiri Slaby |
0c90d3 |
[ Upstream commit 775d3c514c5b2763a50ab7839026d7561795924d ]
|
|
Jiri Slaby |
0c90d3 |
|
|
Jiri Slaby |
0c90d3 |
set_rtc_noop(), get_rtc_noop() are after booting, therefore their __init
|
|
Jiri Slaby |
0c90d3 |
annotation is wrong.
|
|
Jiri Slaby |
0c90d3 |
|
|
Jiri Slaby |
0c90d3 |
A crash was observed on an x86 platform where CMOS RTC is unused and
|
|
Jiri Slaby |
0c90d3 |
disabled via device tree. set_rtc_noop() was invoked from ntp:
|
|
Jiri Slaby |
0c90d3 |
sync_hw_clock(), although CONFIG_RTC_SYSTOHC=n, however sync_cmos_clock()
|
|
Jiri Slaby |
0c90d3 |
doesn't honour that.
|
|
Jiri Slaby |
0c90d3 |
|
|
Jiri Slaby |
0c90d3 |
Workqueue: events_power_efficient sync_hw_clock
|
|
Jiri Slaby |
0c90d3 |
RIP: 0010:set_rtc_noop
|
|
Jiri Slaby |
0c90d3 |
Call Trace:
|
|
Jiri Slaby |
0c90d3 |
update_persistent_clock64
|
|
Jiri Slaby |
0c90d3 |
sync_hw_clock
|
|
Jiri Slaby |
0c90d3 |
|
|
Jiri Slaby |
0c90d3 |
Fix this by dropping the __init annotation from set/get_rtc_noop().
|
|
Jiri Slaby |
0c90d3 |
|
|
Jiri Slaby |
0c90d3 |
Fixes: c311ed6183f4 ("x86/init: Allow DT configured systems to disable RTC at boot time")
|
|
Jiri Slaby |
0c90d3 |
Signed-off-by: Matija Glavinic Pecotic <matija.glavinic-pecotic.ext@nokia.com>
|
|
Jiri Slaby |
0c90d3 |
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
|
Jiri Slaby |
0c90d3 |
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
|
Jiri Slaby |
0c90d3 |
Link: https://lore.kernel.org/r/59f7ceb1-446b-1d3d-0bc8-1f0ee94b1e18@nokia.com
|
|
Jiri Slaby |
0c90d3 |
Signed-off-by: Sasha Levin <sashal@kernel.org>
|
|
Jiri Slaby |
0c90d3 |
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
|
|
Jiri Slaby |
0c90d3 |
---
|
|
Jiri Slaby |
0c90d3 |
arch/x86/kernel/x86_init.c | 4 ++--
|
|
Jiri Slaby |
0c90d3 |
1 file changed, 2 insertions(+), 2 deletions(-)
|
|
Jiri Slaby |
0c90d3 |
|
|
Jiri Slaby |
0c90d3 |
diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c
|
|
Jiri Slaby |
0c90d3 |
index ef80d361..10622cf2 100644
|
|
Jiri Slaby |
0c90d3 |
--- a/arch/x86/kernel/x86_init.c
|
|
Jiri Slaby |
0c90d3 |
+++ b/arch/x86/kernel/x86_init.c
|
|
Jiri Slaby |
0c90d3 |
@@ -33,8 +33,8 @@ static int __init iommu_init_noop(void) { return 0; }
|
|
Jiri Slaby |
0c90d3 |
static void iommu_shutdown_noop(void) { }
|
|
Jiri Slaby |
0c90d3 |
bool __init bool_x86_init_noop(void) { return false; }
|
|
Jiri Slaby |
0c90d3 |
void x86_op_int_noop(int cpu) { }
|
|
Jiri Slaby |
0c90d3 |
-static __init int set_rtc_noop(const struct timespec64 *now) { return -EINVAL; }
|
|
Jiri Slaby |
0c90d3 |
-static __init void get_rtc_noop(struct timespec64 *now) { }
|
|
Jiri Slaby |
0c90d3 |
+static int set_rtc_noop(const struct timespec64 *now) { return -EINVAL; }
|
|
Jiri Slaby |
0c90d3 |
+static void get_rtc_noop(struct timespec64 *now) { }
|
|
Jiri Slaby |
0c90d3 |
|
|
Jiri Slaby |
0c90d3 |
static __initconst const struct of_device_id of_cmos_match[] = {
|
|
Jiri Slaby |
0c90d3 |
{ .compatible = "motorola,mc146818" },
|
|
Jiri Slaby |
0c90d3 |
--
|
|
Jiri Slaby |
0c90d3 |
2.35.3
|
|
Jiri Slaby |
0c90d3 |
|