diff --git a/patches.kernel.org/6.2.12-131-x86-rtc-Remove-__init-for-runtime-functions.patch b/patches.kernel.org/6.2.12-131-x86-rtc-Remove-__init-for-runtime-functions.patch new file mode 100644 index 0000000..e860263 --- /dev/null +++ b/patches.kernel.org/6.2.12-131-x86-rtc-Remove-__init-for-runtime-functions.patch @@ -0,0 +1,54 @@ +From: Matija Glavinic Pecotic +Date: Thu, 6 Apr 2023 08:26:52 +0200 +Subject: [PATCH] x86/rtc: Remove __init for runtime functions +References: bsc#1012628 +Patch-mainline: 6.2.12 +Git-commit: 775d3c514c5b2763a50ab7839026d7561795924d + +[ 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 +Signed-off-by: Thomas Gleixner +Reviewed-by: Andy Shevchenko +Link: https://lore.kernel.org/r/59f7ceb1-446b-1d3d-0bc8-1f0ee94b1e18@nokia.com +Signed-off-by: Sasha Levin +Signed-off-by: Jiri Slaby +--- + arch/x86/kernel/x86_init.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/arch/x86/kernel/x86_init.c b/arch/x86/kernel/x86_init.c +index ef80d361..10622cf2 100644 +--- a/arch/x86/kernel/x86_init.c ++++ b/arch/x86/kernel/x86_init.c +@@ -33,8 +33,8 @@ static int __init iommu_init_noop(void) { return 0; } + static void iommu_shutdown_noop(void) { } + bool __init bool_x86_init_noop(void) { return false; } + void x86_op_int_noop(int cpu) { } +-static __init int set_rtc_noop(const struct timespec64 *now) { return -EINVAL; } +-static __init void get_rtc_noop(struct timespec64 *now) { } ++static int set_rtc_noop(const struct timespec64 *now) { return -EINVAL; } ++static void get_rtc_noop(struct timespec64 *now) { } + + static __initconst const struct of_device_id of_cmos_match[] = { + { .compatible = "motorola,mc146818" }, +-- +2.35.3 + diff --git a/series.conf b/series.conf index 9f42d3d..28bbc59 100644 --- a/series.conf +++ b/series.conf @@ -2358,6 +2358,7 @@ patches.kernel.org/6.2.12-128-i2c-mchp-pci1xxxx-Update-Timing-registers.patch patches.kernel.org/6.2.12-129-powerpc-papr_scm-Update-the-NUMA-distance-tabl.patch patches.kernel.org/6.2.12-130-sched-fair-Fix-imbalance-overflow.patch + patches.kernel.org/6.2.12-131-x86-rtc-Remove-__init-for-runtime-functions.patch ######################################################## # Build fixes that apply to the vanilla kernel too.