<feed xmlns='http://www.w3.org/2005/Atom'>
<title>laptop-kernel/drivers/rtc, branch master</title>
<subtitle>Linux kernel tree for laptop</subtitle>
<id>https://git.zx2c4.com/laptop-kernel/atom/drivers/rtc?h=master</id>
<link rel='self' href='https://git.zx2c4.com/laptop-kernel/atom/drivers/rtc?h=master'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/'/>
<updated>2026-09-21T20:46:42Z</updated>
<entry>
<title>rtc: spear: initialize IRQ state before requesting alarm IRQ</title>
<updated>2026-09-21T20:46:42Z</updated>
<author>
<name>Runyu Xiao</name>
<email>runyu.xiao@seu.edu.cn</email>
</author>
<published>2026-09-02T08:03:18Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=055ef5ce9f67a6a3a1363fa663007f8196cc0fb8'/>
<id>urn:sha1:055ef5ce9f67a6a3a1363fa663007f8196cc0fb8</id>
<content type='text'>
devm_request_irq() enables the interrupt before it returns, so the handler
may run while probe is still initializing the device. Initialize the MMIO
address and spinlock before requesting the alarm IRQ.

Fixes: 0942a71e435f ("rtc: add support for spear rtc")
Cc: stable@vger.kernel.org
Assisted-by: Codex:GPT-5
Signed-off-by: Runyu Xiao &lt;runyu.xiao@seu.edu.cn&gt;
Link: https://patch.msgid.link/20260902080318.3498434-1-runyu.xiao@seu.edu.cn
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: mpfs: fix unchecked devm_clk_get() error pointer in probe()</title>
<updated>2026-09-21T19:28:17Z</updated>
<author>
<name>Manush Prajwal</name>
<email>manushprajwal555@gmail.com</email>
</author>
<published>2026-09-06T11:14:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=ac41b05d15db3134e839148290d67415ee0bdb58'/>
<id>urn:sha1:ac41b05d15db3134e839148290d67415ee0bdb58</id>
<content type='text'>
devm_clk_get(&amp;pdev-&gt;dev, "rtcref")'s return value was passed straight
into clk_get_rate() without checking it for an error first, unlike the
"rtc" clock a few lines above which is correctly checked with
IS_ERR(). clk_get_rate() only guards against a NULL clk, not an error
pointer:

	if (!clk)
		return 0;
	...
	rate = clk_core_get_rate_recalc(clk-&gt;core);

so if devm_clk_get() ever returns an error pointer here (for example
ERR_PTR(-EPROBE_DEFER), which is the normal, expected outcome if the
clkcfg clock-provider this RTC depends on has not registered its
clocks yet by the time this driver probes), clk_get_rate() dereferences
that error pointer instead of returning 0, crashing instead of letting
probe defer.

Capture the clock in the existing 'clk' local and check it with
IS_ERR() before calling clk_get_rate(), matching the handling already
used for the "rtc" clock in this same function.

Signed-off-by: Manush Prajwal &lt;manushprajwal555@gmail.com&gt;
Fixes: 0b31d703598d ("rtc: Add driver for Microchip PolarFire SoC")
Reviewed-by: Conor Dooley &lt;conor.dooley@microchip.com&gt;
Link: https://patch.msgid.link/6a9d4b02.7d74b517.206c4c.75f8@mx.google.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: ac100: Fix clock provider use-after-free on probe failure</title>
<updated>2026-09-21T19:26:40Z</updated>
<author>
<name>Aamir Ahmed</name>
<email>elb12345@hotmail.co.uk</email>
</author>
<published>2026-09-05T20:41:52Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=fcf0b58e976e83adf246b014518e49c662b96f5e'/>
<id>urn:sha1:fcf0b58e976e83adf246b014518e49c662b96f5e</id>
<content type='text'>
ac100_rtc_register_clks() registers the RTC-32k clock with
clk_hw_register_fixed_rate() and the clock provider with
of_clk_add_hw_provider(). Neither is device managed, and both are
released only from ac100_rtc_remove(). The driver core does not call
remove() when probe() fails: really_probe() reaches probe_failed below
the device_remove() call and goes straight to releasing the device's
managed resources.

ac100_rtc_probe() ends with

	return devm_rtc_register_device(chip-&gt;rtc);

