From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dan Carpenter Date: Fri, 14 Oct 2016 07:26:21 +0000 Subject: [patch] irqchip/gicv3: fix a loop timeout Message-Id: <20161014072534.GA15168@mwanda> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Thomas Gleixner , Sudeep Holla Cc: Jason Cooper , Marc Zyngier , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org We expect the loop to exit with "count" set to zero so let's switch it from a post-op to a pre-op count down. Otherwise we don't see the error message when this times out. Fixes: a2c225101234 ("irqchip: gic-v3: Refactor gic_enable_redist to support both enabling and disabling") Signed-off-by: Dan Carpenter diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 9b81bd8..19d642e 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -153,7 +153,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 ^ (bool)(val & GICR_WAKER_ChildrenAsleep)) break; From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932373AbcJNH2y (ORCPT ); Fri, 14 Oct 2016 03:28:54 -0400 Received: from aserp1040.oracle.com ([141.146.126.69]:48502 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754485AbcJNH2p (ORCPT ); Fri, 14 Oct 2016 03:28:45 -0400 Date: Fri, 14 Oct 2016 10:26:21 +0300 From: Dan Carpenter To: Thomas Gleixner , Sudeep Holla Cc: Jason Cooper , Marc Zyngier , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [patch] irqchip/gicv3: fix a loop timeout Message-ID: <20161014072534.GA15168@mwanda> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.6.0 (2016-04-01) X-Source-IP: userv0021.oracle.com [156.151.31.71] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We expect the loop to exit with "count" set to zero so let's switch it from a post-op to a pre-op count down. Otherwise we don't see the error message when this times out. Fixes: a2c225101234 ("irqchip: gic-v3: Refactor gic_enable_redist to support both enabling and disabling") Signed-off-by: Dan Carpenter diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c index 9b81bd8..19d642e 100644 --- a/drivers/irqchip/irq-gic-v3.c +++ b/drivers/irqchip/irq-gic-v3.c @@ -153,7 +153,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 ^ (bool)(val & GICR_WAKER_ChildrenAsleep)) break;