Patch "um: time-travel: Fix IRQ handling in time_travel_handle_message()" has been added to the 5.8-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    um: time-travel: Fix IRQ handling in time_travel_handle_message()

to the 5.8-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     um-time-travel-fix-irq-handling-in-time_travel_handl.patch
and it can be found in the queue-5.8 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit fecfc43f2adda92f379ed8cca3c8b6167295176d
Author: Johannes Berg <johannes.berg@xxxxxxxxx>
Date:   Thu Sep 10 11:31:12 2020 +0200

    um: time-travel: Fix IRQ handling in time_travel_handle_message()
    
    [ Upstream commit ebef8ea2ba967026192a26f4529890893919bc57 ]
    
    As the comment here indicates, we need to do the polling in the
    idle loop without blocking interrupts, since interrupts can be
    vhost-user messages that we must process even while in our idle
    loop.
    
    I don't know why I explained one thing and implemented another,
    but we have indeed observed random hangs due to this, depending
    on the timing of the messages.
    
    Fixes: 88ce64249233 ("um: Implement time-travel=ext")
    Signed-off-by: Johannes Berg <johannes.berg@xxxxxxxxx>
    Acked-By: Anton Ivanov <anton.ivanov@xxxxxxxxxxxxxxxxxx>
    Signed-off-by: Richard Weinberger <richard@xxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/um/kernel/time.c b/arch/um/kernel/time.c
index 25eaa6a0c6583..c07436e89e599 100644
--- a/arch/um/kernel/time.c
+++ b/arch/um/kernel/time.c
@@ -70,13 +70,17 @@ static void time_travel_handle_message(struct um_timetravel_msg *msg,
 	 * read of the message and write of the ACK.
 	 */
 	if (mode != TTMH_READ) {
+		bool disabled = irqs_disabled();
+
+		BUG_ON(mode == TTMH_IDLE && !disabled);
+
+		if (disabled)
+			local_irq_enable();
 		while (os_poll(1, &time_travel_ext_fd) != 0) {
-			if (mode == TTMH_IDLE) {
-				BUG_ON(!irqs_disabled());
-				local_irq_enable();
-				local_irq_disable();
-			}
+			/* nothing */
 		}
+		if (disabled)
+			local_irq_disable();
 	}
 
 	ret = os_read_file(time_travel_ext_fd, msg, sizeof(*msg));



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux