]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - 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
1 From d102eb5c1ac5e6743b1c6d145c06a25d98ad1375 Mon Sep 17 00:00:00 2001
2 From: Dan Carpenter <dan.carpenter@oracle.com>
3 Date: Fri, 14 Oct 2016 10:26:21 +0300
4 Subject: irqchip/gicv3: Handle loop timeout proper
5
6 From: Dan Carpenter <dan.carpenter@oracle.com>
7
8 commit d102eb5c1ac5e6743b1c6d145c06a25d98ad1375 upstream.
9
10 The timeout loop terminates when the loop count is zero, but the decrement
11 of the count variable is post check. So count is -1 when we check for the
12 timeout and therefor the error message is supressed.
13
14 Change it to predecrement, so the error message is emitted.
15
16 [ tglx: Massaged changelog ]
17
18 Fixes: a2c225101234 ("irqchip: gic-v3: Refactor gic_enable_redist to support both enabling and disabling")
19 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
20 Acked-by: Sudeep Holla <sudeep.holla@arm.com>
21 Cc: Marc Zyngier <marc.zyngier@arm.com>
22 Cc: kernel-janitors@vger.kernel.org
23 Cc: Jason Cooper <jason@lakedaemon.net>
24 Link: http://lkml.kernel.org/r/20161014072534.GA15168@mwanda
25 Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
26 Signed-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;