summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorHelge Deller <deller@gmx.de>2022-03-25 13:10:45 +0100
committerHelge Deller <deller@gmx.de>2022-03-29 21:37:12 +0200
commit1e93848a385ed2c2df9cb246b073dc8c66d10793 (patch)
treeb1f76268ff20437e11288e311c58425fa417adb6 /arch
parentparisc: Add constants for control registers and clean up mfctl() (diff)
downloadlinux-1e93848a385ed2c2df9cb246b073dc8c66d10793.tar.xz
linux-1e93848a385ed2c2df9cb246b073dc8c66d10793.zip
parisc: Ensure set_firmware_width() is called only once
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/parisc/kernel/firmware.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/arch/parisc/kernel/firmware.c b/arch/parisc/kernel/firmware.c
index 3370e347dde3..c6b11bdb8602 100644
--- a/arch/parisc/kernel/firmware.c
+++ b/arch/parisc/kernel/firmware.c
@@ -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);