so if that fails after the clocks have been registered, the provider is
left on the global of_clk_providers list holding chip-&gt;clk_data, which
was allocated with devm_kzalloc() and is freed while probe() unwinds. A
later lookup on this device tree node then reads freed memory in
of_clk_hw_onecell_get(). Consumers that do exactly that exist in tree:
the wifi power sequence nodes on sun8i-a83t-bananapi-m3 and
sun8i-a83t-cubietruck-plus take &lt;&amp;ac100_rtc 1&gt;, and the sun9i-a80 boards
route osc32k through &lt;&amp;ac100_rtc 0&gt;. The window is narrow, as
devm_rtc_register_device() can only fail with -ENOMEM here, but the
provider is left dangling whenever it does.

The RTC-32k clock is leaked on the same path. Since clk_core_lookup()
searches a global list that is not scoped per device, __clk_register()
rejects the duplicate name with -EEXIST, so the leak also makes a later
probe of the same device fail.

The error path that returns -EINVAL when the ADDA 4M parent clock cannot
be found leaks the RTC-32k clock in the same way. No provider has been
registered at that point, so that one is a leak rather than a
use-after-free.

Register both with devm_clk_hw_register_fixed_rate() and
devm_of_clk_add_hw_provider() so that they are released whenever the
device goes away, on a failed probe as well as on unbind. Devres
releases in reverse order of acquisition, so the provider is removed
before chip-&gt;clk_data is freed, and the clkout children are now
unregistered before their parent rather than after it.
ac100_rtc_unregister_clks() and the remove callback then have nothing
left to do and are removed.

