summaryrefslogtreecommitdiff
path: root/include/math-emu
diff options
context:
space:
mode:
authorGregory CLEMENT <gregory.clement@free-electrons.com>2015-05-06 02:24:05 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2015-05-06 03:10:11 +0300
commit489405fe5ed38e65f6f82f131a39c67f3bae6045 (patch)
treedb6e2324ac636c6421c7186b898913045f53eaf2 /include/math-emu
parentb1432a2a35565f538586774a03bf277c27fc267d (diff)
downloadlinux-489405fe5ed38e65f6f82f131a39c67f3bae6045.tar.xz
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 <gregory.clement@free-electrons.com> Acked-by: Alexandre Belloni <alexandre.belloni@free-electrons.com> Acked-by: Andrew Lunn <andrew@lunn.ch> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: <stable@vger.kernel.org> [4.0] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/math-emu')
0 files changed, 0 insertions, 0 deletions