All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3] parisc: Fix crash due alternative coding for NP iopdir_fdc bit
@ 2019-05-27 19:20 Helge Deller
  2019-05-27 19:35 ` Carlo Pisani
  2019-05-27 19:41 ` John David Anglin
  0 siblings, 2 replies; 29+ messages in thread
From: Helge Deller @ 2019-05-27 19:20 UTC (permalink / raw)
  To: linux-parisc, James Bottomley, John David Anglin, Sven Schnelle,
	Carlo Pisani

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

We have no documentation for PCX-W+ (PA8600) and PCX-W2 (PA8700) CPUs,
but Carlo Pisani reported that his C3600 machine (PCX-W+) fails when the
fdc instructions were removed. His firmware didn't set the NIOP bit, so
we assume it's a firmware bug since other C3750 machines had the bit
set.

Going forward, let's not replace the fdc and sync assembler instructions
by NOPS if:
a) the NP iopdir_fdc bit was set by firmware, or
b) we find a PCX-U or PCX-U+ (PA8000, PA8200) CPU, or
c) we find a PCX-W+ (PA8600) CPU.

This fixes the HPMC crashes on a C240 and C36XX machines. For other
machines we rely on the firmware to set the bit when needed.

In case one finds HPMC issues, people could try to boot their machines
with the "no-alternatives" kernel option to turn off any alternative
patching.

Reported-by: Sven Schnelle <svens@stackframe.org>
Reported-by: Carlo Pisani <carlojpisani@gmail.com>
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 --git a/arch/parisc/kernel/alternative.c b/arch/parisc/kernel/alternative.c
index bf2274e01a96..1ac3b4ac73c0 100644
--- a/arch/parisc/kernel/alternative.c
+++ b/arch/parisc/kernel/alternative.c
@@ -56,7 +56,9 @@ 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.cpu_type == pcxw_) ||
+			 (boot_cpu_data.pdc.capabilities & PDC_MODEL_IOPDIR_FDC)))
 			continue;

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

^ permalink raw reply related	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2019-06-02 16:12 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-27 19:20 [PATCH v3] parisc: Fix crash due alternative coding for NP iopdir_fdc bit Helge Deller
2019-05-27 19:35 ` Carlo Pisani
2019-05-27 20:13   ` John David Anglin
2019-05-27 20:22     ` Sven Schnelle
2019-05-27 20:49       ` John David Anglin
2019-05-27 20:15   ` Sven Schnelle
2019-05-28 11:06     ` Sven Schnelle
2019-05-28 11:28       ` Rolf Eike Beer
2019-05-28 15:41         ` Sven Schnelle
2019-05-28 15:52           ` Helge Deller
     [not found]       ` <e81b7ae4-3126-5fda-58e4-4a83bd4fcfcf@bell.net>
2019-05-28 15:11         ` Helge Deller
2019-05-28 15:38           ` Sven Schnelle
2019-05-28 17:06             ` John David Anglin
2019-05-28 17:24               ` Rolf Eike Beer
2019-05-28 17:39                 ` Sven Schnelle
2019-05-28 18:40                   ` John David Anglin
2019-05-29 14:15                     ` Helge Deller
2019-05-29 17:01                       ` John David Anglin
2019-05-30 19:55                       ` Sven Schnelle
2019-05-30 20:59                         ` Sven Schnelle
2019-05-31 12:23                           ` John David Anglin
2019-06-02 10:29                             ` Carlo Pisani
2019-06-02 14:45                               ` John David Anglin
2019-06-02 14:38                             ` John David Anglin
2019-06-02 16:12                               ` John David Anglin
2019-05-27 19:41 ` John David Anglin
2019-05-27 20:11   ` Helge Deller
2019-05-27 20:16     ` Carlo Pisani
2019-05-27 20:45     ` John David Anglin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.