{
struct irq_desc *desc;
- desc = irq_to_desc(irq);
+ /* first time to use this irq_desc */
+ if (irq < 16)
+ desc = irq_to_desc(irq);
+ else
+ desc = irq_to_desc_alloc(irq);
+
if (trigger)
desc->status |= IRQ_LEVEL;
else
irq = __get_cpu_var(vector_irq)[vector];
desc = irq_to_desc(irq);
+ if (!desc)
+ continue;
+
cfg = irq_cfg(irq);
spin_lock(&desc->lock);
if (!cfg->move_cleanup_count)
if (i < nr_irqs) {
unsigned any_count = 0;
- struct irq_desc *desc = __irq_to_desc(i);
+ struct irq_desc *desc = irq_to_desc(i);
if (!desc)
return 0;
stack_overflow_check(regs);
#endif
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (likely(desc))
generic_handle_irq_desc(irq, desc);
else {
init_8259A(0);
for (i = 0; i < 16; i++) {
- struct irq_desc *desc = irq_to_desc(i);
+ /* first time call this irq_desc */
+ struct irq_desc *desc = irq_to_desc_alloc(i);
desc->status = IRQ_DISABLED;
desc->action = NULL;
} ____cacheline_internodealigned_in_smp;
extern struct irq_desc *irq_to_desc(unsigned int irq);
-extern struct irq_desc *__irq_to_desc(unsigned int irq);
+extern struct irq_desc *irq_to_desc_alloc(unsigned int irq);
#ifndef CONFIG_HAVE_SPARSE_IRQ
struct irq_desc *desc;
unsigned long flags;
- desc = irq_to_desc(irq);
+ /* first time to use this irq_desc */
+ desc = irq_to_desc_alloc(irq);
if (!desc) {
WARN(1, KERN_ERR "Trying to initialize invalid IRQ%d\n", irq);
return;
struct irq_desc *desc;
unsigned long flags;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc) {
WARN(1, KERN_ERR "Trying to cleanup invalid IRQ%d\n", irq);
return;
struct irq_desc *desc;
unsigned long flags;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc) {
WARN(1, KERN_ERR "Trying to install chip for IRQ%d\n", irq);
return -EINVAL;
unsigned long flags;
int ret = -ENXIO;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR "Trying to set irq type for IRQ%d\n", irq);
return -ENODEV;
struct irq_desc *desc;
unsigned long flags;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR
"Trying to install controller data for IRQ%d\n", irq);
struct irq_desc *desc;
unsigned long flags;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR
"Trying to install msi data for IRQ%d\n", irq);
struct irq_desc *desc;
unsigned long flags;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR
"Trying to install chip data for IRQ%d\n", irq);
struct irq_desc *desc;
unsigned long flags;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR
"Trying to install type control for IRQ%d\n", irq);
struct irq_desc *desc;
unsigned long flags;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR "Trying to mark IRQ%d non-probeable\n", irq);
struct irq_desc *desc;
unsigned long flags;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc) {
printk(KERN_ERR "Trying to mark IRQ%d probeable\n", irq);
struct irq_desc *sparse_irqs;
DEFINE_DYN_ARRAY(sparse_irqs, sizeof(struct irq_desc), nr_irq_desc, PAGE_SIZE, init_work);
-struct irq_desc *__irq_to_desc(unsigned int irq)
+struct irq_desc *irq_to_desc(unsigned int irq)
{
struct irq_desc *desc;
}
return NULL;
}
-struct irq_desc *irq_to_desc(unsigned int irq)
+struct irq_desc *irq_to_desc_alloc(unsigned int irq)
{
struct irq_desc *desc, *desc_pri;
int i;
if (desc->irq == -1U) {
desc->irq = irq;
+ printk(KERN_DEBUG "found new irq_desc for irq %d\n", desc->irq);
return desc;
}
desc_pri = desc;
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);
- }
+ printk(KERN_DEBUG "1 found new irq_desc for irq %d and pri will be irq %d\n", desc->irq, desc_pri->irq);
return desc;
}
return NULL;
}
-struct irq_desc *__irq_to_desc(unsigned int irq)
+struct irq_desc *irq_to_desc_alloc(unsigned int irq)
{
return irq_to_desc(irq);
}
*/
void synchronize_irq(unsigned int irq)
{
- struct irq_desc *desc = __irq_to_desc(irq);
+ struct irq_desc *desc = irq_to_desc(irq);
unsigned int status;
if (!desc)
struct irq_desc *desc;
unsigned long flags;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc)
return;
{
struct irq_desc *desc;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc)
return;
struct irq_desc *desc;
unsigned long flags;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc)
return;
struct irq_desc *desc;
struct irqaction *action;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc)
return 0;
int shared = 0;
int ret;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc)
return -EINVAL;
WARN_ON(in_interrupt());
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc)
return;
if ((irqflags & IRQF_SHARED) && !dev_id)
return -EINVAL;
- desc = __irq_to_desc(irq);
+ desc = irq_to_desc(irq);
if (!desc)
return -EINVAL;