Skip to contentSkip to conversation

rtc: zynqmp: Add shutdown callback for kexec support

PATCH In review Harini T 2 participants 2 messages Jul 24, 2025

Subsystems (2)
lore
Share & tools
lore

Harini T

author
#0 lore raw

PATCH 1/1 rtc: zynqmp: Add shutdown callback for kexec support

During kexec, the hardware is not reset and any enabled interrupts can interfere with the new kernel's RTC initialization.

The shutdown callback reuses the existing remove function to disable alarm interrupts and wakeup capability, putting the device in a quiescent state rather than completely removing it.

---
 drivers/rtc/rtc-zynqmp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/rtc/rtc-zynqmp.c +1 -0
index f39102b66eac..26893367f0f5 100644
@@ -383,6 +383,7 @@ MODULE_DEVICE_TABLE(of, xlnx_rtc_of_match);
 static struct platform_driver xlnx_rtc_driver = {
 	.probe		= xlnx_rtc_probe,
 	.remove		= xlnx_rtc_remove,
+	.shutdown	= xlnx_rtc_remove,
 	.driver		= {
 		.name	= KBUILD_MODNAME,
 		.pm	= &xlnx_rtc_pm_ops,
Signature · 1 line
2.43.0
#1 lore raw
Quoted 2 lines · Harini T

During kexec, the hardware is not reset and any enabled interrupts can interfere with the new kernel's RTC initialization.

Please elaborate on the issue because alarm are supposed to stay enabled across reboots, this is the whole point of the RTC.

Quoted 25 lines

The shutdown callback reuses the existing remove function to disable alarm interrupts and wakeup capability, putting the device in a quiescent state rather than completely removing it.

---
 drivers/rtc/rtc-zynqmp.c | 1 +
 1 file changed, 1 insertion(+)
drivers/rtc/rtc-zynqmp.c +1 -0
index f39102b66eac..26893367f0f5 100644
@@ -383,6 +383,7 @@ MODULE_DEVICE_TABLE(of, xlnx_rtc_of_match);
 static struct platform_driver xlnx_rtc_driver = {
 	.probe		= xlnx_rtc_probe,
 	.remove		= xlnx_rtc_remove,
+	.shutdown	= xlnx_rtc_remove,
 	.driver		= {
 		.name	= KBUILD_MODNAME,
 		.pm	= &xlnx_rtc_pm_ops,
Signature · 1 line
2.43.0
Signature · 3 lines
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com