From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753107AbbKPRBK (ORCPT ); Mon, 16 Nov 2015 12:01:10 -0500 Received: from terminus.zytor.com ([198.137.202.10]:55842 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751939AbbKPRBG (ORCPT ); Mon, 16 Nov 2015 12:01:06 -0500 Date: Mon, 16 Nov 2015 09:00:39 -0800 From: tip-bot for Sudeep Holla Message-ID: Cc: sudeep.holla@arm.com, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, claudiu.manoil@freescale.com, tglx@linutronix.de, marc.zyngier@arm.com Reply-To: marc.zyngier@arm.com, linux-kernel@vger.kernel.org, hpa@zytor.com, claudiu.manoil@freescale.com, tglx@linutronix.de, mingo@kernel.org, sudeep.holla@arm.com In-Reply-To: <1446661957-1019-1-git-send-email-sudeep.holla@arm.com> References: <1446661957-1019-1-git-send-email-sudeep.holla@arm.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:irq/core] genirq: Delay incrementing interrupt count if it' s disabled/pending Git-Commit-ID: a946e8c717f9355d1abd5408ed0adc0002d1aed1 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: a946e8c717f9355d1abd5408ed0adc0002d1aed1 Gitweb: http://git.kernel.org/tip/a946e8c717f9355d1abd5408ed0adc0002d1aed1 Author: Sudeep Holla AuthorDate: Wed, 4 Nov 2015 18:32:37 +0000 Committer: Thomas Gleixner CommitDate: Mon, 16 Nov 2015 17:55:55 +0100 genirq: Delay incrementing interrupt count if it's disabled/pending In case of a wakeup interrupt, irq_pm_check_wakeup disables the interrupt and marks it pending and suspended, disables it and notifies the pm core about the wake event. The interrupt gets handled later once the system is resumed. However the irq stats is updated twice: once when it's disabled waiting for the system to resume and later when it's handled, resulting in wrong counting of the wakeup interrupt when waking up the system. This patch updates the interrupt count so that it's updated only when the interrupt gets handled. It's already handled correctly in handle_edge_irq and handle_edge_eoi_irq. Reported-by: Manoil Claudiu Signed-off-by: Sudeep Holla Cc: Marc Zyngier Link: http://lkml.kernel.org/r/1446661957-1019-1-git-send-email-sudeep.holla@arm.com Signed-off-by: Thomas Gleixner --- kernel/irq/chip.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 1520645..05e29de 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c @@ -338,7 +338,6 @@ void handle_nested_irq(unsigned int irq) raw_spin_lock_irq(&desc->lock); desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); - kstat_incr_irqs_this_cpu(desc); action = desc->action; if (unlikely(!action || irqd_irq_disabled(&desc->irq_data))) { @@ -346,6 +345,7 @@ void handle_nested_irq(unsigned int irq) goto out_unlock; } + kstat_incr_irqs_this_cpu(desc); irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS); raw_spin_unlock_irq(&desc->lock); @@ -412,13 +412,13 @@ void handle_simple_irq(struct irq_desc *desc) goto out_unlock; desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); - kstat_incr_irqs_this_cpu(desc); if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) { desc->istate |= IRQS_PENDING; goto out_unlock; } + kstat_incr_irqs_this_cpu(desc); handle_irq_event(desc); out_unlock: @@ -462,7 +462,6 @@ void handle_level_irq(struct irq_desc *desc) goto out_unlock; desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); - kstat_incr_irqs_this_cpu(desc); /* * If its disabled or no action available @@ -473,6 +472,7 @@ void handle_level_irq(struct irq_desc *desc) goto out_unlock; } + kstat_incr_irqs_this_cpu(desc); handle_irq_event(desc); cond_unmask_irq(desc); @@ -532,7 +532,6 @@ void handle_fasteoi_irq(struct irq_desc *desc) goto out; desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); - kstat_incr_irqs_this_cpu(desc); /* * If its disabled or no action available @@ -544,6 +543,7 @@ void handle_fasteoi_irq(struct irq_desc *desc) goto out; } + kstat_incr_irqs_this_cpu(desc); if (desc->istate & IRQS_ONESHOT) mask_irq(desc);