Skip to content

alarmtimer: Drop the spinlock around the rtcdev variable

Thomas Weißschuh lkml 1 version Applied

Status from this message: The following commit has been merged into the timers/core branch of tip:

Get series with b4
b4 am [email protected] change-id 20261015-alarmtimer-locking-2e7abe32a23a

Versions newest first

  1. v1 Latest3 patches 1 replyApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3alarmtimer: Drop the spinlock around the rtcdev variablekernel/time/alarmtimer.c+8 -160 replies
2/3alarmtimer: Return early if platform_device_register_data() failskernel/time/alarmtimer.c+5 -30 replies
3/3alarmtimer: Return early if try_module_get() failskernel/time/alarmtimer.c+8 -101 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] alarmtimer: Drop the spinlock around the rtcdev variable

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.

---
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,

Signature · 1 line
Thomas Weißschuh <[email protected]>