Mateusz Jończyk 454f47ff46 rtc: cmos: take rtc_lock while reading from CMOS
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 <mat.jonczyk@o2.pl>
Reviewed-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: stable@vger.kernel.org
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20211210200131.153887-2-mat.jonczyk@o2.pl
2021-12-16 21:50:06 +01:00
..
2021-10-18 17:20:50 +02:00
2021-08-10 23:21:46 +02:00
2021-12-02 23:23:38 +01:00
2021-09-25 23:22:28 +02:00
2021-09-25 23:22:28 +02:00
2019-11-08 16:14:09 +01:00
2019-07-17 10:03:50 -07:00
2021-04-29 23:03:26 +02:00
2021-05-25 00:41:25 +02:00
2021-10-01 23:28:28 +02:00
2021-06-01 16:44:09 +01:00
2021-01-16 23:19:26 +01:00
2021-01-16 23:19:26 +01:00
2021-09-25 23:22:28 +02:00
2021-10-18 17:38:06 +02:00
2021-02-22 14:27:07 -08:00
2021-10-18 17:20:50 +02:00
2021-10-23 23:57:23 +02:00
2021-09-25 23:26:37 +02:00
2020-12-03 23:43:23 +01:00