]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.8.5/irqchip-gicv3-handle-loop-timeout-proper.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 4.8.5 / irqchip-gicv3-handle-loop-timeout-proper.patch
CommitLineData
39a3a1fe
GKH
1From d102eb5c1ac5e6743b1c6d145c06a25d98ad1375 Mon Sep 17 00:00:00 2001
2From: Dan Carpenter <dan.carpenter@oracle.com>
3Date: Fri, 14 Oct 2016 10:26:21 +0300
4Subject: irqchip/gicv3: Handle loop timeout proper
5
6From: Dan Carpenter <dan.carpenter@oracle.com>
7
8commit d102eb5c1ac5e6743b1c6d145c06a25d98ad1375 upstream.
9
10The timeout loop terminates when the loop count is zero, but the decrement
11of the count variable is post check. So count is -1 when we check for the
12timeout and therefor the error message is supressed.
13
14Change it to predecrement, so the error message is emitted.
15
16[ tglx: Massaged changelog ]
17
18Fixes: a2c225101234 ("irqchip: gic-v3: Refactor gic_enable_redist to support both enabling and disabling")
19Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
20Acked-by: Sudeep Holla <sudeep.holla@arm.com>
21Cc: Marc Zyngier <marc.zyngier@arm.com>
22Cc: kernel-janitors@vger.kernel.org
23Cc: Jason Cooper <jason@lakedaemon.net>
24Link: http://lkml.kernel.org/r/20161014072534.GA15168@mwanda
25Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
26Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
27
28---
29 drivers/irqchip/irq-gic-v3.c | 2 +-
30 1 file changed, 1 insertion(+), 1 deletion(-)
31
32--- a/drivers/irqchip/irq-gic-v3.c
33+++ b/drivers/irqchip/irq-gic-v3.c
34@@ -153,7 +153,7 @@ static void gic_enable_redist(bool enabl
35 return; /* No PM support in this redistributor */
36 }
37
38- while (count--) {
39+ while (--count) {
40 val = readl_relaxed(rbase + GICR_WAKER);
41 if (enable ^ (bool)(val & GICR_WAKER_ChildrenAsleep))
42 break;