]> 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>
Wed, 26 Sep 2012 01:34:34 +0000 (11:34 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Thu, 27 Sep 2012 07:28:10 +0000 (17:28 +1000)
commitac232f030df836ff828464b58325b55df69c4cda
tree65db5d261fdb7d89a9196ada631d4613eb4f6c0f
parent3b7ea5cbbfe6ff1e79a6e8ed12c4763144c952b1
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