diff options
author | Guenter Roeck <linux@roeck-us.net> | 2014-09-30 10:48:31 -0700 |
---|---|---|
committer | Sebastian Reichel <sre@kernel.org> | 2014-11-17 03:07:09 +0100 |
commit | 745e19764a0cff55a55010cfabe7e9ff77fa72a5 (patch) | |
tree | 3d99bcc3e01bb83a72b02e9885ab80c40f8eb9fc | |
parent | 43160718d95db9e2336cd787fa8fcad39660b883 (diff) | |
download | linux-745e19764a0cff55a55010cfabe7e9ff77fa72a5.tar.bz2 |
power/reset: xgene: Use mdelay instead of jiffies based timeout
jiffies are not running at this stage of system shutdown, meaning an
error in the reset function would never be reported. Replace with mdelay().
Cc: Loc Ho <lho@apm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
-rw-r--r-- | drivers/power/reset/xgene-reboot.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/power/reset/xgene-reboot.c b/drivers/power/reset/xgene-reboot.c index 94f10ad4100c..9da341d11caf 100644 --- a/drivers/power/reset/xgene-reboot.c +++ b/drivers/power/reset/xgene-reboot.c @@ -24,6 +24,7 @@ * For system shutdown, this is board specify. If a board designer * implements GPIO shutdown, use the gpio-poweroff.c driver. */ +#include <linux/delay.h> #include <linux/io.h> #include <linux/of_device.h> #include <linux/of_address.h> @@ -43,15 +44,12 @@ static struct xgene_reboot_context *xgene_restart_ctx; static void xgene_restart(enum reboot_mode mode, const char *cmd) { struct xgene_reboot_context *ctx = xgene_restart_ctx; - unsigned long timeout; /* Issue the reboot */ if (ctx) writel(ctx->mask, ctx->csr); - timeout = jiffies + HZ; - while (time_before(jiffies, timeout)) - cpu_relax(); + mdelay(1000); dev_emerg(ctx->dev, "Unable to restart system\n"); } |