From: Dan Carpenter Date: Fri, 14 Oct 2016 07:26:21 +0000 (+0300) Subject: irqchip/gicv3: Handle loop timeout proper X-Git-Tag: Ubuntu-snapdragon-4.4.0-1046.50~1249 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=8e02a546aef77e6ee586180d5b8aa97e2be8db6c;p=mirror_ubuntu-zesty-kernel.git irqchip/gicv3: Handle loop timeout proper BugLink: http://bugs.launchpad.net/bugs/1637510 commit d102eb5c1ac5e6743b1c6d145c06a25d98ad1375 upstream. The timeout loop terminates when the loop count is zero, but the decrement of the count variable is post check. So count is -1 when we check for the timeout and therefor the error message is supressed. Change it to predecrement, so the error message is emitted. [ tglx: Massaged changelog ] Fixes: a2c225101234 ("irqchip: gic-v3: Refactor gic_enable_redist to support both enabling and disabling") Signed-off-by: Dan Carpenter Acked-by: Sudeep Holla Cc: Marc Zyngier Cc: kernel-janitors@vger.kernel.org Cc: Jason Cooper Link: http://lkml.kernel.org/r/20161014072534.GA15168@mwanda Signed-off-by: Thomas Gleixner Signed-off-by: Greg Kroah-Hartman Signed-off-by: Tim Gardner --- diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 44aa57edf207..e33c729b9f48 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -142,7 +142,7 @@ static void gic_enable_redist(bool enable) return; /* No PM support in this redistributor */ } - while (count--) { + while (--count) { val = readl_relaxed(rbase + GICR_WAKER); if (enable ^ (val & GICR_WAKER_ChildrenAsleep)) break;