mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/3] alarmtimer: Drop the spinlock around the rtcdev variable
@ 2026-11-02  6:11 Thomas Weißschuh
  2026-11-02  6:11 ` [PATCH 1/3] " Thomas Weißschuh
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Thomas Weißschuh @ 2026-11-02  6:11 UTC (permalink / raw)
  To: John Stultz, Thomas Gleixner, Stephen Boyd, Miroslav Lichvar
  Cc: linux-kernel, Thomas Weißschuh

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@weissschuh.net>
---
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@weissschuh.net>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-02  6:13 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-02  6:11 [PATCH 0/3] alarmtimer: Drop the spinlock around the rtcdev variable Thomas Weißschuh
2026-11-02  6:11 ` [PATCH 1/3] " Thomas Weißschuh
2026-11-02  6:11 ` [PATCH 2/3] alarmtimer: Return early if platform_device_register_data() fails Thomas Weißschuh
2026-11-02  6:11 ` [PATCH 3/3] alarmtimer: Return early if try_module_get() fails Thomas Weißschuh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®