parisc: Ensure set_firmware_width() is called only once
authorHelge Deller <deller@gmx.de>
Fri, 25 Mar 2022 12:10:45 +0000 (13:10 +0100)
committerHelge Deller <deller@gmx.de>
Tue, 29 Mar 2022 19:37:12 +0000 (21:37 +0200)
Call set_firmware_width() only once at runtime.
This prevents that hotplugged CPUs will get stuck in spinlocks later on.

Signed-off-by: Helge Deller <deller@gmx.de>
arch/parisc/kernel/firmware.c

index 3370e34..c6b11bd 100644 (file)
@@ -83,7 +83,7 @@ extern unsigned long pdc_result2[NUM_PDC_RESULT];
 
 /* Firmware needs to be initially set to narrow to determine the 
  * actual firmware width. */
-int parisc_narrow_firmware __ro_after_init = 1;
+int parisc_narrow_firmware __ro_after_init = 2;
 #endif
 
 /* On most currently-supported platforms, IODC I/O calls are 32-bit calls
@@ -174,6 +174,11 @@ void set_firmware_width_unlocked(void)
 void set_firmware_width(void)
 {
        unsigned long flags;
+
+       /* already initialized? */
+       if (parisc_narrow_firmware != 2)
+               return;
+
        spin_lock_irqsave(&pdc_lock, flags);
        set_firmware_width_unlocked();
        spin_unlock_irqrestore(&pdc_lock, flags);