]> 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>
Thu, 13 Sep 2012 07:28:11 +0000 (17:28 +1000)
commit757fed10499a1d15092f5e523c232c692c5bf70e
treeed7ed700558d1dd1de3fd8ef8b68304fc38a70a2
parentd764e065ee3c525028c366039fb4bb68810cc136
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