Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Maciej W. Rozycki and committed by
Thomas Bogendoerfer
c523378c 798715fa

+16 -10
+16 -10
arch/mips/dec/kn02xa-berr.c
··· 6 6 * DECstation/DECsystem 5000/20, /25, /33 (KN02-CA), 5000/50 7 7 * (KN04-CA) systems. 8 8 * 9 - * Copyright (c) 2005 Maciej W. Rozycki 9 + * Copyright (c) 2005, 2026 Maciej W. Rozycki 10 10 */ 11 11 12 12 #include <linux/init.h> 13 13 #include <linux/interrupt.h> 14 14 #include <linux/kernel.h> 15 + #include <linux/ratelimit.h> 15 16 #include <linux/types.h> 16 17 17 18 #include <asm/addrspace.h> ··· 51 50 static const char paritystr[] = "parity error"; 52 51 static const char lanestat[][4] = { " OK", "BAD" }; 53 52 53 + static DEFINE_RATELIMIT_STATE(rs, 54 + DEFAULT_RATELIMIT_INTERVAL, 55 + DEFAULT_RATELIMIT_BURST); 56 + 54 57 const char *kind, *agent, *cycle, *event; 55 58 unsigned long address; 56 59 ··· 84 79 if (is_fixup) 85 80 action = MIPS_BE_FIXUP; 86 81 87 - if (action != MIPS_BE_FIXUP) 82 + if (action != MIPS_BE_FIXUP && __ratelimit(&rs)) { 88 83 printk(KERN_ALERT "Bus error %s: %s %s %s at %#010lx\n", 89 84 kind, agent, cycle, event, address); 90 85 91 - if (action != MIPS_BE_FIXUP && address < 0x10000000) 92 - printk(KERN_ALERT " Byte lane status %#3x -- " 93 - "#3: %s, #2: %s, #1: %s, #0: %s\n", 94 - (mer & KN02XA_MER_BYTERR) >> 8, 95 - lanestat[(mer & KN02XA_MER_BYTERR_3) != 0], 96 - lanestat[(mer & KN02XA_MER_BYTERR_2) != 0], 97 - lanestat[(mer & KN02XA_MER_BYTERR_1) != 0], 98 - lanestat[(mer & KN02XA_MER_BYTERR_0) != 0]); 86 + if (address < 0x10000000) 87 + printk(KERN_ALERT " Byte lane status %#3x -- " 88 + "#3: %s, #2: %s, #1: %s, #0: %s\n", 89 + (mer & KN02XA_MER_BYTERR) >> 8, 90 + lanestat[(mer & KN02XA_MER_BYTERR_3) != 0], 91 + lanestat[(mer & KN02XA_MER_BYTERR_2) != 0], 92 + lanestat[(mer & KN02XA_MER_BYTERR_1) != 0], 93 + lanestat[(mer & KN02XA_MER_BYTERR_0) != 0]); 94 + } 99 95 100 96 return action; 101 97 }