patch-2.4.22 linux-2.4.22/arch/x86_64/kernel/bluesmoke.c
Next file: linux-2.4.22/arch/x86_64/kernel/e820.c
Previous file: linux-2.4.22/arch/x86_64/kernel/apic.c
Back to the patch index
Back to the overall index
- Lines: 155
- Date:
2003-08-25 04:44:40.000000000 -0700
- Orig file:
linux-2.4.21/arch/x86_64/kernel/bluesmoke.c
- Orig date:
2003-06-13 07:51:32.000000000 -0700
diff -urN linux-2.4.21/arch/x86_64/kernel/bluesmoke.c linux-2.4.22/arch/x86_64/kernel/bluesmoke.c
@@ -125,6 +125,67 @@
return NULL;
}
+static char *transaction[] = {
+ "instruction", "data", "generic", "reserved"
+};
+static char *cachelevel[] = {
+ "level 0", "level 1", "level 2", "level generic"
+};
+static char *memtrans[] = {
+ "generic error", "generic read", "generic write", "data read",
+ "data write", "instruction fetch", "prefetch", "snoop",
+ "?", "?", "?", "?", "?", "?", "?"
+};
+static char *partproc[] = {
+ "local node origin", "local node response",
+ "local node observed", "generic"
+};
+static char *timeout[] = {
+ "request didn't time out",
+ "request timed out"
+};
+static char *memoryio[] = {
+ "memory access", "res.", "i/o access", "generic"
+};
+static char *extendederr[] = {
+ "ecc error",
+ "crc error",
+ "sync error",
+ "mst abort",
+ "tgt abort",
+ "gart error",
+ "rmw error",
+ "wdog error",
+ "chipkill ecc error",
+ "<9>","<10>","<11>","<12>",
+ "<13>","<14>","<15>"
+};
+static char *highbits[32] = {
+ [31] = "previous error lost",
+ [30] = "error overflow",
+ [29] = "error uncorrected",
+ [28] = "error enable",
+ [27] = "misc error valid",
+ [26] = "error address valid",
+ [25] = "processor context corrupt",
+ [24] = "res24",
+ [23] = "res23",
+ /* 22-15 ecc syndrome bits */
+ [14] = "corrected ecc error",
+ [13] = "uncorrected ecc error",
+ [12] = "res12",
+ [11] = "res11",
+ [10] = "res10",
+ [9] = "res9",
+ [8] = "dram scrub error",
+ [7] = "res7",
+ /* 6-4 ht link number of error */
+ [3] = "res3",
+ [2] = "res2",
+ [1] = "err cpu0",
+ [0] = "err cpu1",
+};
+
static void check_k8_nb(void)
{
struct pci_dev *nb;
@@ -139,20 +200,52 @@
return;
printk(KERN_ERR "Northbridge status %08x%08x\n",
statushigh,statuslow);
- if (statuslow & 0x10)
- printk(KERN_ERR "GART error %d\n", statuslow & 0xf);
- if (statushigh & (1<<31))
- printk(KERN_ERR "Lost an northbridge error\n");
- if (statushigh & (1<<25))
- printk(KERN_EMERG "NB status: unrecoverable\n");
+
+ unsigned short errcode = statuslow & 0xffff;
+ switch (errcode >> 8) {
+ case 0:
+ printk(KERN_ERR " GART TLB error %s %s\n",
+ transaction[(errcode >> 2) & 3],
+ cachelevel[errcode & 3]);
+ break;
+ case 1:
+ if (errcode & (1<<11)) {
+ printk(KERN_ERR " bus error %s %s %s %s %s\n",
+ partproc[(errcode >> 10) & 0x3],
+ timeout[(errcode >> 9) & 1],
+ memtrans[(errcode >> 4) & 0xf],
+ memoryio[(errcode >> 2) & 0x3],
+ cachelevel[(errcode & 0x3)]);
+ } else if (errcode & (1<<8)) {
+ printk(KERN_ERR " memory error %s %s %s\n",
+ memtrans[(errcode >> 4) & 0xf],
+ transaction[(errcode >> 2) & 0x3],
+ cachelevel[(errcode & 0x3)]);
+ } else {
+ printk(KERN_ERR " unknown error code %x\n", errcode);
+ }
+ break;
+ }
+ if (statushigh & ((1<<14)|(1<<13)))
+ printk(KERN_ERR " ECC syndrome bits %x\n",
+ (((statuslow >> 24) & 0xff) << 8) | ((statushigh >> 15) & 0x7f));
+ errcode = (statuslow >> 16) & 0xf;
+ printk(KERN_ERR " extended error %s\n", extendederr[(statuslow >> 16) & 0xf]);
+
+ /* should only print when it was a HyperTransport related error. */
+ printk(KERN_ERR " link number %x\n", (statushigh >> 4) & 3);
+
+ int i;
+ for (i = 0; i < 32; i++)
+ if (highbits[i] && (statushigh & (1<<i)))
+ printk(KERN_ERR " %s\n", highbits[i]);
+
if (statushigh & (1<<26)) {
u32 addrhigh, addrlow;
pci_read_config_dword(nb, 0x54, &addrhigh);
pci_read_config_dword(nb, 0x50, &addrlow);
- printk(KERN_ERR "NB error address %08x%08x\n", addrhigh,addrlow);
+ printk(KERN_ERR " error address %08x%08x\n", addrhigh,addrlow);
}
- if (statushigh & (1<<29))
- printk(KERN_EMERG "Error uncorrected\n");
statushigh &= ~(1<<31);
pci_write_config_dword(nb, 0x4c, statushigh);
}
@@ -256,22 +349,12 @@
machine_check_vector = k8_machine_check;
for (i = 0; i < banks; i++) {
u64 val = ((1UL<<i) & disabled_banks) ? 0 : ~0UL;
+ if (val && i == 4)
+ val = k8_nb_flags;
wrmsrl(MSR_IA32_MC0_CTL+4*i, val);
wrmsrl(MSR_IA32_MC0_STATUS+4*i,0);
}
- nb = find_k8_nb();
- if (nb != NULL) {
- u32 reg, reg2;
- pci_read_config_dword(nb, 0x40, ®);
- pci_write_config_dword(nb, 0x40, k8_nb_flags);
- pci_read_config_dword(nb, 0x44, ®2);
- pci_write_config_dword(nb, 0x44, reg2);
- printk(KERN_INFO "Machine Check for K8 Northbridge %d enabled (%x,%x)\n",
- nb->devfn, reg, reg2);
- ignored_banks |= (1UL<<4);
- }
-
set_in_cr4(X86_CR4_MCE);
if (mcheck_interval && (smp_processor_id() == 0)) {
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)