1 // SPDX-License-Identifier: GPL-2.0 2 /* Machine check handling for Tsunami/Typhoon systems. */ 3 #include <linux/init.h> 4 #include <linux/pci.h> 5 #include <linux/sched.h> 6 #include <asm/io.h> 7 #include <asm/core_tsunami.h> 8 #include <asm/smp.h> 9 #include <asm/err_common.h> 10 #include <asm/irq_regs.h> 11 #include "err_impl.h" 12 #include "proto.h" 13 #include "pci_impl.h" 14 15 static inline void 16 tsunami_pci_clr_err_1(tsunami_pchip *pchip) 17 { 18 pchip->perror.csr; 19 pchip->perror.csr = 0x040; 20 mb(); 21 pchip->perror.csr; 22 } 23 24 static inline void 25 tsunami_pci_clr_err(void) 26 { 27 tsunami_pci_clr_err_1(TSUNAMI_pchip0); 28 29 /* TSUNAMI and TYPHOON can have 2, but might only have 1 (DS10) */ 30 if (TSUNAMI_cchip->csc.csr & 1L<<14) 31 tsunami_pci_clr_err_1(TSUNAMI_pchip1); 32 } 33 34 void 35 tsunami_machine_check(unsigned long vector, unsigned long la_ptr) 36 { 37 /* Clear error before any reporting. */ 38 mb(); 39 mb(); /* magic */ 40 draina(); 41 tsunami_pci_clr_err(); 42 wrmces(0x7); 43 mb(); 44 45 process_mcheck_info(vector, la_ptr, "TSUNAMI", 46 mcheck_expected(smp_processor_id())); 47 } 48