The MPC7448 has ECC on its L2 cache, but Linux never enables or reads
the L2 error registers. L2ERRINTEN resets to 0, so multi-bit errors go
unreported, and the single-bit error counter is never read.

Patch 1 decodes MSSSR0 for L2 and L3 cache machine checks on all 745x
parts, which are currently all reported as "L2 data cache parity
error". Patch 2 enables machine checks for multi-bit ECC and tag parity
errors on the 7448 and adds the L2 error registers to the decode.
Patch 3 adds an EDAC driver that reports the single-bit count, the
machine checks, and uncorrectable errors latched without one. Patch 4
adds error injection to the driver; it is separate because it is the
part most likely to need changes.

L2 machine checks clear SRR1[RI], so they are never recoverable. The
injection code masks reporting while it runs and reads the errors back
itself. Tag injection hung the machine, so it is not offered.

Tested on an iMac G4 (PowerMac6,1) with a 7448 (PVR 0x80040202):

- L2ERRINTEN is 0x18 after boot.
- An injected single-bit error is corrected and reported as CEs.
- An injected multi-bit error is reported as a UE at the target address,
  without a machine check.
- With the injection's masking removed, a multi-bit error raises a
  machine check, decoded as in patch 2, and the writing task oopses. The
  error in the target line raised a second machine check while the first
  oops was being printed, and the driver then reported both as UEs.

Suspend to RAM and resume were tested: L2ERRINTEN is still 0x18 after
resume, and injection still works. With CONFIG_STRICT_KERNEL_RWX enabled,
PMU sleep oopses in low_sleep_handler with or without this series; that
was tested with "powerpc/powermac: Fix low_sleep_handler with
STRICT_KERNEL_RWX", which is sent separately. No other 745x part was
tested.

Patches 3 and 4 use symbols exported by patch 2, so I'd suggest the
series goes through the powerpc tree with an ack from the EDAC
maintainers.

---
Matt Turner (4):
      powerpc/32: Decode MPC745x L2 and L3 cache machine checks
      powerpc/32: Enable and decode MPC7448 L2 ECC machine checks
      EDAC/mpc7448_l2: Add a driver for the MPC7448 L2 cache
      EDAC/mpc7448_l2: Add error injection

 MAINTAINERS                               |   9 +
 arch/powerpc/include/asm/cpu_setup.h      |   1 +
 arch/powerpc/include/asm/cputable.h       |   2 +
 arch/powerpc/include/asm/mpc7448_l2.h     |  31 +++
 arch/powerpc/include/asm/reg.h            |  38 +++
 arch/powerpc/kernel/Makefile              |   3 +-
 arch/powerpc/kernel/cpu_setup_6xx.S       |  38 ++-
 arch/powerpc/kernel/cpu_specs_book3s_32.h |  24 +-
 arch/powerpc/kernel/mpc7448_l2.c          | 124 +++++++++
 arch/powerpc/kernel/traps.c               |  28 ++
 drivers/edac/Kconfig                      |   9 +
 drivers/edac/Makefile                     |   1 +
 drivers/edac/mpc7448_l2_edac.c            | 442 ++++++++++++++++++++++++++++++
 13 files changed, 736 insertions(+), 14 deletions(-)
---
base-commit: d68ce4e71248e1ff5af9654b407541d9260b3ba5
change-id: 20261109-ppc32-l2-ecc-9217e1ccfde0

Best regards,
--  
Matt Turner <[email protected]>


Reply via email to