<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/rtc, branch v5.15</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.15</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.15'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2021-09-14T08:20:19Z</updated>
<entry>
<title>rtc: cmos: Disable irq around direct invocation of cmos_interrupt()</title>
<updated>2021-09-14T08:20:19Z</updated>
<author>
<name>Chris Wilson</name>
<email>chris@chris-wilson.co.uk</email>
</author>
<published>2021-03-05T12:21:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=13be2efc390acd2a46a69a359f6efc00ca434599'/>
<id>urn:sha1:13be2efc390acd2a46a69a359f6efc00ca434599</id>
<content type='text'>
As previously noted in commit 66e4f4a9cc38 ("rtc: cmos: Use
spin_lock_irqsave() in cmos_interrupt()"):

&lt;4&gt;[  254.192378] WARNING: inconsistent lock state
&lt;4&gt;[  254.192384] 5.12.0-rc1-CI-CI_DRM_9834+ #1 Not tainted
&lt;4&gt;[  254.192396] --------------------------------
&lt;4&gt;[  254.192400] inconsistent {IN-HARDIRQ-W} -&gt; {HARDIRQ-ON-W} usage.
&lt;4&gt;[  254.192409] rtcwake/5309 [HC0[0]:SC0[0]:HE1:SE1] takes:
&lt;4&gt;[  254.192429] ffffffff8263c5f8 (rtc_lock){?...}-{2:2}, at: cmos_interrupt+0x18/0x100
&lt;4&gt;[  254.192481] {IN-HARDIRQ-W} state was registered at:
&lt;4&gt;[  254.192488]   lock_acquire+0xd1/0x3d0
&lt;4&gt;[  254.192504]   _raw_spin_lock+0x2a/0x40
&lt;4&gt;[  254.192519]   cmos_interrupt+0x18/0x100
&lt;4&gt;[  254.192536]   rtc_handler+0x1f/0xc0
&lt;4&gt;[  254.192553]   acpi_ev_fixed_event_detect+0x109/0x13c
&lt;4&gt;[  254.192574]   acpi_ev_sci_xrupt_handler+0xb/0x28
&lt;4&gt;[  254.192596]   acpi_irq+0x13/0x30
&lt;4&gt;[  254.192620]   __handle_irq_event_percpu+0x43/0x2c0
&lt;4&gt;[  254.192641]   handle_irq_event_percpu+0x2b/0x70
&lt;4&gt;[  254.192661]   handle_irq_event+0x2f/0x50
&lt;4&gt;[  254.192680]   handle_fasteoi_irq+0x9e/0x150
&lt;4&gt;[  254.192693]   __common_interrupt+0x76/0x140
&lt;4&gt;[  254.192715]   common_interrupt+0x96/0xc0
&lt;4&gt;[  254.192732]   asm_common_interrupt+0x1e/0x40
&lt;4&gt;[  254.192750]   _raw_spin_unlock_irqrestore+0x38/0x60
&lt;4&gt;[  254.192767]   resume_irqs+0xba/0xf0
&lt;4&gt;[  254.192786]   dpm_resume_noirq+0x245/0x3d0
&lt;4&gt;[  254.192811]   suspend_devices_and_enter+0x230/0xaa0
&lt;4&gt;[  254.192835]   pm_suspend.cold.8+0x301/0x34a
&lt;4&gt;[  254.192859]   state_store+0x7b/0xe0
&lt;4&gt;[  254.192879]   kernfs_fop_write_iter+0x11d/0x1c0
&lt;4&gt;[  254.192899]   new_sync_write+0x11d/0x1b0
&lt;4&gt;[  254.192916]   vfs_write+0x265/0x390
&lt;4&gt;[  254.192933]   ksys_write+0x5a/0xd0
&lt;4&gt;[  254.192949]   do_syscall_64+0x33/0x80
&lt;4&gt;[  254.192965]   entry_SYSCALL_64_after_hwframe+0x44/0xae
&lt;4&gt;[  254.192986] irq event stamp: 43775
&lt;4&gt;[  254.192994] hardirqs last  enabled at (43775): [&lt;ffffffff81c00c42&gt;] asm_sysvec_apic_timer_interrupt+0x12/0x20
&lt;4&gt;[  254.193023] hardirqs last disabled at (43774): [&lt;ffffffff81aa691a&gt;] sysvec_apic_timer_interrupt+0xa/0xb0
&lt;4&gt;[  254.193049] softirqs last  enabled at (42548): [&lt;ffffffff81e00342&gt;] __do_softirq+0x342/0x48e
&lt;4&gt;[  254.193074] softirqs last disabled at (42543): [&lt;ffffffff810b45fd&gt;] irq_exit_rcu+0xad/0xd0
&lt;4&gt;[  254.193101]
                  other info that might help us debug this:
&lt;4&gt;[  254.193107]  Possible unsafe locking scenario:

&lt;4&gt;[  254.193112]        CPU0
&lt;4&gt;[  254.193117]        ----
&lt;4&gt;[  254.193121]   lock(rtc_lock);
&lt;4&gt;[  254.193137]   &lt;Interrupt&gt;
&lt;4&gt;[  254.193142]     lock(rtc_lock);
&lt;4&gt;[  254.193156]
                   *** DEADLOCK ***

&lt;4&gt;[  254.193161] 6 locks held by rtcwake/5309:
&lt;4&gt;[  254.193174]  #0: ffff888104861430 (sb_writers#5){.+.+}-{0:0}, at: ksys_write+0x5a/0xd0
&lt;4&gt;[  254.193232]  #1: ffff88810f823288 (&amp;of-&gt;mutex){+.+.}-{3:3}, at: kernfs_fop_write_iter+0xe7/0x1c0
&lt;4&gt;[  254.193282]  #2: ffff888100cef3c0 (kn-&gt;active#285
&lt;7&gt;[  254.192706] i915 0000:00:02.0: [drm:intel_modeset_setup_hw_state [i915]] [CRTC:51:pipe A] hw state readout: disabled
&lt;4&gt;[  254.193307] ){.+.+}-{0:0}, at: kernfs_fop_write_iter+0xf0/0x1c0
&lt;4&gt;[  254.193333]  #3: ffffffff82649fa8 (system_transition_mutex){+.+.}-{3:3}, at: pm_suspend.cold.8+0xce/0x34a
&lt;4&gt;[  254.193387]  #4: ffffffff827a2108 (acpi_scan_lock){+.+.}-{3:3}, at: acpi_suspend_begin+0x47/0x70
&lt;4&gt;[  254.193433]  #5: ffff8881019ea178 (&amp;dev-&gt;mutex){....}-{3:3}, at: device_resume+0x68/0x1e0
&lt;4&gt;[  254.193485]
                  stack backtrace:
