]> 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>
Mon, 24 Sep 2012 13:13:40 +0000 (23:13 +1000)
commit81089185d8d5b8b515c31526155e53da878d5a28
treea785d2b76acd75339a7a37e9766fcb89b2d3bf4b
parent5de8a1a7d7397595777dc24e00e6fdb5f79728be
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