diff options
Diffstat (limited to 'arch/powerpc/kernel/eeh.c')
-rw-r--r-- | arch/powerpc/kernel/eeh.c | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/arch/powerpc/kernel/eeh.c b/arch/powerpc/kernel/eeh.c index 2248a1999c64..e1b6d8e17289 100644 --- a/arch/powerpc/kernel/eeh.c +++ b/arch/powerpc/kernel/eeh.c | |||
@@ -143,6 +143,8 @@ static int __init eeh_setup(char *str) | |||
143 | { | 143 | { |
144 | if (!strcmp(str, "off")) | 144 | if (!strcmp(str, "off")) |
145 | eeh_add_flag(EEH_FORCE_DISABLED); | 145 | eeh_add_flag(EEH_FORCE_DISABLED); |
146 | else if (!strcmp(str, "early_log")) | ||
147 | eeh_add_flag(EEH_EARLY_DUMP_LOG); | ||
146 | 148 | ||
147 | return 1; | 149 | return 1; |
148 | } | 150 | } |
@@ -758,30 +760,41 @@ static void eeh_reset_pe_once(struct eeh_pe *pe) | |||
758 | int eeh_reset_pe(struct eeh_pe *pe) | 760 | int eeh_reset_pe(struct eeh_pe *pe) |
759 | { | 761 | { |
760 | int flags = (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE); | 762 | int flags = (EEH_STATE_MMIO_ACTIVE | EEH_STATE_DMA_ACTIVE); |
761 | int i, rc; | 763 | int i, state, ret; |
764 | |||
765 | /* Mark as reset and block config space */ | ||
766 | eeh_pe_state_mark(pe, EEH_PE_RESET | EEH_PE_CFG_BLOCKED); | ||
762 | 767 | ||
763 | /* Take three shots at resetting the bus */ | 768 | /* Take three shots at resetting the bus */ |
764 | for (i=0; i<3; i++) { | 769 | for (i = 0; i < 3; i++) { |
765 | eeh_reset_pe_once(pe); | 770 | eeh_reset_pe_once(pe); |
766 | 771 | ||
767 | /* | 772 | /* |
768 | * EEH_PE_ISOLATED is expected to be removed after | 773 | * EEH_PE_ISOLATED is expected to be removed after |
769 | * BAR restore. | 774 | * BAR restore. |
770 | */ | 775 | */ |
771 | rc = eeh_ops->wait_state(pe, PCI_BUS_RESET_WAIT_MSEC); | 776 | state = eeh_ops->wait_state(pe, PCI_BUS_RESET_WAIT_MSEC); |
772 | if ((rc & flags) == flags) | 777 | if ((state & flags) == flags) { |
773 | return 0; | 778 | ret = 0; |
779 | goto out; | ||
780 | } | ||
774 | 781 | ||
775 | if (rc < 0) { | 782 | if (state < 0) { |
776 | pr_err("%s: Unrecoverable slot failure on PHB#%d-PE#%x", | 783 | pr_warn("%s: Unrecoverable slot failure on PHB#%d-PE#%x", |
777 | __func__, pe->phb->global_number, pe->addr); | 784 | __func__, pe->phb->global_number, pe->addr); |
778 | return -1; | 785 | ret = -ENOTRECOVERABLE; |
786 | goto out; | ||
779 | } | 787 | } |
780 | pr_err("EEH: bus reset %d failed on PHB#%d-PE#%x, rc=%d\n", | 788 | |
781 | i+1, pe->phb->global_number, pe->addr, rc); | 789 | /* We might run out of credits */ |
790 | ret = -EIO; | ||
791 | pr_warn("%s: Failure %d resetting PHB#%x-PE#%x\n (%d)\n", | ||
792 | __func__, state, pe->phb->global_number, pe->addr, (i + 1)); | ||
782 | } | 793 | } |
783 | 794 | ||
784 | return -1; | 795 | out: |
796 | eeh_pe_state_clear(pe, EEH_PE_RESET | EEH_PE_CFG_BLOCKED); | ||
797 | return ret; | ||
785 | } | 798 | } |
786 | 799 | ||
787 | /** | 800 | /** |
@@ -920,11 +933,8 @@ int eeh_init(void) | |||
920 | pr_warn("%s: Platform EEH operation not found\n", | 933 | pr_warn("%s: Platform EEH operation not found\n", |
921 | __func__); | 934 | __func__); |
922 | return -EEXIST; | 935 | return -EEXIST; |
923 | } else if ((ret = eeh_ops->init())) { | 936 | } else if ((ret = eeh_ops->init())) |
924 | pr_warn("%s: Failed to call platform init function (%d)\n", | ||
925 | __func__, ret); | ||
926 | return ret; | 937 | return ret; |
927 | } | ||
928 | 938 | ||
929 | /* Initialize EEH event */ | 939 | /* Initialize EEH event */ |
930 | ret = eeh_event_init(); | 940 | ret = eeh_event_init(); |
@@ -1209,6 +1219,7 @@ int eeh_unfreeze_pe(struct eeh_pe *pe, bool sw_state) | |||
1209 | static struct pci_device_id eeh_reset_ids[] = { | 1219 | static struct pci_device_id eeh_reset_ids[] = { |
1210 | { PCI_DEVICE(0x19a2, 0x0710) }, /* Emulex, BE */ | 1220 | { PCI_DEVICE(0x19a2, 0x0710) }, /* Emulex, BE */ |
1211 | { PCI_DEVICE(0x10df, 0xe220) }, /* Emulex, Lancer */ | 1221 | { PCI_DEVICE(0x10df, 0xe220) }, /* Emulex, Lancer */ |
1222 | { PCI_DEVICE(0x14e4, 0x1657) }, /* Broadcom BCM5719 */ | ||
1212 | { 0 } | 1223 | { 0 } |
1213 | }; | 1224 | }; |
1214 | 1225 | ||