[PATCH] parisc: Fix alternative coding for PCX-U CPUs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxxxxx>
Tested-by: Sven Schnelle <svens@xxxxxxxxxxxxxx>
Fixes: 3847dab77421 ("parisc: Add alternative coding infrastructure")
Signed-off-by: Helge Deller <deller@xxxxxx>
Cc: stable@xxxxxxxxxxxxxxx # 5.0+

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? */




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux