Linux RTC
 help / color / mirror / Atom feed
* [PATCH v2 0/2] rtc: Fix broken RTC alarm support on Qualcomm Glymur and Hamoa/X1E80100 boards
@ 2026-11-02 22:42 Kamal Wadhwa
  2026-11-02 22:42 ` [PATCH v2 1/2] soc: qcom: pmic_glink: Add RTC client support Kamal Wadhwa
  2026-11-02 22:42 ` [PATCH v2 2/2] rtc: qcom: rtc-glink: Add new driver to support alarms on Glymur & Hamoa boards Kamal Wadhwa
  0 siblings, 2 replies; 6+ messages in thread
From: Kamal Wadhwa @ 2026-11-02 22:42 UTC (permalink / raw)
  To: Bjorn Andersson, Konrad Dybcio, Abel Vesa, Alexandre Belloni
  Cc: Kamal Wadhwa, linux-arm-msm, linux-kernel, linux-rtc, Raj Aryan

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@oss.qualcomm.com>
---
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@oss.qualcomm.com

To: Bjorn Andersson <andersson@kernel.org>
To: Konrad Dybcio <konradybcio@kernel.org>
To: Abel Vesa <abelvesa@kernel.org>
To: Alexandre Belloni <alexandre.belloni@bootlin.com>
To: Kamal Wadhwa <kamal.wadhwa@oss.qualcomm.com>
Cc: linux-arm-msm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-rtc@vger.kernel.org

---
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@qti.qualcomm.com>


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

end of thread, other threads:[~2026-11-03  9:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-02 22:42 [PATCH v2 0/2] rtc: Fix broken RTC alarm support on Qualcomm Glymur and Hamoa/X1E80100 boards Kamal Wadhwa
2026-11-02 22:42 ` [PATCH v2 1/2] soc: qcom: pmic_glink: Add RTC client support Kamal Wadhwa
2026-11-02 22:48   ` sashiko-bot
2026-11-03  9:12   ` Abel Vesa
2026-11-02 22:42 ` [PATCH v2 2/2] rtc: qcom: rtc-glink: Add new driver to support alarms on Glymur & Hamoa boards Kamal Wadhwa
2026-11-02 23:06   ` sashiko-bot

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