irq/irq_sim: Store multiple interrupt offsets in a bitmap

Two threads can try to fire the irq_sim with different offsets and will
end up fighting for the irq_work asignment. Thomas Gleixner suggested a
solution based on a bitfield where we set a bit for every offset
associated with an interrupt that should be fired and then iterate over
all set bits in the interrupt handler.

This is a slightly modified solution using a bitmap so that we don't
impose a limit on the number of interrupts one can allocate with
irq_sim.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
This commit is contained in:
Bartosz Golaszewski
2018-11-09 18:21:32 +01:00
committed by Marc Zyngier
parent 81b1e6e6a8
commit 06459901d5
2 changed files with 22 additions and 3 deletions

View File

@@ -16,7 +16,7 @@
struct irq_sim_work_ctx {
struct irq_work work;
int irq;
unsigned long *pending;
};
struct irq_sim_irq_ctx {