<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/rtc, branch v5.4.178</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.178</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v5.4.178'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2022-02-08T17:24:34Z</updated>
<entry>
<title>rtc: cmos: Evaluate century appropriate</title>
<updated>2022-02-08T17:24:34Z</updated>
<author>
<name>Riwen Lu</name>
<email>luriwen@kylinos.cn</email>
</author>
<published>2022-01-06T08:46:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=66c5aa5726bc94bfab924e97928e091f09d776ba'/>
<id>urn:sha1:66c5aa5726bc94bfab924e97928e091f09d776ba</id>
<content type='text'>
commit ff164ae39b82ee483b24579c8e22a13a8ce5bd04 upstream.

There's limiting the year to 2069. When setting the rtc year to 2070,
reading it returns 1970. Evaluate century starting from 19 to count the
correct year.

$ sudo date -s 20700106
Mon 06 Jan 2070 12:00:00 AM CST
$ sudo hwclock -w
$ sudo hwclock -r
1970-01-06 12:00:49.604968+08:00

Fixes: 2a4daadd4d3e5071 ("rtc: cmos: ignore bogus century byte")

Signed-off-by: Riwen Lu &lt;luriwen@kylinos.cn&gt;
Acked-by: Eric Wong &lt;e@80x24.org&gt;
Reviewed-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/20220106084609.1223688-1-luriwen@kylinos.cn
Signed-off-by: Mateusz Jończyk &lt;mat.jonczyk@o2.pl&gt; # preparation for stable
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rtc: pxa: fix null pointer dereference</title>
<updated>2022-01-27T08:19:53Z</updated>
<author>
<name>Laurence de Bruxelles</name>
<email>lfdebrux@gmail.com</email>
</author>
<published>2022-01-01T15:41:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=967ec4b059180679c392dc4a384df11214cb950e'/>
<id>urn:sha1:967ec4b059180679c392dc4a384df11214cb950e</id>
<content type='text'>
commit 34127b3632b21e5c391756e724b1198eb9917981 upstream.

With the latest stable kernel versions the rtc on the PXA based
Zaurus does not work, when booting I see the following kernel messages:

pxa-rtc pxa-rtc: failed to find rtc clock source
pxa-rtc pxa-rtc: Unable to init SA1100 RTC sub-device
pxa-rtc: probe of pxa-rtc failed with error -2
hctosys: unable to open rtc device (rtc0)