&lt;4&gt;[  254.193492] CPU: 1 PID: 5309 Comm: rtcwake Not tainted 5.12.0-rc1-CI-CI_DRM_9834+ #1
&lt;4&gt;[  254.193514] Hardware name: Google Soraka/Soraka, BIOS MrChromebox-4.10 08/25/2019
&lt;4&gt;[  254.193524] Call Trace:
&lt;4&gt;[  254.193536]  dump_stack+0x7f/0xad
&lt;4&gt;[  254.193567]  mark_lock.part.47+0x8ca/0xce0
&lt;4&gt;[  254.193604]  __lock_acquire+0x39b/0x2590
&lt;4&gt;[  254.193626]  ? asm_sysvec_apic_timer_interrupt+0x12/0x20
&lt;4&gt;[  254.193660]  lock_acquire+0xd1/0x3d0
&lt;4&gt;[  254.193677]  ? cmos_interrupt+0x18/0x100
&lt;4&gt;[  254.193716]  _raw_spin_lock+0x2a/0x40
&lt;4&gt;[  254.193735]  ? cmos_interrupt+0x18/0x100
&lt;4&gt;[  254.193758]  cmos_interrupt+0x18/0x100
&lt;4&gt;[  254.193785]  cmos_resume+0x2ac/0x2d0
&lt;4&gt;[  254.193813]  ? acpi_pm_set_device_wakeup+0x1f/0x110
&lt;4&gt;[  254.193842]  ? pnp_bus_suspend+0x10/0x10
&lt;4&gt;[  254.193864]  pnp_bus_resume+0x5e/0x90
&lt;4&gt;[  254.193885]  dpm_run_callback+0x5f/0x240
&lt;4&gt;[  254.193914]  device_resume+0xb2/0x1e0
&lt;4&gt;[  254.193942]  ? pm_dev_err+0x25/0x25
&lt;4&gt;[  254.193974]  dpm_resume+0xea/0x3f0
&lt;4&gt;[  254.194005]  dpm_resume_end+0x8/0x10
&lt;4&gt;[  254.194030]  suspend_devices_and_enter+0x29b/0xaa0
&lt;4&gt;[  254.194066]  pm_suspend.cold.8+0x301/0x34a
&lt;4&gt;[  254.194094]  state_store+0x7b/0xe0
&lt;4&gt;[  254.194124]  kernfs_fop_write_iter+0x11d/0x1c0
&lt;4&gt;[  254.194151]  new_sync_write+0x11d/0x1b0
&lt;4&gt;[  254.194183]  vfs_write+0x265/0x390
&lt;4&gt;[  254.194207]  ksys_write+0x5a/0xd0
&lt;4&gt;[  254.194232]  do_syscall_64+0x33/0x80
&lt;4&gt;[  254.194251]  entry_SYSCALL_64_after_hwframe+0x44/0xae
&lt;4&gt;[  254.194274] RIP: 0033:0x7f07d79691e7
&lt;4&gt;[  254.194293] Code: 64 89 02 48 c7 c0 ff ff ff ff eb bb 0f 1f 80 00 00 00 00 f3 0f 1e fa 64 8b 04 25 18 00 00 00 85 c0 75 10 b8 01 00 00 00 0f 05 &lt;48&gt; 3d 00 f0 ff ff 77 51 c3 48 83 ec 28 48 89 54 24 18 48 89 74 24
&lt;4&gt;[  254.194312] RSP: 002b:00007ffd9cc2c768 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
&lt;4&gt;[  254.194337] RAX: ffffffffffffffda RBX: 0000000000000004 RCX: 00007f07d79691e7
&lt;4&gt;[  254.194352] RDX: 0000000000000004 RSI: 0000556ebfc63590 RDI: 000000000000000b
&lt;4&gt;[  254.194366] RBP: 0000556ebfc63590 R08: 0000000000000000 R09: 0000000000000004
&lt;4&gt;[  254.194379] R10: 0000556ebf0ec2a6 R11: 0000000000000246 R12: 0000000000000004

