If the inject_irq callback detect that an interrupt is already queued
in some list register, do not insert it into the software queue, thus
coalesce the event like real hardware does.
The change in the return code of inject_irq is more cosmetic, to reflect
the meaning better.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
/* Check that there is no overlapping */
lr = gic_read_lr(i);
if ((lr & GICH_LR_VIRT_ID_MASK) == irq->virt_id)
- return -EINVAL;
+ return -EEXIST;
}
if (first_free == -1)
* should be sufficient.
*/
if ((u32)lr == irq->virt_id)
- return -EINVAL;
+ return -EEXIST;
}
if (free_lr == -1)
pending.virt_id = irq_id;
- if (try_inject && irqchip.inject_irq(cpu_data, &pending) == 0)
- return;
-
- irqchip_insert_pending(cpu_data, &pending);
+ if (!try_inject || irqchip.inject_irq(cpu_data, &pending) == -EBUSY)
+ irqchip_insert_pending(cpu_data, &pending);
}
/*