Skip to contentSkip to conversation

parisc: Fix alternative coding for PCX-U CPUs

PATCH New Helge Deller 1 participant 1 message May 24, 2019 PA-RISC architecture

lore
Share & tools
lore

Helge Deller

author maintainer
#0 lore raw

PATCH 1/1 parisc: Fix alternative coding for PCX-U CPUs

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).

Fixes 3847dab77421 ("parisc: Add alternative coding infrastructure")
arch/parisc/kernel/alternative.c +2 -1
index bf2274e01a96..7c574b21f834 100644
@@ -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? */