Skip to content

Commit 77bd741

Browse files
linaspaulusmack
authored andcommitted
[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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]> (cherry picked from e8ca11b460c4c9c7fa6b529be221529ebd770e38 commit)
1 parent 9771271 commit 77bd741

File tree

7 files changed

+413
-35
lines changed

7 files changed

+413
-35
lines changed

arch/powerpc/platforms/pseries/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ obj-$(CONFIG_SMP) += smp.o
44
obj-$(CONFIG_IBMVIO) += vio.o
55
obj-$(CONFIG_XICS) += xics.o
66
obj-$(CONFIG_SCANLOG) += scanlog.o
7-
obj-$(CONFIG_EEH) += eeh.o eeh_event.o
7+
obj-$(CONFIG_EEH) += eeh.o eeh_driver.o eeh_event.o
88

99
obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o
1010
obj-$(CONFIG_HVCS) += hvcserver.o

arch/powerpc/platforms/pseries/eeh.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -485,6 +485,11 @@ static void __eeh_mark_slot (struct device_node *dn, int mode_flag)
485485
if (PCI_DN(dn)) {
486486
PCI_DN(dn)->eeh_mode |= mode_flag;
487487

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+
488493
if (dn->child)
489494
__eeh_mark_slot (dn->child, mode_flag);
490495
}
@@ -544,6 +549,7 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
544549
int rets[3];
545550
unsigned long flags;
546551
struct pci_dn *pdn;
552+
enum pci_channel_state state;
547553
int rc = 0;
548554

549555
__get_cpu_var(total_mmio_ffs)++;
@@ -648,8 +654,13 @@ int eeh_dn_check_failure(struct device_node *dn, struct pci_dev *dev)
648654
eeh_mark_slot (dn, EEH_MODE_ISOLATED);
649655
spin_unlock_irqrestore(&confirm_error_lock, flags);
650656

651-
eeh_send_failure_event (dn, dev, rets[0], rets[2]);
652-
657+
state = pci_channel_io_normal;
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+
653664
/* Most EEH events are due to device driver bugs. Having
654665
* a stack trace will help the device-driver authors figure
655666
* out what happened. So print that out. */
@@ -953,8 +964,10 @@ static void *early_enable_eeh(struct device_node *dn, void *data)
953964
* But there are a few cases like display devices that make sense.
954965
*/
955966
enable = 1; /* i.e. we will do checking */
967+
#if 0
956968
if ((*class_code >> 16) == PCI_BASE_CLASS_DISPLAY)
957969
enable = 0;
970+
#endif
958971

959972
if (!enable)
960973
pdn->eeh_mode |= EEH_MODE_NOCHECK;

0 commit comments

Comments
 (0)