]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
rtc: optee: add alarm related rtc ops to optee rtc driver
authorClément Le Goffic <clement.legoffic@foss.st.com>
Tue, 15 Jul 2025 14:07:15 +0000 (16:07 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Tue, 16 Sep 2025 15:38:21 +0000 (17:38 +0200)
commit6266aea864fa5484f6e8313f913a69e794765fab
tree5f70fe3b3e9af30c432a8d1f94bd5144bfe3577d
parent44fee00f2139894b2ae4433f0661d70134b511c0
rtc: optee: add alarm related rtc ops to optee rtc driver

Add read_alarm and set_alarm ops from the rtc framework.
The support of an alarm is handled by a kernel thread waiting in OP-TEE
for an asynchronous notification that comes in the interrupt
handler of the alarm interruption on OP-TEE secure world.

Once the notification arrives, the kernel thread previously suspended
is rescheduled (this is handled by the OP-TEE kernel driver) and comes
back with the alarm information to the kernel.

A second session is therefore needed to enable/disable/cancel a waiting
alarm event as the kernel thread stopped in OP-TEE takes a form of mutex
on the session and so no one can use this session in parallel.

Signed-off-by: Clément Le Goffic <clement.legoffic@foss.st.com>
Link: https://lore.kernel.org/r/20250715-upstream-optee-rtc-v1-3-e0fdf8aae545@foss.st.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-optee.c