[PATCH 0/3] alarmtimer: Drop the spinlock around the rtcdev variable
From: Thomas Weißschuh
Date: Mon Nov 02 2026 - 01:13:19 EST
The spinlock serves multiple purposes. It serializes calls to
alarmtimer_rtc_add_device(), making sure the 'rtcdev' variable is
written only once. It also makes the variables values is read in a
consistent state in alarmtimer_get_rtcdev().
But alarmtimer_rtc_add_device() is already synchronized externally
through the driver core's subsystem lock. So additional spinlock can be
dropped at replaced with WRITE_ONCE()/READ_ONCE() for consistent access.
This removes lock/unlock operations from the alarmtimer's clock
callbacks.
Signed-off-by: Thomas Weißschuh <linux@xxxxxxxxxxxxxx>
---
Thomas Weißschuh (3):
alarmtimer: Drop the spinlock around the rtcdev variable
alarmtimer: Return early if platform_device_register_data() fails
alarmtimer: Return early if try_module_get() fails
kernel/time/alarmtimer.c | 36 ++++++++++++++----------------------
1 file changed, 14 insertions(+), 22 deletions(-)
---
base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
change-id: 20261015-alarmtimer-locking-2e7abe32a23a
Best regards,
--
Thomas Weißschuh <linux@xxxxxxxxxxxxxx>