linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: linux-um@lists.infradead.org
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@kernel.org>,
	Johannes Berg <johannes.berg@intel.com>
Subject: [PATCH 5/7] um: irqs: allow invoking time-travel handler multiple times
Date: Tue, 23 Feb 2021 16:27:05 +0100	[thread overview]
Message-ID: <20210223161449.b769860c16f6.I0344b4c8a7e79d8ac1645acad97371f202837777@changeid> (raw)
In-Reply-To: <20210223152707.408995-1-johannes@sipsolutions.net>

From: Johannes Berg <johannes.berg@intel.com>

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>
---
 arch/um/kernel/irq.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/arch/um/kernel/irq.c b/arch/um/kernel/irq.c
index 76448b85292f..3718a5cdbc85 100644
--- a/arch/um/kernel/irq.c
+++ b/arch/um/kernel/irq.c
@@ -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)
-- 
2.26.2


  parent reply	other threads:[~2021-02-23 15:28 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 15:27 [PATCH 0/7] PCI support for UML Johannes Berg
2021-02-23 15:27 ` [PATCH 1/7] um: allow disabling NO_IOMEM Johannes Berg
2021-02-23 15:44   ` Geert Uytterhoeven
2021-02-23 15:46     ` Johannes Berg
2021-02-23 15:27 ` [PATCH 2/7] lib: add iomem emulation (logic_iomem) Johannes Berg
2021-02-23 15:27 ` [PATCH 3/7] um: remove unused smp_sigio_handler() declaration Johannes Berg
2021-02-23 15:27 ` [PATCH 4/7] um: time-travel/signals: fix ndelay() in interrupt Johannes Berg
2021-02-25 13:13   ` Johannes Berg
2021-02-23 15:27 ` Johannes Berg [this message]
2021-02-23 15:27 ` [PATCH 6/7] um: add PCI over virtio emulation driver Johannes Berg
2021-02-23 15:27 ` [PATCH 7/7] um: virtio/pci: enable suspend/resume Johannes Berg
2021-02-23 21:24 ` [PATCH 0/7] PCI support for UML Johannes Berg
2021-02-24  9:47   ` Geert Uytterhoeven
2021-02-24 14:35     ` Johannes Berg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210223161449.b769860c16f6.I0344b4c8a7e79d8ac1645acad97371f202837777@changeid \
    --to=johannes@sipsolutions.net \
    --cc=arnd@kernel.org \
    --cc=johannes.berg@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).