Merge tag 'v5.15.57' into rpi-5.15.y
[platform/kernel/linux-rpi.git] / arch / arm / include / asm / irqflags.h
index aeec7f2..a3b1866 100644 (file)
@@ -163,13 +163,23 @@ static inline unsigned long arch_local_save_flags(void)
 }
 
 /*
- * restore saved IRQ & FIQ state
+ * restore saved IRQ state
  */
 #define arch_local_irq_restore arch_local_irq_restore
 static inline void arch_local_irq_restore(unsigned long flags)
 {
-       asm volatile(
-               "       msr     " IRQMASK_REG_NAME_W ", %0      @ local_irq_restore"
+       unsigned long temp = 0;
+       flags &= ~(1 << 6);
+       asm volatile (
+               " mrs %0, cpsr"
+               : "=r" (temp)
+               :
+               : "memory", "cc");
+               /* Preserve FIQ bit */
+               temp &= (1 << 6);
+               flags = flags | temp;
+       asm volatile (
+               "    msr    cpsr_c, %0    @ local_irq_restore"
                :
                : "r" (flags)
                : "memory", "cc");