Skip to content

Commit

Permalink
um: irqs: allow invoking time-travel handler multiple times
Browse files Browse the repository at this point in the history
If we happen to get multiple messages while IRQS are already
suspended, we still need to handle them, since otherwise the
simulation blocks.

Remove the "prevent nesting" part, time_travel_add_irq_event()
will deal with being called multiple times just fine.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
  • Loading branch information
Johannes Berg authored and Richard Weinberger committed Jun 17, 2021
1 parent d6b399a commit a5ab7c8
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions arch/um/kernel/irq.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,12 @@ static bool irq_do_timetravel_handler(struct irq_entry *entry,
if (!reg->timetravel_handler)
return false;

/* prevent nesting - we'll get it again later when we SIGIO ourselves */
if (reg->pending_on_resume)
return true;

/*
* Handle all messages - we might get multiple even while
* interrupts are already suspended, due to suspend order
* etc. Note that time_travel_add_irq_event() will not add
* an event twice, if it's pending already "first wins".
*/
reg->timetravel_handler(reg->irq, entry->fd, reg->id, &reg->event);

if (!reg->event.pending)
Expand Down

0 comments on commit a5ab7c8

Please sign in to comment.