which breaks S3-resume on fi-kbl-soraka presumably as that's slow enough
to trigger the alarm during the suspend.

Fixes: 6950d046eb6e ("rtc: cmos: Replace spin_lock_irqsave with spin_lock in hard IRQ")
References: 66e4f4a9cc38 ("rtc: cmos: Use spin_lock_irqsave() in cmos_interrupt()"):
Signed-off-by: Chris Wilson &lt;chris@chris-wilson.co.uk&gt;
Cc: Xiaofei Tan &lt;tanxiaofei@huawei.com&gt;
Cc: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Reviewed-by: Ville Syrjälä &lt;ville.syrjala@linux.intel.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210305122140.28774-1-chris@chris-wilson.co.uk
</content>
</entry>
<entry>
<title>rtc: rx8010: select REGMAP_I2C</title>
<updated>2021-09-09T08:18:40Z</updated>
<author>
<name>Yu-Tung Chang</name>
<email>mtwget@gmail.com</email>
</author>
<published>2021-08-30T05:25:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=0c45d3e24ef3d3d87c5e0077b8f38d1372af7176'/>
<id>urn:sha1:0c45d3e24ef3d3d87c5e0077b8f38d1372af7176</id>
<content type='text'>
The rtc-rx8010 uses the I2C regmap but doesn't select it in Kconfig so
depending on the configuration the build may fail. Fix it.

Signed-off-by: Yu-Tung Chang &lt;mtwget@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210830052532.40356-1-mtwget@gmail.com
</content>
</entry>
<entry>
<title>rtc: rx8025: implement RX-8035 support</title>
<updated>2021-08-17T21:48:33Z</updated>
<author>
<name>Mathew McBride</name>
<email>matt@traverse.com.au</email>
</author>
<published>2021-07-09T04:45:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f120e2e33ac8ba1adac4f59eaf1ae1705305158f'/>
<id>urn:sha1:f120e2e33ac8ba1adac4f59eaf1ae1705305158f</id>
<content type='text'>
The RX-8035 is a newer RTC from EPSON that is very
similar to the RX-8025.

The key difference is in the oscillation stop (XSTP)
bit which is inverted on the RX-8035.

Signed-off-by: Mathew McBride &lt;matt@traverse.com.au&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210709044518.28769-2-matt@traverse.com.au
</content>
</entry>
<entry>
<title>rtc: cmos: remove stale REVISIT comments</title>
<updated>2021-08-17T21:39:20Z</updated>
<author>
<name>Mateusz Jończyk</name>
<email>mat.jonczyk@o2.pl</email>
</author>
<published>2021-07-16T21:04:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e1aba37569f0aa9c993f740828871e48eea79f98'/>
<id>urn:sha1:e1aba37569f0aa9c993f740828871e48eea79f98</id>
<content type='text'>
It appears mc146818_get_time() and mc146818_set_time() now correctly
use the century register as specified in the ACPI FADT table. It is not
clear what else could be done here.

These comments were introduced by
        commit 7be2c7c96aff ("[PATCH] RTC framework driver for CMOS RTCs")
in 2007, which originally referenced function get_rtc_time() in
include/asm-generic/rtc.h .

Signed-off-by: Mateusz Jończyk &lt;mat.jonczyk@o2.pl&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210716210437.29622-1-mat.jonczyk@o2.pl
</content>
</entry>
<entry>
<title>rtc: tps65910: Correct driver module alias</title>
<updated>2021-08-17T21:36:22Z</updated>
<author>
<name>Dmitry Osipenko</name>
<email>digetx@gmail.com</email>
</author>
<published>2021-08-08T16:00:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8d448fa0a8bb1c8d94eef7647edffe9ac81a281e'/>
<id>urn:sha1:8d448fa0a8bb1c8d94eef7647edffe9ac81a281e</id>
<content type='text'>
The TPS65910 RTC driver module doesn't auto-load because of the wrong
module alias that doesn't match the device name, fix it.

