Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 234692
b: refs/heads/master
c: e7bcecb
h: refs/heads/master
v: v3
  • Loading branch information
Thomas Gleixner committed Feb 19, 2011
1 parent 4337d01 commit 392befa
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 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: 218502bfe674f570205367b9094048207b04ba15
refs/heads/master: e7bcecb7b1d29b9ad5af939149a945658620ca8f
22 changes: 19 additions & 3 deletions trunk/kernel/irq/irqdesc.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,14 @@ struct irq_desc * __ref irq_to_desc_alloc_node(unsigned int irq, int node)
return NULL;
}

static int irq_expand_nr_irqs(unsigned int cnt)
{
if (nr_irqs + cnt > IRQ_BITMAP_BITS)
return -ENOMEM;
nr_irqs += cnt;
return 0;
}

int __init early_irq_init(void)
{
int i, initcnt, node = first_online_node;
Expand Down Expand Up @@ -287,6 +295,12 @@ static inline int alloc_descs(unsigned int start, unsigned int cnt, int node)
{
return start;
}

static int irq_expand_nr_irqs(unsigned int cnt)
{
return -ENOMEM;
}

#endif /* !CONFIG_SPARSE_IRQ */

/* Dynamic interrupt handling */
Expand Down Expand Up @@ -335,9 +349,11 @@ irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node)
if (irq >=0 && start != irq)
goto err;

ret = -ENOMEM;
if (start >= nr_irqs)
goto err;
if (start >= nr_irqs) {
ret = irq_expand_nr_irqs(cnt);
if (ret)
goto err;
}

bitmap_set(allocated_irqs, start, cnt);
mutex_unlock(&sparse_irq_lock);
Expand Down

0 comments on commit 392befa

Please sign in to comment.