Skip to content
Commit 5c432383 authored by Mateusz Jończyk's avatar Mateusz Jończyk Committed by Greg Kroah-Hartman
Browse files

rtc: mc146818-lib: fix locking in mc146818_set_time



[ Upstream commit 811f5559 ]

In mc146818_set_time(), CMOS_READ(RTC_CONTROL) was performed without the
rtc_lock taken, which is required for CMOS accesses. Fix this.

Nothing in kernel modifies RTC_DM_BINARY, so a separate critical section
is allowed here.

Fixes: dcf257e9 ("rtc: mc146818: Reduce spinlock section in mc146818_set_time()")
Signed-off-by: default avatarMateusz Jończyk <mat.jonczyk@o2.pl>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@vger.kernel.org
Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
Link: https://lore.kernel.org/r/20220220090403.153928-1-mat.jonczyk@o2.pl


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 5e26531d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment