diff mbox series

parisc: Fix alternative coding for PCX-U CPUs

Message ID 20190524214124.GA14765@ls3530.dellerweb.de (mailing list archive)
State Superseded, archived
Headers show
Series parisc: Fix alternative coding for PCX-U CPUs | expand

Commit Message

Helge Deller May 24, 2019, 9:41 p.m. UTC
Sven Schnelle noticed a reproduceable kernel crash (HPMC) on his C240
machine due to the alternative coding infrastructure.

According to the documentation, data cache flushes and sync instructions
are needed on the PCX-U (e.g. C200/C240) platforms, while PCX-W (e.g.
C360) platforms don't need those syncs when changing the IO PDIR data
structures.

So, let's not replace the fdc and sync assembler instructions by NOPS if
we see a CPU < PA8500 (PCX-W).

Reported-by: Sven Schnelle <svens@stackframe.org>
Tested-by: Sven Schnelle <svens@stackframe.org>
Fixes: 3847dab77421 ("parisc: Add alternative coding infrastructure")
Signed-off-by: Helge Deller <deller@gmx.de>
Cc: stable@vger.kernel.org # 5.0+
diff mbox series

Patch

diff --git a/arch/parisc/kernel/alternative.c b/arch/parisc/kernel/alternative.c
index bf2274e01a96..7c574b21f834 100644
--- a/arch/parisc/kernel/alternative.c
+++ b/arch/parisc/kernel/alternative.c
@@ -56,7 +56,8 @@  void __init_or_module apply_alternatives(struct alt_instr *start,
 		 * time IO-PDIR is changed in Ike/Astro.
 		 */
 		if ((cond & ALT_COND_NO_IOC_FDC) &&
-			(boot_cpu_data.pdc.capabilities & PDC_MODEL_IOPDIR_FDC))
+			((boot_cpu_data.cpu_type < pcxw) ||
+			 (boot_cpu_data.pdc.capabilities & PDC_MODEL_IOPDIR_FDC)))
 			continue;

 		/* Want to replace pdtlb by a pdtlb,l instruction? */