aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/irq/chip.c
diff options
context:
space:
mode:
authorYinghai Lu <yhlu.kernel@gmail.com>2008-08-19 23:50:09 -0400
committerIngo Molnar <mingo@elte.hu>2008-10-16 10:52:32 -0400
commit7f95ec9e4c12fd067febfd57532da1166d75d858 (patch)
treeb395b6776485f60e3f5d9d820ad665161ef76771 /kernel/irq/chip.c
parent3060d6fe28570640c2d7d66d38b9eaa848c3b9e3 (diff)
x86: move kstat_irqs from kstat to irq_desc
based on Eric's patch ... together mold it with dyn_array for irq_desc, will allcate kstat_irqs for nr_irq_desc alltogether if needed. -- at that point nr_cpus is known already. v2: make sure system without generic_hardirqs works they don't have irq_desc v3: fix merging v4: [mingo@elte.hu] fix typo [ mingo@elte.hu ] irq: build fix fix: arch/x86/xen/spinlock.c: In function 'xen_spin_lock_slow': arch/x86/xen/spinlock.c:90: error: 'struct kernel_stat' has no member named 'irqs' Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/irq/chip.c')
-rw-r--r--kernel/irq/chip.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 76c225cf4b26..2aa3d4b2fce8 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -312,14 +312,13 @@ handle_simple_irq(unsigned int irq, struct irq_desc *desc)
312{ 312{
313 struct irqaction *action; 313 struct irqaction *action;
314 irqreturn_t action_ret; 314 irqreturn_t action_ret;
315 const unsigned int cpu = smp_processor_id();
316 315
317 spin_lock(&desc->lock); 316 spin_lock(&desc->lock);
318 317
319 if (unlikely(desc->status & IRQ_INPROGRESS)) 318 if (unlikely(desc->status & IRQ_INPROGRESS))
320 goto out_unlock; 319 goto out_unlock;
321 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); 320 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
322 kstat_cpu(cpu).irqs[irq]++; 321 kstat_irqs_this_cpu(desc)++;
323 322
324 action = desc->action; 323 action = desc->action;
325 if (unlikely(!action || (desc->status & IRQ_DISABLED))) 324 if (unlikely(!action || (desc->status & IRQ_DISABLED)))
@@ -351,7 +350,6 @@ out_unlock:
351void 350void
352handle_level_irq(unsigned int irq, struct irq_desc *desc) 351handle_level_irq(unsigned int irq, struct irq_desc *desc)
353{ 352{
354 unsigned int cpu = smp_processor_id();
355 struct irqaction *action; 353 struct irqaction *action;
356 irqreturn_t action_ret; 354 irqreturn_t action_ret;
357 355
@@ -361,7 +359,7 @@ handle_level_irq(unsigned int irq, struct irq_desc *desc)
361 if (unlikely(desc->status & IRQ_INPROGRESS)) 359 if (unlikely(desc->status & IRQ_INPROGRESS))
362 goto out_unlock; 360 goto out_unlock;
363 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); 361 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
364 kstat_cpu(cpu).irqs[irq]++; 362 kstat_irqs_this_cpu(desc)++;
365 363
366 /* 364 /*
367 * If its disabled or no action available 365 * If its disabled or no action available
@@ -399,7 +397,6 @@ out_unlock:
399void 397void
400handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc) 398handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
401{ 399{
402 unsigned int cpu = smp_processor_id();
403 struct irqaction *action; 400 struct irqaction *action;
404 irqreturn_t action_ret; 401 irqreturn_t action_ret;
405 402
@@ -409,7 +406,7 @@ handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc)
409 goto out; 406 goto out;
410 407
411 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); 408 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
412 kstat_cpu(cpu).irqs[irq]++; 409 kstat_irqs_this_cpu(desc)++;
413 410
414 /* 411 /*
415 * If its disabled or no action available 412 * If its disabled or no action available
@@ -458,8 +455,6 @@ out:
458void 455void
459handle_edge_irq(unsigned int irq, struct irq_desc *desc) 456handle_edge_irq(unsigned int irq, struct irq_desc *desc)
460{ 457{
461 const unsigned int cpu = smp_processor_id();
462
463 spin_lock(&desc->lock); 458 spin_lock(&desc->lock);
464 459
465 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING); 460 desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);
@@ -476,7 +471,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
476 goto out_unlock; 471 goto out_unlock;
477 } 472 }
478 473
479 kstat_cpu(cpu).irqs[irq]++; 474 kstat_irqs_this_cpu(desc)++;
480 475
481 /* Start handling the irq */ 476 /* Start handling the irq */
482 desc->chip->ack(irq); 477 desc->chip->ack(irq);
@@ -531,7 +526,7 @@ handle_percpu_irq(unsigned int irq, struct irq_desc *desc)
531{ 526{
532 irqreturn_t action_ret; 527 irqreturn_t action_ret;
533 528
534 kstat_this_cpu.irqs[irq]++; 529 kstat_irqs_this_cpu(desc)++;
535 530
536 if (desc->chip->ack) 531 if (desc->chip->ack)
537 desc->chip->ack(irq); 532 desc->chip->ack(irq);