Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 116423
b: refs/heads/master
c: 46926b6
h: refs/heads/master
i:
  116421: 2c58e78
  116419: 870775f
  116415: 1be7cfd
v: v3
  • Loading branch information
Yinghai Lu authored and Ingo Molnar committed Oct 16, 2008
1 parent b70a559 commit 14285e0
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7d94f7ca401dd7f445fda9a971a48aa5427b3e55
refs/heads/master: 46926b67fc663d357a1a8174328998a9e49da0b8
6 changes: 4 additions & 2 deletions trunk/arch/x86/kernel/irq_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ u64 arch_irq_stat(void)
asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);
struct irq_desc *desc;

/* high bit used in ret_from_ code */
unsigned vector = ~regs->orig_ax;
Expand All @@ -202,8 +203,9 @@ asmlinkage unsigned int do_IRQ(struct pt_regs *regs)
stack_overflow_check(regs);
#endif

if (likely(__irq_to_desc(irq)))
generic_handle_irq(irq);
desc = __irq_to_desc(irq);
if (likely(desc))
generic_handle_irq_desc(irq, desc);
else {
if (!disable_apic)
ack_APIC_irq();
Expand Down
9 changes: 6 additions & 3 deletions trunk/include/linux/irq.h
Original file line number Diff line number Diff line change
Expand Up @@ -315,10 +315,8 @@ extern unsigned int __do_IRQ(unsigned int irq);
* irqchip-style controller then we call the ->handle_irq() handler,
* and it calls __do_IRQ() if it's attached to an irqtype-style controller.
*/
static inline void generic_handle_irq(unsigned int irq)
static inline void generic_handle_irq_desc(unsigned int irq, struct irq_desc *desc)
{
struct irq_desc *desc = irq_to_desc(irq);

#ifdef CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ
desc->handle_irq(irq, desc);
#else
Expand All @@ -329,6 +327,11 @@ static inline void generic_handle_irq(unsigned int irq)
#endif
}

static inline void generic_handle_irq(unsigned int irq)
{
generic_handle_irq_desc(irq, irq_to_desc(irq));
}

/* Handling of unhandled and spurious interrupts: */
extern void note_interrupt(unsigned int irq, struct irq_desc *desc,
int action_ret);
Expand Down
7 changes: 7 additions & 0 deletions trunk/init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -590,6 +590,13 @@ void pre_alloc_dyn_array(void)
if (da->init_work)
da->init_work(da);
}
#else
#ifdef CONFIF_GENERIC_HARDIRQS
unsigned int i;

for (i = 0; i < NR_IRQS; i++)
irq_desc[i].irq = i;
#endif
#endif
}

Expand Down
30 changes: 30 additions & 0 deletions trunk/kernel/irq/handle.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,21 @@ struct irq_desc *irq_to_desc(unsigned int irq)
* we run out of pre-allocate ones, allocate more
*/
printk(KERN_DEBUG "try to get more irq_desc %d\n", nr_irq_desc);
{
/* double check if some one mess up the list */
struct irq_desc *desc;
int count = 0;

desc = &sparse_irqs[0];
while (desc) {
printk(KERN_DEBUG "found irq_desc for irq %d\n", desc->irq);
if (desc->next)
printk(KERN_DEBUG "found irq_desc for irq %d and next will be irq %d\n", desc->irq, desc->next->irq);
desc = desc->next;
count++;
}
printk(KERN_DEBUG "all preallocted %d\n", count);
}

total_bytes = sizeof(struct irq_desc) * nr_irq_desc;
if (after_bootmem)
Expand All @@ -221,6 +236,21 @@ struct irq_desc *irq_to_desc(unsigned int irq)

desc->irq = irq;
desc_pri->next = desc;
{
/* double check if some one mess up the list */
struct irq_desc *desc;
int count = 0;

desc = &sparse_irqs[0];
while (desc) {
printk(KERN_DEBUG "1 found irq_desc for irq %d\n", desc->irq);
if (desc->next)
printk(KERN_DEBUG "1 found irq_desc for irq %d and next will be irq %d\n", desc->irq, desc->next->irq);
desc = desc->next;
count++;
}
printk(KERN_DEBUG "1 all preallocted %d\n", count);
}

return desc;
}
Expand Down

0 comments on commit 14285e0

Please sign in to comment.