]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
rtc: snvs: change timeout to use a fixed number of loop
authorShawn Guo <shawn.guo@linaro.org>
Thu, 13 Sep 2012 01:01:17 +0000 (11:01 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 17 Sep 2012 10:46:13 +0000 (20:46 +1000)
commit30a1a9c299118a1c593e86161cc00b7d17c473e6
treee4cef363a74c48712677220311970993308256bd
parent0c7c5382d063ebfd7209912672138dc474a3d941
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