From: Guenter Roeck Date: Tue, 30 Sep 2014 17:48:31 +0000 (-0700) Subject: power/reset: xgene: Use mdelay instead of jiffies based timeout X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=745e19764a0cff55a55010cfabe7e9ff77fa72a5;p=linux-beck.git 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 Signed-off-by: Guenter Roeck --- 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 #include #include #include @@ -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"); }