* [PATCH] ipr: fix EEH recovery
@ 2009-11-25 22:13 Kleber Sacilotto de Souza
2009-11-27 1:46 ` Brian King
0 siblings, 1 reply; 3+ messages in thread
From: Kleber Sacilotto de Souza @ 2009-11-25 22:13 UTC (permalink / raw)
To: linux-scsi@vger.kernel.org; +Cc: Brian King, Wayne Boyer
Hi,
After commits c82f63e411f1b58427c103bd95af2863b1c96dd1 (PCI: check saved
state before restore) and 4b77b0a2ba27d64f58f16d8d4d48d8319dda36ff (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.
Thanks,
Kleber
Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
---
drivers/scsi/ipr.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 76d294f..c3ff9a6 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -6516,6 +6516,7 @@ static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd)
int rc;
ENTER;
+ ioa_cfg->pdev->state_saved = true;
rc = pci_restore_state(ioa_cfg->pdev);
if (rc != PCIBIOS_SUCCESSFUL) {
--
--
Kleber S. Souza
IBM Linux Technology Center
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ipr: fix EEH recovery
2009-11-25 22:13 [PATCH] ipr: fix EEH recovery Kleber Sacilotto de Souza
@ 2009-11-27 1:46 ` Brian King
2009-11-27 12:58 ` Kleber Sacilotto de Souza
0 siblings, 1 reply; 3+ messages in thread
From: Brian King @ 2009-11-27 1:46 UTC (permalink / raw)
To: Kleber Sacilotto de Souza; +Cc: linux-scsi@vger.kernel.org, Wayne Boyer
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Kleber Sacilotto de Souza wrote:
> Hi,
>
> After commits c82f63e411f1b58427c103bd95af2863b1c96dd1 (PCI: check saved
> state before restore) and 4b77b0a2ba27d64f58f16d8d4d48d8319dda36ff (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.
>
>
> Thanks,
> Kleber
>
>
>
> Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
> ---
> drivers/scsi/ipr.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> index 76d294f..c3ff9a6 100644
> --- a/drivers/scsi/ipr.c
> +++ b/drivers/scsi/ipr.c
> @@ -6516,6 +6516,7 @@ static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd)
> int rc;
>
> ENTER;
> + ioa_cfg->pdev->state_saved = true;
> rc = pci_restore_state(ioa_cfg->pdev);
>
> if (rc != PCIBIOS_SUCCESSFUL) {
--
Brian King
Linux on Power Virtualization
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ipr: fix EEH recovery
2009-11-27 1:46 ` Brian King
@ 2009-11-27 12:58 ` Kleber Sacilotto de Souza
0 siblings, 0 replies; 3+ messages in thread
From: Kleber Sacilotto de Souza @ 2009-11-27 12:58 UTC (permalink / raw)
To: linux-scsi@vger.kernel.org; +Cc: Brian King, Wayne Boyer
On Thu, 2009-11-26 at 19:46 -0600, Brian King wrote:
> Acked-by: Brian King <brking@linux.vnet.ibm.com>
>
> >
> > Signed-off-by: Kleber Sacilotto de Souza <klebers@linux.vnet.ibm.com>
> > ---
> > drivers/scsi/ipr.c | 1 +
> > 1 files changed, 1 insertions(+), 0 deletions(-)
> >
> > diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
> > index 76d294f..c3ff9a6 100644
> > --- a/drivers/scsi/ipr.c
> > +++ b/drivers/scsi/ipr.c
> > @@ -6516,6 +6516,7 @@ static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd)
> > int rc;
> >
> > ENTER;
> > + ioa_cfg->pdev->state_saved = true;
> > rc = pci_restore_state(ioa_cfg->pdev);
> >
> > if (rc != PCIBIOS_SUCCESSFUL) {
>
>
Since this is a regression, is there any chance to have this patch
applied and merged for 2.6.32?
Thanks,
--
Kleber S. Souza
IBM Linux Technology Center
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-11-27 12:58 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-25 22:13 [PATCH] ipr: fix EEH recovery Kleber Sacilotto de Souza
2009-11-27 1:46 ` Brian King
2009-11-27 12:58 ` Kleber Sacilotto de Souza
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox