Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > fc11cd6e1c513a17304da94a5390f3cd > files > 2786

kernel-2.6.18-194.11.1.el5.src.rpm

From: Jesse Larrew <jlarrew@redhat.com>
Date: Fri, 21 Nov 2008 16:44:59 -0500
Subject: [pci] generic fix for EEH restore all registers
Message-id: 20081121214459.21552.23166.sendpatchset@manic8ball.ltc.austin.ibm.com
O-Subject: [PATCH RHEL5.3 2/2 BZ470580, BZ470582] Generic PCI fix for EEH restore all registers
Bugzilla: 470580
RH-Acked-by: Andy Gospodarek <gospo@redhat.com>

RHBZ#:
======
https://bugzilla.redhat.com/show_bug.cgi?id=470580
https://bugzilla.redhat.com/show_bug.cgi?id=470582

Description:
===========
This is a bugfix for all archs that compile the PCI driver.

In the bnx2 and ixgbe drivers (and possibly others), not all of the registers
will be correctly restored after an EEH event. This can leave the adapters in
an unreliable state after EEH.  At that point if you try to change the ip or
anything like it, further EEH errors occur.

This patch adds code to pci_save_state() to properly save/restore the
pcie registers. Making this change in the PCI code prevents the
individual drivers from each having to implement a workaround.

This patch was tested by IBM developers and shown to resolve the issues
in both bz470580 and bz470582.

RHEL Version Found:
================
RHEL 5.3

kABI Status:
============
No symbols were harmed.

Brew:
=====
Built on all platforms.
https://brewweb.devel.redhat.com/taskinfo?taskID=1577345

Upstream Status:
================
These patches are not needed upstream, because the upstream kernel
does not need the calls to {save|restore}_pcie_reg to restore all of the
registers.

Test Status:
============
Without this patch, not all of the registers will be correctly restored
after an EEH event. This can leave various network adapters in an
unreliable state after EEH. IBM developers have tested this patch, and they
verified that the drivers recover properly from an EEH event with the patch
applied.

===============================================================

Jesse Larrew
IBM Onsite Partner
978-392-3183
jlarrew@redhat.com

Proposed Patch:
===============
This patch is based on kernel 2.6.18-123.el5

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 2e7bc75..efcdb65 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -565,6 +565,8 @@ int
 pci_save_state(struct pci_dev *dev)
 {
 	int i;
+
+	save_pcie_reg(dev);
 	/* XXX: 100% dword access ok here? */
 	for (i = 0; i < 16; i++)
 		pci_read_config_dword(dev, i * 4,&dev->saved_config_space[i]);
@@ -600,6 +602,7 @@ pci_restore_state(struct pci_dev *dev)
 				dev->saved_config_space[i]);
 		}
 	}
+	restore_pcie_reg(dev);
 	pci_restore_msi_state(dev);
 	pci_restore_msix_state(dev);
 	return 0;