Bug 212313

Summary: Surface Pro 7 RTC does not persist across reboot
Product: Timers Reporter: quo (tuple)
Component: Realtime ClockAssignee: timers_realtime-clock
Status: NEW ---    
Severity: normal    
Priority: P1    
Hardware: x86-64   
OS: Linux   
Kernel Version: 5.10 Subsystem:
Regression: No Bisected commit-id:

Description quo 2021-03-17 11:14:15 UTC
See also: https://github.com/linux-surface/linux-surface/issues/415

On the Surface Pro 7, the CMOS RTC is not persistent across reboots. If you set its value with "hwclock -w", a subsequent "hwclock -r" shows that it has been set, but after a reboot, "hwclock -r" will show the old time again.

The CMOS RTC on SP6 and earlier Surface Pro models works fine.

The SP7 also has an EFI RTC interface. However, enabling the efi_rtc driver shows that this is simply an alternative interface for the CMOS RTC, so it has the same problem.

The SP7 also has an ACPI TAD (Time and Alarm Device), and its RTC value does seem to persist across reboots. However, there are a number of small issues:

1. The acpi_tad driver fails to load, with the error message "Missing _PRW". By removing the check for _PRW, the driver loads correctly.

2. The acpi_tad driver does not expose a /dev/rtc interface, it only has a sysfs interface. It seems there was an attempt to add a TAD RTC driver back in 2013/2014 (before the creation of the current driver in 2018), but as far as I can tell it didn't really go anywhere: https://lore.kernel.org/lkml/1775986.qxTh3ADDRn@skinner/T/

3. When reading the time using acpi_tad, the timezone field is always set to 2047. When setting the time, if the timezone is 2047, it silently fails to update the time. All other fields work correctly, and setting the timezone to any value from -1440 to 1440 works (although when reading the timezone is reset to 2047).

ACPI dumps can be found here: https://github.com/linux-surface/acpidumps