From: Hanjun Guo <guohanjun@huawei.com>
To: Greg KH <gregkh@linuxfoundation.org>, <stable@vger.kernel.org>
Cc: <yi.zhang@huawei.com>, Sudeep Holla <sudeep.holla@arm.com>,
Marc Zyngier <marc.zyngier@arm.com>,
Thomas Gleixner <tglx@linutronix.de>,
Hanjun Guo <hanjun.guo@linaro.org>
Subject: [PATCH 4.4 1/6] genirq: Delay incrementing interrupt count if it's disabled/pending
Date: Sun, 19 Aug 2018 14:27:36 +0800 [thread overview]
Message-ID: <1534660061-51980-2-git-send-email-guohanjun@huawei.com> (raw)
In-Reply-To: <1534660061-51980-1-git-send-email-guohanjun@huawei.com>
From: Sudeep Holla <sudeep.holla@arm.com>
commit a946e8c717f9355d1abd5408ed0adc0002d1aed1 upstream.
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 <claudiu.manoil@freescale.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Link: http://lkml.kernel.org/r/1446661957-1019-1-git-send-email-sudeep.holla@arm.com
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
---
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 e4453d9..3c74e13 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);
--
1.7.12.4
next prev parent reply other threads:[~2018-08-19 9:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-19 6:27 [PATCH 4.4 0/6] irqchip fixes for stable 4.4 Hanjun Guo
2018-08-19 6:27 ` Hanjun Guo [this message]
2018-08-19 6:27 ` [PATCH 4.4 2/6] irqchip/gic-v3-its: Recompute the number of pages on page size change Hanjun Guo
2018-08-19 6:27 ` [PATCH 4.4 3/6] irqchip/gicv3-its: Fix memory leak in its_free_tables() Hanjun Guo
2018-08-19 6:27 ` [PATCH 4.4 4/6] irqchip/gicv3-its: Avoid cache flush beyond ITS_BASERn memory size Hanjun Guo
2018-08-19 6:27 ` [PATCH 4.4 5/6] irqchip/gic-v3: Add missing barrier to 32bit version of gic_read_iar() Hanjun Guo
2018-08-19 6:27 ` [PATCH 4.4 6/6] irqchip/gic: Make interrupt ID 1020 invalid Hanjun Guo
2018-09-13 3:11 ` [PATCH 4.4 0/6] irqchip fixes for stable 4.4 Hanjun Guo
2018-09-13 7:00 ` Greg KH
2018-09-13 7:34 ` Hanjun Guo
2018-09-13 12:22 ` Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1534660061-51980-2-git-send-email-guohanjun@huawei.com \
--to=guohanjun@huawei.com \
--cc=gregkh@linuxfoundation.org \
--cc=hanjun.guo@linaro.org \
--cc=marc.zyngier@arm.com \
--cc=stable@vger.kernel.org \
--cc=sudeep.holla@arm.com \
--cc=tglx@linutronix.de \
--cc=yi.zhang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).