aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2015-11-04 13:32:37 -0500
committerThomas Gleixner <tglx@linutronix.de>2015-11-16 11:55:55 -0500
commita946e8c717f9355d1abd5408ed0adc0002d1aed1 (patch)
tree66440d535ee30a535314f57e898bb85f0468c718
parent8005c49d9aea74d382f474ce11afbbc7d7130bec (diff)
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 <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>
-rw-r--r--kernel/irq/chip.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 15206453b12a..05e29de57933 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -338,7 +338,6 @@ void handle_nested_irq(unsigned int irq)
338 raw_spin_lock_irq(&desc->lock); 338 raw_spin_lock_irq(&desc->lock);
339 339
340 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); 340 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
341 kstat_incr_irqs_this_cpu(desc);
342 341
343 action = desc->action; 342 action = desc->action;
344 if (unlikely(!action || irqd_irq_disabled(&desc->irq_data))) { 343 if (unlikely(!action || irqd_irq_disabled(&desc->irq_data))) {
@@ -346,6 +345,7 @@ void handle_nested_irq(unsigned int irq)
346 goto out_unlock; 345 goto out_unlock;
347 } 346 }
348 347
348 kstat_incr_irqs_this_cpu(desc);
349 irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS); 349 irqd_set(&desc->irq_data, IRQD_IRQ_INPROGRESS);
350 raw_spin_unlock_irq(&desc->lock); 350 raw_spin_unlock_irq(&desc->lock);
351 351
@@ -412,13 +412,13 @@ void handle_simple_irq(struct irq_desc *desc)
412 goto out_unlock; 412 goto out_unlock;
413 413
414 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); 414 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
415 kstat_incr_irqs_this_cpu(desc);
416 415
417 if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) { 416 if (unlikely(!desc->action || irqd_irq_disabled(&desc->irq_data))) {
418 desc->istate |= IRQS_PENDING; 417 desc->istate |= IRQS_PENDING;
419 goto out_unlock; 418 goto out_unlock;
420 } 419 }
421 420
421 kstat_incr_irqs_this_cpu(desc);
422 handle_irq_event(desc); 422 handle_irq_event(desc);
423 423
424out_unlock: 424out_unlock:
@@ -462,7 +462,6 @@ void handle_level_irq(struct irq_desc *desc)
462 goto out_unlock; 462 goto out_unlock;
463 463
464 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); 464 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
465 kstat_incr_irqs_this_cpu(desc);
466 465
467 /* 466 /*
468 * If its disabled or no action available 467 * If its disabled or no action available
@@ -473,6 +472,7 @@ void handle_level_irq(struct irq_desc *desc)
473 goto out_unlock; 472 goto out_unlock;
474 } 473 }
475 474
475 kstat_incr_irqs_this_cpu(desc);
476 handle_irq_event(desc); 476 handle_irq_event(desc);
477 477
478 cond_unmask_irq(desc); 478 cond_unmask_irq(desc);
@@ -532,7 +532,6 @@ void handle_fasteoi_irq(struct irq_desc *desc)
532 goto out; 532 goto out;
533 533
534 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING); 534 desc->istate &= ~(IRQS_REPLAY | IRQS_WAITING);
535 kstat_incr_irqs_this_cpu(desc);
536 535
537 /* 536 /*
538 * If its disabled or no action available 537 * If its disabled or no action available
@@ -544,6 +543,7 @@ void handle_fasteoi_irq(struct irq_desc *desc)
544 goto out; 543 goto out;
545 } 544 }
546 545
546 kstat_incr_irqs_this_cpu(desc);
547 if (desc->istate & IRQS_ONESHOT) 547 if (desc->istate & IRQS_ONESHOT)
548 mask_irq(desc); 548 mask_irq(desc);
549 549