summaryrefslogtreecommitdiff
path: root/drivers/scsi/ipr.c
diff options
context:
space:
mode:
authorBrian King <brking@us.ibm.com>2006-11-21 19:27:58 +0300
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-11-22 21:17:55 +0300
commit73d98ff0fa8d9074792b7273f57d9f92810104c6 (patch)
tree48d63bd93823cb631d1d7c9ba1cbb16b9bb5c2e6 /drivers/scsi/ipr.c
parent7feb6b3fbb48ceaceb7a66a9784106abef48e454 (diff)
downloadlinux-73d98ff0fa8d9074792b7273f57d9f92810104c6.tar.xz
[SCSI] ipr: SATA reset - wait for host reset completion
If an ipr adapter hits a fatal microcode error requiring a reset while a SATA device is going through EH, it can result in a command getting issued to the ipr adapter while it is getting reset, which can cause PCI bus errors. Wait for any outstanding adapter reset to finish prior to issuing a SATA device reset. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/ipr.c')
-rw-r--r--drivers/scsi/ipr.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 2dde821025f3..c983f0f07584 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -3573,6 +3573,12 @@ static int ipr_sata_reset(struct ata_port *ap, unsigned int *classes)
ENTER;
spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
+ while(ioa_cfg->in_reset_reload) {
+ spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
+ wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
+ spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
+ }
+
res = sata_port->res;
if (res) {
rc = ipr_device_reset(ioa_cfg, res);
@@ -4776,6 +4782,12 @@ static void ipr_ata_post_internal(struct ata_queued_cmd *qc)
unsigned long flags;
spin_lock_irqsave(ioa_cfg->host->host_lock, flags);
+ while(ioa_cfg->in_reset_reload) {
+ spin_unlock_irqrestore(ioa_cfg->host->host_lock, flags);
+ wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload);
+ spin_lock_irqsave(ioa_cfg->host->host_lock, flags);
+ }
+
list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) {
if (ipr_cmd->qc == qc) {
ipr_device_reset(ioa_cfg, sata_port->res);