iopoll: Make readl_poll_timeout() and friends preemption-safe

With the previous implementation, pre-emption was possible
between reading the register value and evaluating the break
condition for the timeout. If jiffies advanced sufficiently to
expire the timeout before the polling thread was rescheduled,
the macro would return -ETIMEDOUT incorrectly.

Fix this by re-reading the register value again after evaluating
the timeout condition as true.

Change-Id: I58a42798235db3606373a2f689f7d6c95475702e
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
1 file changed