Fixes: d00a18a42c14 ("rtc: ac100: Add RTC driver for X-Powers AC100")
Reported-by: Sashiko AI &lt;sashiko-bot@kernel.org&gt;
Closes: https://lore.kernel.org/linux-rtc/20260905184936.155E11F00A3A@smtp.kernel.org/
Assisted-by: LLM
Signed-off-by: Aamir Ahmed &lt;elb12345@hotmail.co.uk&gt;
Link: https://patch.msgid.link/AS8P251MB0001A489CC45A591ABBB9BDCC8B42@AS8P251MB0001.EURP251.PROD.OUTLOOK.COM
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: ac100: Assign .num before accessing .hws</title>
<updated>2026-09-21T19:23:44Z</updated>
<author>
<name>Aamir Ahmed</name>
<email>elb12345@hotmail.co.uk</email>
</author>
<published>2026-09-05T18:38:08Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=6a4117eee82dd85f11bf898bf66026764011eeb6'/>
<id>urn:sha1:6a4117eee82dd85f11bf898bf66026764011eeb6</id>
<content type='text'>
Commit f316cdff8d67 ("clk: Annotate struct clk_hw_onecell_data with
__counted_by") annotated the hws member of 'struct clk_hw_onecell_data'
with __counted_by, which informs the bounds sanitizer (UBSAN_BOUNDS)
about the number of elements in .hws[], so that it can warn when .hws[]
is accessed out of bounds. As noted in that change, the __counted_by
member must be initialized with the number of elements before the first
array access happens, otherwise there will be a warning from each access
prior to the initialization because the number of elements is zero.
This occurs in ac100_rtc_register_clks() due to .num being assigned only
after every clkout clock has been stored in .hws[]. With
CONFIG_UBSAN_BOUNDS and a compiler that implements __counted_by (GCC
15.1+ or Clang 20.1+), this triggers an array-index-out-of-bounds report
during probe, and with CONFIG_UBSAN_TRAP the first store traps.

Initialize .num with AC100_CLKOUT_NUM, the number of elements .hws[] was
allocated with, right after the allocation. That is the value the loop
counter ends up at on the success path anyway, so the provider's
behaviour is unchanged.

Cc: stable@vger.kernel.org
Fixes: f316cdff8d67 ("clk: Annotate struct clk_hw_onecell_data with __counted_by")
Assisted-by: LLM
Signed-off-by: Aamir Ahmed &lt;elb12345@hotmail.co.uk&gt;
Reviewed-by: Chen-Yu Tsai &lt;wens@kernel.org&gt;
Reviewed-by: Gustavo A. R. Silva &lt;gustavoars@kernel.org&gt;
Link: https://patch.msgid.link/AS8P251MB00013E724A77A355668B6CCEC8B42@AS8P251MB0001.EURP251.PROD.OUTLOOK.COM
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: efi: restore alarm support with runtime capability probe</title>
<updated>2026-09-21T19:13:42Z</updated>
<author>
<name>Johnny.Fan</name>
<email>Johnny.Fan@cixtech.com</email>
</author>
<published>2026-08-31T14:00:14Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=b430d1f6d80c005b486f028910e1ac3c91812710'/>
<id>urn:sha1:b430d1f6d80c005b486f028910e1ac3c91812710</id>
<content type='text'>
Restore the EFI RTC alarm functionality (read_alarm/set_alarm and
procfs output) that was removed by commit 18a3510bc87d ("rtc: efi:
Remove wakeup functionality").

The removal was motivated by the observation that many EFI platforms
lack RTC wakeup support while also omitting the RT_PROP table, causing
the wakeup capability to be incorrectly advertised.  While that is
true, removing the feature entirely also breaks platforms where the
wakeup runtime service actually works.

On CIX SoCs, the RTC is an I2C device owned by firmware, and in the
ACPI boot configuration the I2C bus it sits on is not exposed to the
OS, so the EFI runtime services are the only way Linux can access
the RTC at all.  Both Linux and Windows use this same interface by
design, so the RTC state is consistent across the operating systems
installed on the machine, and Windows relies on the EFI wakeup
services for its own RTC alarm support.

With the alarm support removed from rtc-efi, Linux loses the
equivalent capability entirely on these platforms: rtcwake fails
for both suspend-to-RAM and power-off wakeup, as there is no other
path to program the RTC alarm.  This is a real product requirement
that CIX customers have explicitly requested, not a hypothetical
use case.

To avoid exposing a broken alarm on firmware that does not implement
the wakeup runtime services, probe the capability at -&gt;probe() time by
actually calling GetWakeupTime() -- if it fails, clear RTC_FEATURE_ALARM
and the device behaves as before the removal.

Also set RTC_FEATURE_ALARM_WAKEUP_ONLY since EFI wakeup time is a
wakeup-only alarm, not a periodic/update interrupt source.

Acked-by: Ard Biesheuvel &lt;ardb@kernel.org&gt;
Reviewed-by: Feng Tang &lt;feng.tang@linux.alibaba.com&gt;
Reviewed-by: Fugang Duan &lt;fugang.duan@cixtech.com&gt;
Signed-off-by: Johnny.Fan &lt;Johnny.Fan@cixtech.com&gt;
Link: https://patch.msgid.link/20260831140014.839222-1-johnny.fan@cixtech.com
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: dev: zero-initialize struct rtc_wkalrm to prevent information leak</title>
<updated>2026-09-21T19:12:35Z</updated>
<author>
<name>Liu Dalin</name>
<email>liudalin@kylinsec.com.cn</email>
</author>
<published>2026-08-27T01:54:44Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=0ee5c5d804d592a8328a425b9274487d393d3a05'/>
<id>urn:sha1:0ee5c5d804d592a8328a425b9274487d393d3a05</id>
<content type='text'>
The struct rtc_wkalrm has padding holes after the 'pending' member.
When returned to userspace via the RTC_WKALRM_RD ioctl, uninitialized
kernel stack data residing in these holes may be leaked.

Zero-initialize the struct at declaration to eliminate this information
leak risk.

Fixes smatch warnings:
- drivers/rtc/dev.c:392 rtc_dev_ioctl() warn: check that 'alarm' doesn't
  leak information (struct has a hole after 'pending')

Fixes: 36e14f5fdfdf ("rtc: rename core files")
Assisted-by: smatch:2.0 [static analysis]
Signed-off-by: Liu Dalin &lt;liudalin@kylinsec.com.cn&gt;
Link: https://patch.msgid.link/B28B7DE18F3A9447+20260827015444.3314227-1-liudalin@kylinsec.com.cn
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'rtc-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux</title>
<updated>2026-08-28T16:53:43Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-08-28T16:53:43Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=275bc4eedf2c6081200998954efcb5eb90413a41'/>
<id>urn:sha1:275bc4eedf2c6081200998954efcb5eb90413a41</id>
<content type='text'>
Pull RTC updates from Alexandre Belloni:
 "The RZN1 driver got a fairly comprehensive cleanup. More DT binding
  are converted to DT schema, leaving only 5 remaining files to convert.

  Subsystem:
   - patchwork project is moving to kernel.org
   - fully initialize clk_init_data
   - add missing MODULE_DEVICE_TABLE()
   - DT bindings conversions to DT schema

  Drivers:
   - ds1307: fix WADA bit for alarms on RX8130
   - rzn1: add support for RZ/T2H and RZ/N2H, many fixes"

* tag 'rtc-7.3' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (42 commits)
  MAINTAINERS: update rtc subsystem patchwork location
  rtc: msc313: Select by default on MSTARV7
  rtc: microcrystal: Make sure clk_init_data is fully initialized
  rtc: philips: Make sure clk_init_data is fully initialized
  rtc: nct3018y: Make sure clk_init_data is fully initialized
  rtc: m41t80: Make sure clk_init_data is fully initialized
  rtc: hym8563: Make sure clk_init_data is fully initialized
  rtc: rzn1: Add support for Renesas RZ/T2H and RZ/N2H SoCs
  rtc: rzn1: Drop trailing comma from OF match table sentinel
  rtc: rzn1: Add OF match data to gate SUBU register access
  rtc: rzn1: use FIELD_PREP/FIELD_GET and GENMASK for register access
  rtc: rzn1: Consistently use dev_err_probe()
  rtc: rzn1: Use temporary variable for struct device
  rtc: rzn1: Dynamically calculate synchronization delay based on clock rate
  rtc: rzn1: Replace remove callback with devm_add_action_or_reset()
  rtc: rzn1: Use pm_runtime_put_sync()
  rtc: Kconfig: Broaden RTC_DRV_RZN1 dependency to ARCH_RENESAS
  rtc: rzn1: Fix malformed MODULE_AUTHOR string
  rtc: rzn1: Disable alarm interrupt before reprogramming alarm registers
  rtc: rzn1: Fix alarm range check truncation on 32-bit systems
  ...
</content>
</entry>
<entry>
<title>rtc: msc313: Select by default on MSTARV7</title>
<updated>2026-08-24T12:56:17Z</updated>
<author>
<name>Daniel Palmer</name>
<email>daniel@0x0f.com</email>
</author>
<published>2026-07-13T13:39:19Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=c9e17e381e021536a9f0fe36f4c9c693d6c0f27c'/>
<id>urn:sha1:c9e17e381e021536a9f0fe36f4c9c693d6c0f27c</id>
<content type='text'>
All of the ARCH_MSTARV7 chips have this RTC so it's more likely
ARCH_MSTARV7 wants it than doesn't.

At the same time fix up the indent on the depends on line that looks
like it got converted from a tab to spaces at some point.

Signed-off-by: Daniel Palmer &lt;daniel@0x0f.com&gt;
Link: https://patch.msgid.link/20260713133919.1356748-1-daniel@thingy.jp
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: microcrystal: Make sure clk_init_data is fully initialized</title>
<updated>2026-08-23T19:49:51Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2026-08-21T10:09:06Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=a12eac458814f70ed9b0b2e3293b7478c7032eaa'/>
<id>urn:sha1:a12eac458814f70ed9b0b2e3293b7478c7032eaa</id>
<content type='text'>
The clk_init_data structure contains several mutually-exclusive members
for different methods to specify the possible parents of a clock,
prompting drivers to initialize only the members they need.  However,
not initializing all members may cause subtle issues, which are only
exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
enabled.

Make sure all members are fully initialized, to avoid such bugs, and to
prevent future breakage when converting drivers to a different method
for specifying the parents.

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Link: https://patch.msgid.link/6e7b5258ff73e93fe23dd83cf56f806ee60fa7a9.1787241693.git.geert+renesas@glider.be
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
<entry>
<title>rtc: philips: Make sure clk_init_data is fully initialized</title>
<updated>2026-08-23T19:49:51Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2026-08-21T10:09:05Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/laptop-kernel/commit/?id=5ef3d51a3aaae642f8e5515a2c67c17f6b7cb01c'/>
<id>urn:sha1:5ef3d51a3aaae642f8e5515a2c67c17f6b7cb01c</id>
<content type='text'>
The clk_init_data structure contains several mutually-exclusive members
for different methods to specify the possible parents of a clock,
prompting drivers to initialize only the members they need.  However,
not initializing all members may cause subtle issues, which are only
exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
enabled.

Make sure all members are fully initialized, to avoid such bugs, and to
prevent future breakage when converting drivers to a different method
for specifying the parents.

Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Link: https://patch.msgid.link/8281eaf605069aac2211d83233e11285b8e8ca84.1787241693.git.geert+renesas@glider.be
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
</content>
</entry>
</feed>
