From: "Thomas Weißschuh" <linux@weissschuh.net>
To: John Stultz <jstultz@google.com>,
Thomas Gleixner <tglx@kernel.org>,
Stephen Boyd <sboyd@kernel.org>,
Miroslav Lichvar <mlichvar@redhat.com>
Cc: linux-kernel@vger.kernel.org, "Thomas Weißschuh" <linux@weissschuh.net>
Subject: [PATCH 0/3] alarmtimer: Drop the spinlock around the rtcdev variable
Date: Mon, 02 Nov 2026 06:11:53 +0000 [thread overview]
Message-ID: <20261102-alarmtimer-locking-v1-0-3c79a698aeae@weissschuh.net> (raw)
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>
next reply other threads:[~2026-11-02 6:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 6:11 Thomas Weißschuh [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261102-alarmtimer-locking-v1-0-3c79a698aeae@weissschuh.net \
--to=linux@weissschuh.net \
--cc=jstultz@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mlichvar@redhat.com \
--cc=sboyd@kernel.org \
--cc=tglx@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®