aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc/platforms/pseries/eeh.c
diff options
context:
space:
mode:
authorLinas Vepstas <linas@linas.org>2005-11-03 19:52:49 -0500
committerPaul Mackerras <paulus@samba.org>2006-01-09 23:28:32 -0500
commit77bd741561016134d1761d6101c4f0361025062f (patch)
tree5e3389b6941add4b24a2be64c730b7a9087c1f2f /arch/powerpc/platforms/pseries/eeh.c
parent977127174a7dff52d17faeeb4c4949a54221881f (diff)
[PATCH] powerpc: PCI Error Recovery: PPC64 core recovery routines
Various PCI bus errors can be signaled by newer PCI controllers. The core error recovery routines are architecture dependent. This patch adds a recovery infrastructure for the PPC64 pSeries systems. Signed-off-by: Linas Vepstas <linas@austin.ibm.com> Signed-off-by: Paul Mackerras <paulus@samba.org> (cherry picked from e8ca11b460c4c9c7fa6b529be221529ebd770e38 commit)
Diffstat (limited to 'arch/powerpc/platforms/pseries/eeh.c')
-rw-r--r--arch/powerpc/platforms/pseries/eeh.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/powerpc/platforms/pseries/eeh.c b/arch/powerpc/platforms/pseries/eeh.c
index 7fbfd16d72b..d6560c45637 100644
--- a/arch/powerpc/platforms/pseries/eeh.c
+++ b/arch/powerpc/platforms/pseries/eeh.c
@@ -485,6 +485,11 @@ static void __eeh_mark_slot (struct device_node *dn, int mode_flag)
485 if (PCI_DN(dn)) { 485 if (PCI_DN(dn)) {
486 PCI_DN(dn)->eeh_mode |= mode_flag; 486 PCI_DN(dn)->eeh_mode |= mode_flag;
487 487
488 /* Mark the pci device driver too */
489 struct pci_dev *dev = PCI_DN(dn)->pcidev;
490 if (dev && dev->driver)
491 dev->error_state = pci_channel_io_frozen;
492
488 if (dn->child) 493 if (dn->child)
489 __eeh_mark_slot (dn->child, mode_flag); 494 __eeh_mark_slot (dn->child, mode_flag);
490 } 495 }
@@ -544,6 +549,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
544 int rets[3]; 549 int rets[3];
545 unsigned long flags; 550 unsigned long flags;
546 struct pci_dn *pdn; 551 struct pci_dn *pdn;
552 enum pci_channel_state state;
547 int rc = 0; 553 int rc = 0;
548 554
549 __get_cpu_var(total_mmio_ffs)++; 555 __get_cpu_var(total_mmio_ffs)++;
@@ -648,8 +654,13 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
648 eeh_mark_slot (dn, EEH_MODE_ISOLATED); 654 eeh_mark_slot (dn, EEH_MODE_ISOLATED);
649 spin_unlock_irqrestore(&confirm_error_lock, flags); 655 spin_unlock_irqrestore(&confirm_error_lock, flags);
650 656
651 eeh_send_failure_event (dn, dev, rets[0], rets[2]); 657 state = pci_channel_io_normal;
652 658 if ((rets[0] == 2) || (rets[0] == 4))
659 state = pci_channel_io_frozen;
660 if (rets[0] == 5)
661 state = pci_channel_io_perm_failure;
662 eeh_send_failure_event (dn, dev, state, rets[2]);
663
653 /* Most EEH events are due to device driver bugs. Having 664 /* Most EEH events are due to device driver bugs. Having
654 * a stack trace will help the device-driver authors figure 665 * a stack trace will help the device-driver authors figure
655 * out what happened. So print that out. */ 666 * out what happened. So print that out. */
@@ -953,8 +964,10 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
953 * But there are a few cases like display devices that make sense. 964 * But there are a few cases like display devices that make sense.
954 */ 965 */
955 enable = 1; /* i.e. we will do checking */ 966 enable = 1; /* i.e. we will do checking */
967#if 0
956 if ((*class_code >> 16) == PCI_BASE_CLASS_DISPLAY) 968 if ((*class_code >> 16) == PCI_BASE_CLASS_DISPLAY)
957 enable = 0; 969 enable = 0;
970#endif
958 971
959 if (!enable) 972 if (!enable)
960 pdn->eeh_mode |= EEH_MODE_NOCHECK; 973 pdn->eeh_mode |= EEH_MODE_NOCHECK;