diff options
author | Brian King <brking@us.ibm.com> | 2006-11-21 11:27:58 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-11-22 13:17:55 -0500 |
commit | 73d98ff0fa8d9074792b7273f57d9f92810104c6 (patch) | |
tree | 48d63bd93823cb631d1d7c9ba1cbb16b9bb5c2e6 | |
parent | 7feb6b3fbb48ceaceb7a66a9784106abef48e454 (diff) |
[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>
-rw-r--r-- | drivers/scsi/ipr.c | 12 |
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) | |||
3573 | 3573 | ||
3574 | ENTER; | 3574 | ENTER; |
3575 | spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); | 3575 | spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); |
3576 | while(ioa_cfg->in_reset_reload) { | ||
3577 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); | ||
3578 | wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload); | ||
3579 | spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags); | ||
3580 | } | ||
3581 | |||
3576 | res = sata_port->res; | 3582 | res = sata_port->res; |
3577 | if (res) { | 3583 | if (res) { |
3578 | rc = ipr_device_reset(ioa_cfg, res); | 3584 | rc = ipr_device_reset(ioa_cfg, res); |
@@ -4776,6 +4782,12 @@ static void ipr_ata_post_internal(struct ata_queued_cmd *qc) | |||
4776 | unsigned long flags; | 4782 | unsigned long flags; |
4777 | 4783 | ||
4778 | spin_lock_irqsave(ioa_cfg->host->host_lock, flags); | 4784 | spin_lock_irqsave(ioa_cfg->host->host_lock, flags); |
4785 | while(ioa_cfg->in_reset_reload) { | ||
4786 | spin_unlock_irqrestore(ioa_cfg->host->host_lock, flags); | ||
4787 | wait_event(ioa_cfg->reset_wait_q, !ioa_cfg->in_reset_reload); | ||
4788 | spin_lock_irqsave(ioa_cfg->host->host_lock, flags); | ||
4789 | } | ||
4790 | |||
4779 | list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) { | 4791 | list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) { |
4780 | if (ipr_cmd->qc == qc) { | 4792 | if (ipr_cmd->qc == qc) { |
4781 | ipr_device_reset(ioa_cfg, sata_port->res); | 4793 | ipr_device_reset(ioa_cfg, sata_port->res); |