Cc: stable@vger.kernel.org
Reported-by: Anton Bambura &lt;jenneron@protonmail.com&gt;
Tested-by: Anton Bambura &lt;jenneron@protonmail.com&gt;
Signed-off-by: Dmitry Osipenko &lt;digetx@gmail.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210808160030.8556-1-digetx@gmail.com
</content>
</entry>
<entry>
<title>rtc: move RTC_LIB_KUNIT_TEST to proper location</title>
<updated>2021-08-10T21:22:20Z</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@bootlin.com</email>
</author>
<published>2021-08-10T21:20:07Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b02c96464f443e030be74ddd450c46703fe7ba8c'/>
<id>urn:sha1:b02c96464f443e030be74ddd450c46703fe7ba8c</id>
<content type='text'>
Move RTC_LIB_KUNIT_TEST under RTC_LIB so it is clear in the menu this is
part of the RTC subsystem.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210810212008.631359-2-alexandre.belloni@bootlin.com
</content>
</entry>
<entry>
<title>rtc: lib_test: add MODULE_LICENSE</title>
<updated>2021-08-10T21:21:46Z</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@bootlin.com</email>
</author>
<published>2021-08-10T21:20:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5546e3dfb65a4389e747766ac455a50c3675fb0f'/>
<id>urn:sha1:5546e3dfb65a4389e747766ac455a50c3675fb0f</id>
<content type='text'>
As the documentation states, "The exact license information can only be
determined via the license information in the corresponding source files."
and the SPDX identifier has the proper information.

Reported-by: Stephen Rothwell &lt;sfr@canb.auug.org.au&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210810212008.631359-1-alexandre.belloni@bootlin.com
</content>
</entry>
<entry>
<title>rtc: Improve performance of rtc_time64_to_tm(). Add tests.</title>
<updated>2021-08-09T22:09:21Z</updated>
<author>
<name>Cassio Neri</name>
<email>cassio.neri@gmail.com</email>
</author>
<published>2021-06-24T20:13:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1d1bb12a8b1805ddeef9793ebeb920179fb0fa38'/>
<id>urn:sha1:1d1bb12a8b1805ddeef9793ebeb920179fb0fa38</id>
<content type='text'>
The current implementation of rtc_time64_to_tm() contains unnecessary
loops, branches and look-up tables. The new one uses an arithmetic-based
algorithm appeared in [1] and is approximately 4.3 times faster (YMMV).

The drawback is that the new code isn't intuitive and contains many 'magic
numbers' (not unusual for this type of algorithm). However, [1] justifies
all those numbers and, given this function's history, the code is unlikely
to need much maintenance, if any at all.

Add a KUnit test case that checks every day in a 160,000 years interval
starting on 1970-01-01 against the expected result. Add a new config
RTC_LIB_KUNIT_TEST symbol to give the option to run this test suite.

[1] Neri, Schneider, "Euclidean Affine Functions and Applications to
Calendar Algorithms". https://arxiv.org/abs/2102.06959

Signed-off-by: Cassio Neri &lt;cassio.neri@gmail.com&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210624201343.85441-1-cassio.neri@gmail.com
</content>
</entry>
<entry>
<title>rtc: s5m: set range</title>
<updated>2021-08-06T08:31:59Z</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@bootlin.com</email>
</author>
<published>2021-08-04T10:41:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fffd603ae9f6ee1da47fa4ae4c70c324323bc201'/>
<id>urn:sha1:fffd603ae9f6ee1da47fa4ae4c70c324323bc201</id>
<content type='text'>
The S5M8763X type seems to handles dates from year 0000 to 9999, there is
no info on leap year handling after 2099. The other models handles dates
from 2000 to 2099.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Link: https://lore.kernel.org/r/20210804104133.5158-4-alexandre.belloni@bootlin.com
</content>
</entry>
<entry>
<title>rtc: s5m: enable wakeup only when available</title>
<updated>2021-08-06T08:31:59Z</updated>
<author>
<name>Alexandre Belloni</name>
<email>alexandre.belloni@bootlin.com</email>
</author>
<published>2021-08-04T10:41:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=308247d20464a684f335001f2f835240e67f9126'/>
<id>urn:sha1:308247d20464a684f335001f2f835240e67f9126</id>
<content type='text'>
Call device_init_wakeup() only when alarms are available and the RTC is
actually able to wake up the system.

Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Link: https://lore.kernel.org/r/20210804104133.5158-3-alexandre.belloni@bootlin.com
</content>
</entry>
</feed>
