diff options
author | Gregory CLEMENT <[email protected]> | 2015-05-05 16:24:05 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2015-05-05 17:10:11 -0700 |
commit | 489405fe5ed38e65f6f82f131a39c67f3bae6045 (patch) | |
tree | db6e2324ac636c6421c7186b898913045f53eaf2 /lib/cpu-notifier-error-inject.c | |
parent | b1432a2a35565f538586774a03bf277c27fc267d (diff) |
rtc: armada38x: fix concurrency access in armada38x_rtc_set_time
While setting the time, the RTC TIME register should not be accessed.
However due to hardware constraints, setting the RTC time involves
sleeping during 100ms. This sleep was done outside the critical section
protected by the spinlock, so it was possible to read the RTC TIME
register and get an incorrect value. This patch introduces a mutex for
protecting the RTC TIME access, unlike the spinlock it is allowed to
sleep in a critical section protected by a mutex.
The RTC STATUS register can still be used from the interrupt handler but
it has no effect on setting the time.
Signed-off-by: Gregory CLEMENT <[email protected]>
Acked-by: Alexandre Belloni <[email protected]>
Acked-by: Andrew Lunn <[email protected]>
Cc: Alessandro Zummo <[email protected]>
Cc: <[email protected]> [4.0]
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/cpu-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions