summaryrefslogtreecommitdiff
path: root/arch/mips/dec
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@orcam.me.uk>2026-03-28 15:50:05 +0000
committerThomas Bogendoerfer <tsbogend@alpha.franken.de>2026-04-06 14:02:24 +0200
commitc523378ce6f65298fc1cb6be7c0e59a9008be446 (patch)
tree2ad8d4f8e3f182d598563bbe9a96db34dcc33cae /arch/mips/dec
parent798715fa06e1b3ff0f672721cca0a6789d5ebd37 (diff)
MIPS: DEC: Rate-limit memory errors for non-KN01 parity systems
Similarly to memory errors in ECC systems also rate-limit memory parity errors for KN02-BA, KN02-CA, KN04-BA, KN04-CA DECstation and DECsystem models. Unlike with ECC these events are always fatal and are less likely to cause a message flood, but handle them the same way for consistency. Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk> Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Diffstat (limited to 'arch/mips/dec')
-rw-r--r--arch/mips/dec/kn02xa-berr.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/arch/mips/dec/kn02xa-berr.c b/arch/mips/dec/kn02xa-berr.c
index 9699fc4e6eb1..6e494db1e437 100644
--- a/arch/mips/dec/kn02xa-berr.c
+++ b/arch/mips/dec/kn02xa-berr.c
@@ -6,12 +6,13 @@
* DECstation/DECsystem 5000/20, /25, /33 (KN02-CA), 5000/50
* (KN04-CA) systems.
*
- * Copyright (c) 2005 Maciej W. Rozycki
+ * Copyright (c) 2005, 2026 Maciej W. Rozycki
*/
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
+#include <linux/ratelimit.h>
#include <linux/types.h>
#include <asm/addrspace.h>
@@ -50,6 +51,10 @@ static int dec_kn02xa_be_backend(struct pt_regs *regs, int is_fixup,
static const char paritystr[] = "parity error";
static const char lanestat[][4] = { " OK", "BAD" };
+ static DEFINE_RATELIMIT_STATE(rs,
+ DEFAULT_RATELIMIT_INTERVAL,
+ DEFAULT_RATELIMIT_BURST);
+
const char *kind, *agent, *cycle, *event;
unsigned long address;
@@ -79,18 +84,19 @@ static int dec_kn02xa_be_backend(struct pt_regs *regs, int is_fixup,
if (is_fixup)
action = MIPS_BE_FIXUP;
- if (action != MIPS_BE_FIXUP)
+ if (action != MIPS_BE_FIXUP && __ratelimit(&rs)) {
printk(KERN_ALERT "Bus error %s: %s %s %s at %#010lx\n",
kind, agent, cycle, event, address);
- if (action != MIPS_BE_FIXUP && address < 0x10000000)
- printk(KERN_ALERT " Byte lane status %#3x -- "
- "#3: %s, #2: %s, #1: %s, #0: %s\n",
- (mer & KN02XA_MER_BYTERR) >> 8,
- lanestat[(mer & KN02XA_MER_BYTERR_3) != 0],
- lanestat[(mer & KN02XA_MER_BYTERR_2) != 0],
- lanestat[(mer & KN02XA_MER_BYTERR_1) != 0],
- lanestat[(mer & KN02XA_MER_BYTERR_0) != 0]);
+ if (address < 0x10000000)
+ printk(KERN_ALERT " Byte lane status %#3x -- "
+ "#3: %s, #2: %s, #1: %s, #0: %s\n",
+ (mer & KN02XA_MER_BYTERR) >> 8,
+ lanestat[(mer & KN02XA_MER_BYTERR_3) != 0],
+ lanestat[(mer & KN02XA_MER_BYTERR_2) != 0],
+ lanestat[(mer & KN02XA_MER_BYTERR_1) != 0],
+ lanestat[(mer & KN02XA_MER_BYTERR_0) != 0]);
+ }
return action;
}