]> git.baikalelectronics.ru Git - kernel.git/commit
[SCSI] ipr: fix EEH recovery
authorKleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Wed, 25 Nov 2009 22:13:43 +0000 (20:13 -0200)
committerJames Bottomley <James.Bottomley@suse.de>
Thu, 10 Dec 2009 15:45:55 +0000 (09:45 -0600)
commitaa13d92763155435960d7d6e5212b4c1cdf4ba80
treefbbda78c9da3021843fab102bd7a55bf39262c78
parent818220ce089dbd15946350ad3a7bdf68dcf80dfb
[SCSI] ipr: fix EEH recovery

After commits cc3d40f51e5014a2c07de6576bf7b58db0a26b21 (PCI: check saved
state before restore) and 8bd8f8fda3319a3fb51224f0f21147e04060d25d (PCI:
Clear saved_state after the state has been restored) PCI drivers are
prevented from restoring the device standard configuration registers
twice in a row. These changes introduced a regression on ipr EEH
recovery.

The ipr device driver saves the PCI state only during the device probe
and restores it on ipr_reset_restore_cfg_space() during IOA resets. This
behavior is causing the EEH recovery to fail after the second error
detected, since the registers are not being restored.

One possible solution would be saving the registers after restoring
them. The problem with this approach is that while recovering from an
EEH error if pci_save_state() results in an EEH error, the adapter/slot
will be reset, and end up back in ipr_reset_restore_cfg_space(), but it
won't have a valid saved state to restore, so pci_restore_state() will
fail.

The following patch introduces a workaround for this problem, hacking
around the PCI API by setting pdev->state_saved = true before we do the
restore. It fixes the EEH regression and prevents that we hit another
EEH error during EEH recovery.

[jejb: fix is a hack ... Jesse and Rafael will fix properly]
Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/scsi/ipr.c