]> git.karo-electronics.de Git - karo-tx-linux.git/commit
rtc: snvs: change timeout to use a fixed number of loop
authorShawn Guo <shawn.guo@linaro.org>
Fri, 21 Sep 2012 01:02:16 +0000 (11:02 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Tue, 25 Sep 2012 08:46:41 +0000 (18:46 +1000)
commit2edd58b4d21a178789eb65c12c62266475b08d44
tree253cac244dd98feca84e4622555c51f6731c4936
parent6b36e53855443c661a26b128c457701ae8ccf95d
rtc: snvs: change timeout to use a fixed number of loop

Andrew Morton <akpm@linux-foundation.org> wrote:

> The timeout code here is fragile.  If acquiring the spinlock takes more
> than a millisecond or if this thread gets interrupted or preempted then
> we could easily execute that loop just a single time, and fail.
>
> It would be better to retry a fixed number of times, say 1000?  That
> would take around 1 millisecond, but might be overkill.

Take Andrew's suggestion to change the timeout code to retry 1000
times.

Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Kim Phillips <kim.phillips@freescale.com>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/rtc/rtc-snvs.c