Skip to content

Commit

Permalink
parisc: Fix crash due alternative coding for NP iopdir_fdc bit
Browse files Browse the repository at this point in the history
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 aparently don't
need those flushes 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 (PA8600, PCX-W+) fails
when the fdc instructions were removed. His firmware didn't set the NIOP
bit, so one may assume it's a firmware bug since other C3750 machines
had the bit set.

Even if documentation (as mentioned above) states that PCX-W (PA8500,
e.g.  J5000) does not need fdc flushes, Sven could show that an Adaptec
29320A PCI-X SCSI controller reliably failed on a dd command during the
first five minutes in his J5000 when fdc flushes were missing.

Going forward, we will now 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 CPU up to and including a PCX-W+ (PA8600).

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 <[email protected]>
Reported-by: Carlo Pisani <[email protected]>
Tested-by: Sven Schnelle <[email protected]>
Fixes: 3847dab ("parisc: Add alternative coding infrastructure")
Signed-off-by: Helge Deller <[email protected]>
Cc: [email protected] # 5.0+
  • Loading branch information
hdeller committed Jun 6, 2019
1 parent 116d753 commit 527a1d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/parisc/kernel/alternative.c
Original file line number Diff line number Diff line change
Expand Up @@ -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? */
Expand Down

0 comments on commit 527a1d1

Please sign in to comment.