Patch "powerpc/64: fix irq replay missing preempt" 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

    powerpc/64: fix irq replay missing preempt

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:
     powerpc-64-fix-irq-replay-missing-preempt.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 dfc853465ec45e5ed5b49a2d2688a09405ba9ce7
Author: Nicholas Piggin <npiggin@xxxxxxxxx>
Date:   Tue Sep 15 21:46:45 2020 +1000

    powerpc/64: fix irq replay missing preempt
    
    [ Upstream commit 903fd31d3212ab72d564c68f6cfb5d04db68773e ]
    
    Prior to commit 3282a3da25bd ("powerpc/64: Implement soft interrupt
    replay in C"), replayed interrupts returned by the regular interrupt
    exit code, which performs preemption in case an interrupt had set
    need_resched.
    
    This logic was missed by the conversion. Adding preempt_disable/enable
    around the interrupt replay and final irq enable will reschedule if
    needed.
    
    Fixes: 3282a3da25bd ("powerpc/64: Implement soft interrupt replay in C")
    Signed-off-by: Nicholas Piggin <npiggin@xxxxxxxxx>
    Signed-off-by: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
    Link: https://lore.kernel.org/r/20200915114650.3980244-1-npiggin@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 05b1cc0e009e4..297ee79febc6c 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -368,6 +368,12 @@ notrace void arch_local_irq_restore(unsigned long mask)
 		}
 	}
 
+	/*
+	 * Disable preempt here, so that the below preempt_enable will
+	 * perform resched if required (a replayed interrupt may set
+	 * need_resched).
+	 */
+	preempt_disable();
 	irq_soft_mask_set(IRQS_ALL_DISABLED);
 	trace_hardirqs_off();
 
@@ -377,6 +383,7 @@ notrace void arch_local_irq_restore(unsigned long mask)
 	trace_hardirqs_on();
 	irq_soft_mask_set(IRQS_ENABLED);
 	__hard_irq_enable();
+	preempt_enable();
 }
 EXPORT_SYMBOL(arch_local_irq_restore);
 



[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