From: Emfox Zhou <emfox@debian.org>
To: Val Packett <val@packett.cool>,
Maximilian Luz <luzmaximilian@gmail.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: "Bjorn Andersson" <andersson@kernel.org>,
"Konrad Dybcio" <konradybcio@kernel.org>,
"Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-rtc@vger.kernel.org
Subject: Re: [PATCH 4/5] rtc: Add basic support for RTC via Surface System Aggregator Module
Date: Mon, 23 Nov 2026 21:11:41 +0800 [thread overview]
Message-ID: <1795439501.1366.emfox@debian.org> (raw)
In-Reply-To: <20261104070441.74127-5-val@packett.cool>
Hi Val,
Tested on a Surface Pro 8 (x86, Tiger Lake): this is not SPX/ARM-only, the
same SAM RTC sits behind the aggregator there. Two things came out of it.
First, as posted the driver cannot bind on the x86 machines: 5/5 adds
ssam_node_rtc only to ssam_node_group_spx[], while the x86 devices come
from the ACPI-matched groups. With one line in ssam_node_group_sp8[],
&ssam_node_rtc,
"ssam:01:01:01:00:00" appears and the driver registers rtc2:
surface_rtc 01:01:01:00:00: registered as rtc2
It would be good to have the node in the other x86 groups as well. Note
that the node name will collide with the SPX one, so whichever lands
first keeps it.
Second, set_time() needs a timezone compensation. The EC keeps UTC in the
SAM timestamp (CID 0x10), but also exposes _GRT (CID 0x1f), the same clock
plus the zone stored in the EC, and the firmware copies _GRT into rtc_cmos
at POST. Right after a cold boot here:
rtc0 read at boot 1795199717
true UTC at boot 1795170940
EC _GRT at boot 1795199714 (zone +28800)
so CMOS came from _GRT, 8 h ahead of UTC. The write side shows the same:
after "hwclock -w -f /dev/rtc2" the SAM timestamp equals system UTC and
_GRT is then UTC + zone, so the next cold boot is off by the zone again.
Either write (UTC - zone), taking the zone from _GRT minus the timestamp,
or state that this RTC is local time and leave the conversion to user
space.
Tested-by: Emfox Zhou <emfox@debian.org> # Surface Pro 8 (x86), with ssam_node_rtc added
Since the same RTC is on the x86 machines, the descriptions are no longer
accurate either: the commit message, the Kconfig help and the MAINTAINERS
entry all name the Pro X:
> + Say yes here if you want to support the RTC functionality of the
> + Surface Aggregator Module (embedded controller) found in the
> + Microsoft Surface Pro X tablet.
> +MICROSOFT SURFACE PRO X RTC DRIVER
Something like "found in Microsoft Surface devices with the Surface
Aggregator Module" for the Kconfig text, and "MICROSOFT SURFACE
AGGREGATOR RTC DRIVER" for the MAINTAINERS entry, would cover the ARM64
Pro X and the x86 machines both. The file header already says
"7th-generation Microsoft Surface devices", so this would make the three
consistent.
Thanks,
Emfox
next prev parent reply other threads:[~2026-11-23 13:12 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 7:04 [PATCH 0/5] Add support for the Microsoft Surface Pro X Val Packett
2026-11-04 7:04 ` [PATCH 1/5] dt-bindings: arm: qcom: Document " Val Packett
2026-11-15 3:25 ` Haipeng Lin
2026-11-04 7:04 ` [PATCH 2/5] arm64: dts: qcom: sc8180x: Add " Val Packett
2026-11-04 8:36 ` Konrad Dybcio
2026-11-04 9:05 ` Val Packett
2026-11-15 3:16 ` Haipeng Lin
2026-11-15 8:20 ` Val Packett
2026-11-15 16:28 ` Haipeng Lin
2026-11-04 7:04 ` [PATCH 3/5] firmware: qcom: scm: Allow QSEECOM on the " Val Packett
2026-11-04 7:04 ` [PATCH 4/5] rtc: Add basic support for RTC via Surface System Aggregator Module Val Packett
2026-11-04 18:44 ` Alexandre Belloni
2026-11-23 13:11 ` Emfox Zhou [this message]
2026-11-04 7:04 ` [PATCH 5/5] platform/surface: aggregator_registry: Add support for Surface Pro X Val Packett
2026-11-15 2:53 ` [PATCH 0/5] Add support for the Microsoft " Haipeng Lin
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=1795439501.1366.emfox@debian.org \
--to=emfox@debian.org \
--cc=alexandre.belloni@bootlin.com \
--cc=andersson@kernel.org \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=luzmaximilian@gmail.com \
--cc=val@packett.cool \
/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