I think this is because commit f2997775b111 ("rtc: sa1100: fix possible
race condition") moved the allocation of the rtc_device struct out of
sa1100_rtc_init and into sa1100_rtc_probe. This means that pxa_rtc_probe
also needs to do allocation for the rtc_device struct, otherwise
sa1100_rtc_init will try to dereference a null pointer. This patch adds
that allocation by copying how sa1100_rtc_probe in
drivers/rtc/rtc-sa1100.c does it; after the IRQs are set up a managed
rtc_device is allocated.

I've tested this patch with `qemu-system-arm -machine akita` and with a
real Zaurus SL-C1000 applied to 4.19, 5.4, and 5.10.

Signed-off-by: Laurence de Bruxelles &lt;lfdebrux@gmail.com&gt;
Fixes: f2997775b111 ("rtc: sa1100: fix possible race condition")
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20220101154149.12026-1-lfdebrux@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rtc: cmos: take rtc_lock while reading from CMOS</title>
<updated>2022-01-27T08:19:27Z</updated>
<author>
<name>Mateusz Jończyk</name>
<email>mat.jonczyk@o2.pl</email>
</author>
<published>2021-12-10T20:01:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=023357dd2eaf60d8d57322bc246fb98914074d03'/>
<id>urn:sha1:023357dd2eaf60d8d57322bc246fb98914074d03</id>
<content type='text'>
commit 454f47ff464325223129b9b5b8d0b61946ec704d upstream.

Reading from the CMOS involves writing to the index register and then
reading from the data register. Therefore access to the CMOS has to be
serialized with rtc_lock. This invocation of CMOS_READ was not
serialized, which could cause trouble when other code is accessing CMOS
at the same time.

Use spin_lock_irq() like the rest of the function.

Nothing in kernel modifies the RTC_DM_BINARY bit, so there could be a
separate pair of spin_lock_irq() / spin_unlock_irq() before doing the
math.

Signed-off-by: Mateusz Jończyk &lt;mat.jonczyk@o2.pl&gt;
Reviewed-by: Nobuhiro Iwamatsu &lt;iwamatsu@nigauri.org&gt;
Cc: Alessandro Zummo &lt;a.zummo@towertech.it&gt;
Cc: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20211210200131.153887-2-mat.jonczyk@o2.pl
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rtc: rx8010: select REGMAP_I2C</title>
<updated>2021-09-26T12:07:14Z</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.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=409cb0b3d45ad6a9b809f9ec77166a02b13740b6'/>
<id>urn:sha1:409cb0b3d45ad6a9b809f9ec77166a02b13740b6</id>
<content type='text'>
[ Upstream commit 0c45d3e24ef3d3d87c5e0077b8f38d1372af7176 ]

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
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>rtc: tps65910: Correct driver module alias</title>
<updated>2021-09-22T10:26:19Z</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.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d609c63a7165fa6aab0a87f173025652d731e7c9'/>
<id>urn:sha1:d609c63a7165fa6aab0a87f173025652d731e7c9</id>
<content type='text'>
commit 8d448fa0a8bb1c8d94eef7647edffe9ac81a281e upstream.

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
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>rtc: max77686: Do not enforce (incorrect) interrupt trigger type</title>
<updated>2021-07-25T12:35:12Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzk@kernel.org</email>
</author>
<published>2021-05-26T17:20:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=712e9ed6134fa261bef3fabc86f43050110f397e'/>
<id>urn:sha1:712e9ed6134fa261bef3fabc86f43050110f397e</id>
<content type='text'>
[ Upstream commit 742b0d7e15c333303daad4856de0764f4bc83601 ]

Interrupt line can be configured on different hardware in different way,
even inverted.  Therefore driver should not enforce specific trigger
type - edge falling - but instead rely on Devicetree to configure it.

The Maxim 77686 datasheet describes the interrupt line as active low
with a requirement of acknowledge from the CPU therefore the edge
falling is not correct.

The interrupt line is shared between PMIC and RTC driver, so using level
sensitive interrupt is here especially important to avoid races.  With
an edge configuration in case if first PMIC signals interrupt followed
shortly after by the RTC, the interrupt might not be yet cleared/acked
thus the second one would not be noticed.

Signed-off-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210526172036.183223-6-krzysztof.kozlowski@canonical.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>rtc: mxc_v2: add missing MODULE_DEVICE_TABLE</title>
<updated>2021-07-25T12:35:11Z</updated>
<author>
<name>Bixuan Cui</name>
<email>cuibixuan@huawei.com</email>
</author>
<published>2021-05-08T03:15:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f817d4677582b297ee5897afd84b25aa2f7c2d62'/>
<id>urn:sha1:f817d4677582b297ee5897afd84b25aa2f7c2d62</id>
<content type='text'>
[ Upstream commit 206e04ec7539e7bfdde9aa79a7cde656c9eb308e ]

This patch adds missing MODULE_DEVICE_TABLE definition which generates
correct modalias for automatic loading of this driver when it is built
as an external module.

Reported-by: Hulk Robot &lt;hulkci@huawei.com&gt;
Signed-off-by: Bixuan Cui &lt;cuibixuan@huawei.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210508031509.53735-1-cuibixuan@huawei.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>rtc: fix snprintf() checking in is_rtc_hctosys()</title>
<updated>2021-07-20T14:10:51Z</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2021-05-11T07:19:26Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=11d6c1992120f6260ff2a1f16b3064263deda39f'/>
<id>urn:sha1:11d6c1992120f6260ff2a1f16b3064263deda39f</id>
<content type='text'>
[ Upstream commit 54b909436ede47e0ee07f1765da27ec2efa41e84 ]

The scnprintf() function silently truncates the printf() and returns
the number bytes that it was able to copy (not counting the NUL
terminator).  Thus, the highest value it can return here is
"NAME_SIZE - 1" and the overflow check is dead code.  Fix this by
using the snprintf() function which returns the number of bytes that
would have been copied if there was enough space and changing the
condition from "&gt; NAME_SIZE" to "&gt;= NAME_SIZE".

Fixes: 92589c986b33 ("rtc-proc: permit the /proc/driver/rtc device to use other devices")
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/YJov/pcGmhLi2pEl@mwanda
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>rtc: stm32: Fix unbalanced clk_disable_unprepare() on probe error path</title>
<updated>2021-07-14T14:53:05Z</updated>
<author>
<name>Martin Fuzzey</name>
<email>martin.fuzzey@flowbird.group</email>
</author>
<published>2021-06-07T17:36:40Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=60684282789eebb2fb00df9e18cf23de0a966637'/>
<id>urn:sha1:60684282789eebb2fb00df9e18cf23de0a966637</id>
<content type='text'>
commit 950ac33dbe6ff656a623d862022f0762ec061ba7 upstream.

The STM32MP1 RTC may have 2 clocks, the pclk and the rtc_ck.

If clk_prepare_enable() fails for the second clock (rtc_ck) we must only
call clk_disable_unprepare() for the first clock (pclk) but currently we
call it on both leading to a WARN:

[   15.629568] WARNING: CPU: 0 PID: 146 at drivers/clk/clk.c:958 clk_core_disable+0xb0/0xc8
[   15.637620] ck_rtc already disabled
[   15.663322] CPU: 0 PID: 146 Comm: systemd-udevd Not tainted 5.4.77-pknbsp-svn5759-atag-v5.4.77-204-gea4235203137-dirty #2413
[   15.674510] Hardware name: STM32 (Device Tree Support)
[   15.679658] [&lt;c0111148&gt;] (unwind_backtrace) from [&lt;c010c0b8&gt;] (show_stack+0x10/0x14)
[   15.687371] [&lt;c010c0b8&gt;] (show_stack) from [&lt;c0ab3d28&gt;] (dump_stack+0xc0/0xe0)
[   15.694574] [&lt;c0ab3d28&gt;] (dump_stack) from [&lt;c012360c&gt;] (__warn+0xc8/0xf0)
[   15.701428] [&lt;c012360c&gt;] (__warn) from [&lt;c0123694&gt;] (warn_slowpath_fmt+0x60/0x94)
[   15.708894] [&lt;c0123694&gt;] (warn_slowpath_fmt) from [&lt;c053b518&gt;] (clk_core_disable+0xb0/0xc8)
[   15.717230] [&lt;c053b518&gt;] (clk_core_disable) from [&lt;c053c190&gt;] (clk_core_disable_lock+0x18/0x24)
[   15.725924] [&lt;c053c190&gt;] (clk_core_disable_lock) from [&lt;bf0adc44&gt;] (stm32_rtc_probe+0x124/0x5e4 [rtc_stm32])
[   15.735739] [&lt;bf0adc44&gt;] (stm32_rtc_probe [rtc_stm32]) from [&lt;c05f7d4c&gt;] (platform_drv_probe+0x48/0x98)
[   15.745095] [&lt;c05f7d4c&gt;] (platform_drv_probe) from [&lt;c05f5cec&gt;] (really_probe+0x1f0/0x458)
[   15.753338] [&lt;c05f5cec&gt;] (really_probe) from [&lt;c05f61c4&gt;] (driver_probe_device+0x70/0x1c4)
[   15.761584] [&lt;c05f61c4&gt;] (driver_probe_device) from [&lt;c05f6580&gt;] (device_driver_attach+0x58/0x60)
[   15.770439] [&lt;c05f6580&gt;] (device_driver_attach) from [&lt;c05f6654&gt;] (__driver_attach+0xcc/0x170)
[   15.779032] [&lt;c05f6654&gt;] (__driver_attach) from [&lt;c05f40d8&gt;] (bus_for_each_dev+0x58/0x7c)
[   15.787191] [&lt;c05f40d8&gt;] (bus_for_each_dev) from [&lt;c05f4ffc&gt;] (bus_add_driver+0xdc/0x1f8)
[   15.795352] [&lt;c05f4ffc&gt;] (bus_add_driver) from [&lt;c05f6ed8&gt;] (driver_register+0x7c/0x110)
[   15.803425] [&lt;c05f6ed8&gt;] (driver_register) from [&lt;c01027bc&gt;] (do_one_initcall+0x70/0x1b8)
[   15.811588] [&lt;c01027bc&gt;] (do_one_initcall) from [&lt;c01a1094&gt;] (do_init_module+0x58/0x1f8)
[   15.819660] [&lt;c01a1094&gt;] (do_init_module) from [&lt;c01a0074&gt;] (load_module+0x1e58/0x23c8)
[   15.827646] [&lt;c01a0074&gt;] (load_module) from [&lt;c01a0860&gt;] (sys_finit_module+0xa0/0xd4)
[   15.835459] [&lt;c01a0860&gt;] (sys_finit_module) from [&lt;c01011e0&gt;] (__sys_trace_return+0x0/0x20)

Signed-off-by: Martin Fuzzey &lt;martin.fuzzey@flowbird.group&gt;
Fixes: 4e64350f42e2 ("rtc: add STM32 RTC driver")
Cc: stable@vger.kernel.org
Reviewed-by: Nobuhiro Iwamatsu &lt;iwamatsu@nigauri.org&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/1623087421-19722-1-git-send-email-martin.fuzzey@flowbird.group
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>rtc: ds1307: Fix wday settings for rx8130</title>
<updated>2021-05-19T08:08:26Z</updated>
<author>
<name>Nobuhiro Iwamatsu</name>
<email>nobuhiro1.iwamatsu@toshiba.co.jp</email>
</author>
<published>2021-04-20T02:39:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3dd2cd64466e78888b20b0e0d15abfaef40e8213'/>
<id>urn:sha1:3dd2cd64466e78888b20b0e0d15abfaef40e8213</id>
<content type='text'>
[ Upstream commit 204756f016726a380bafe619438ed979088bd04a ]

rx8130 wday specifies the bit position, not BCD.

Fixes: ee0981be7704 ("rtc: ds1307: Add support for Epson RX8130CE")
Signed-off-by: Nobuhiro Iwamatsu &lt;nobuhiro1.iwamatsu@toshiba.co.jp&gt;
Signed-off-by: Alexandre Belloni &lt;alexandre.belloni@bootlin.com&gt;
Link: https://lore.kernel.org/r/20210420023917.1949066-1-nobuhiro1.iwamatsu@toshiba.co.jp
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
</feed>
