[PATCH v2 0/2] rtc: Fix broken RTC alarm support on Qualcomm Glymur and Hamoa/X1E80100 boards
From: Kamal Wadhwa
Date: Mon Nov 02 2026 - 17:43:31 EST
On some Qualcomm targets like Glymur & Hamoa, the SPMI based rtc-pm8xxx.c
driver is unable to receive alarm IRQs. This happens because the SPMI IRQ
permission for receiving the RTC alarms is routed to remote firmware that
implements the TAD feature [1].
TAD feature is a standard feature on Microsoft Windows OS based devices.
Since Glymur and Hamoa were originally launched on Windows OS, unlike the other
Qualcomm targets launched with Android/Linux OS, rtc-pm8xxx.c can not work on
these targets to provide alarm support.
So in order to make the RTC alarm IRQ available on the Linux kernel, the PMIC
RTC Alarm IRQ must be relayed to APPS from the remote firmware via Glink
interface and on the APPS side a new driver is needed to register an RTC device, and
provide time and alarm functionality.
To support this, add a new auxiliary driver rtc-qcom-glink.c under the
existing pmic_glink base driver, which will register an RTC device and will
handle the communication with the remote firmware for RTC related operations via
the pmic_glink interface driver.
[1] See "Control method time and alarm device" in the specification:
Link: https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/acpi-defined-devices
Signed-off-by: Kamal Wadhwa <kamal.wadhwa@xxxxxxxxxxxxxxxx>
---
Changes in v2:
- Extended this series to include Hamoa RTC support (along with Glymur)
- Split the single driver patch into two: the pmic_glink client plumbing is now
its own patch, separate from the RTC driver.
- Fixed a UAF on driver unbind/probe failure by registering the
GLINK client only after the RTC device is allocated, and by
explicitly unregistering the client before cancel_work_sync() in
remove().
- Fixed a timeout in qcom_rtc_glink_request() that could leave the
request/response state out of sync, letting a late firmware response get
mistaken for a subsequent request's.
- Fixed 32-bit wraparound and sign-extension bugs in the time/alarm
math, and removed the ticks-based time fallback entirely along
with the offset tracking it relied on.
- Renamed the GET_PROPERTY/SET_PROPERTY opcodes (and the structs and
helpers built around them) to GET_TIMER_VALUE/SET_TIMER_VALUE to
match the firmware's own wire protocol naming.
- Dropped the "allow-set-time" DT property: the firmware does not
gate RTC writes on it, so it was host-side policy with no
hardware/firmware fact to document, not something devicetree
should express. RTC writes are now always allowed.
- Link to v1:
https://patch.msgid.link/20260807-rtc-glink-cleanup-v1-0-7801e4d69c4f@xxxxxxxxxxxxxxxx
To: Bjorn Andersson <andersson@xxxxxxxxxx>
To: Konrad Dybcio <konradybcio@xxxxxxxxxx>
To: Abel Vesa <abelvesa@xxxxxxxxxx>
To: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
To: Kamal Wadhwa <kamal.wadhwa@xxxxxxxxxxxxxxxx>
Cc: linux-arm-msm@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: linux-rtc@xxxxxxxxxxxxxxx
---
Kamal Wadhwa (2):
soc: qcom: pmic_glink: Add RTC client support
rtc: qcom: rtc-glink: Add new driver to support alarms on Glymur & Hamoa boards
MAINTAINERS | 7 +
drivers/rtc/Kconfig | 10 +
drivers/rtc/Makefile | 1 +
drivers/rtc/rtc-qcom-glink.c | 590 ++++++++++++++++++++++++++++++++++++
drivers/soc/qcom/pmic_glink.c | 43 ++-
include/linux/soc/qcom/pmic_glink.h | 1 +
6 files changed, 651 insertions(+), 1 deletion(-)
---
base-commit: 7649ba73f9e7e1e04d0b46213e39c79ae09dd55c
change-id: 20260806-rtc-glink-cleanup-038163045afd
Best regards,
--
Kamal Wadhwa <kamalw@xxxxxxxxxxxxxxxx>