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

powerpc/eeh: Remove eeh_handle_event()

The function eeh_handle_event(pe) does nothing other than switching
between calling eeh_handle_normal_event(pe) and
eeh_handle_special_event(). However it is only called in two places,
one where pe can't be NULL and the other where it must be NULL (see
eeh_event_handler()) so it does nothing but obscure the flow of
control.

So, remove it.

Signed-off-by: Sam Bobroff <sam.bobroff@au1.ibm.com>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

authored by

Sam Bobroff and committed by
Michael Ellerman
68701780 d41ce7b1

+19 -30
+2 -1
arch/powerpc/include/asm/eeh_event.h
··· 34 34 int eeh_event_init(void); 35 35 int eeh_send_failure_event(struct eeh_pe *pe); 36 36 void eeh_remove_event(struct eeh_pe *pe, bool force); 37 - void eeh_handle_event(struct eeh_pe *pe); 37 + bool eeh_handle_normal_event(struct eeh_pe *pe); 38 + void eeh_handle_special_event(void); 38 39 39 40 #endif /* __KERNEL__ */ 40 41 #endif /* ASM_POWERPC_EEH_EVENT_H */
+15 -27
arch/powerpc/kernel/eeh_driver.c
··· 738 738 * Attempts to recover the given PE. If recovery fails or the PE has failed 739 739 * too many times, remove the PE. 740 740 * 741 + * While PHB detects address or data parity errors on particular PCI 742 + * slot, the associated PE will be frozen. Besides, DMA's occurring 743 + * to wild addresses (which usually happen due to bugs in device 744 + * drivers or in PCI adapter firmware) can cause EEH error. #SERR, 745 + * #PERR or other misc PCI-related errors also can trigger EEH errors. 746 + * 747 + * Recovery process consists of unplugging the device driver (which 748 + * generated hotplug events to userspace), then issuing a PCI #RST to 749 + * the device, then reconfiguring the PCI config space for all bridges 750 + * & devices under this slot, and then finally restarting the device 751 + * drivers (which cause a second set of hotplug events to go out to 752 + * userspace). 753 + * 741 754 * Returns true if @pe should no longer be used, else false. 742 755 */ 743 - static bool eeh_handle_normal_event(struct eeh_pe *pe) 756 + bool eeh_handle_normal_event(struct eeh_pe *pe) 744 757 { 745 758 struct pci_bus *frozen_bus; 746 759 struct eeh_dev *edev, *tmp; ··· 955 942 * specific PE. Iterates through possible failures and handles them as 956 943 * necessary. 957 944 */ 958 - static void eeh_handle_special_event(void) 945 + void eeh_handle_special_event(void) 959 946 { 960 947 struct eeh_pe *pe, *phb_pe; 961 948 struct pci_bus *bus; ··· 1061 1048 if (rc == EEH_NEXT_ERR_DEAD_IOC) 1062 1049 break; 1063 1050 } while (rc != EEH_NEXT_ERR_NONE); 1064 - } 1065 - 1066 - /** 1067 - * eeh_handle_event - Reset a PCI device after hard lockup. 1068 - * @pe: EEH PE 1069 - * 1070 - * While PHB detects address or data parity errors on particular PCI 1071 - * slot, the associated PE will be frozen. Besides, DMA's occurring 1072 - * to wild addresses (which usually happen due to bugs in device 1073 - * drivers or in PCI adapter firmware) can cause EEH error. #SERR, 1074 - * #PERR or other misc PCI-related errors also can trigger EEH errors. 1075 - * 1076 - * Recovery process consists of unplugging the device driver (which 1077 - * generated hotplug events to userspace), then issuing a PCI #RST to 1078 - * the device, then reconfiguring the PCI config space for all bridges 1079 - * & devices under this slot, and then finally restarting the device 1080 - * drivers (which cause a second set of hotplug events to go out to 1081 - * userspace). 1082 - */ 1083 - void eeh_handle_event(struct eeh_pe *pe) 1084 - { 1085 - if (pe) 1086 - eeh_handle_normal_event(pe); 1087 - else 1088 - eeh_handle_special_event(); 1089 1051 }
+2 -2
arch/powerpc/kernel/eeh_event.c
··· 81 81 pr_info("EEH: Detected PCI bus error on " 82 82 "PHB#%x-PE#%x\n", 83 83 pe->phb->global_number, pe->addr); 84 - eeh_handle_event(pe); 84 + eeh_handle_normal_event(pe); 85 85 eeh_pe_state_clear(pe, EEH_PE_RECOVERING); 86 86 } else { 87 - eeh_handle_event(NULL); 87 + eeh_handle_special_event(); 88 88 } 89 89 90 90 kfree(event);