aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2006-10-02 15:00:49 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-10-03 18:29:06 -0400
commit07db51831371f2875ef234b1535a15afdb381b6c (patch)
tree49cfa4348769b6b2eccda29bb176173a45157dca /drivers/scsi
parentbb8ee4998498e15b5c8ed94cd7dd8d07e586c0ab (diff)
[SCSI] qla2xxx: Stall mid-layer error handlers while rport is blocked.
Stall error handler if attempting recovery while an rport is blocked. This avoids device offline scenarios due to errors in the error handler. Reference implementation from lpfc/mptfc. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index cdc7fca421bf..3ba8c239f171 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -589,6 +589,23 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
589 return (return_status); 589 return (return_status);
590} 590}
591 591
592static void
593qla2x00_block_error_handler(struct scsi_cmnd *cmnd)
594{
595 struct Scsi_Host *shost = cmnd->device->host;
596 struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device));
597 unsigned long flags;
598
599 spin_lock_irqsave(shost->host_lock, flags);
600 while (rport->port_state == FC_PORTSTATE_BLOCKED) {
601 spin_unlock_irqrestore(shost->host_lock, flags);
602 msleep(1000);
603 spin_lock_irqsave(shost->host_lock, flags);
604 }
605 spin_unlock_irqrestore(shost->host_lock, flags);
606 return;
607}
608
592/************************************************************************** 609/**************************************************************************
593* qla2xxx_eh_abort 610* qla2xxx_eh_abort
594* 611*
@@ -615,6 +632,8 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
615 unsigned long flags; 632 unsigned long flags;
616 int wait = 0; 633 int wait = 0;
617 634
635 qla2x00_block_error_handler(cmd);
636
618 if (!CMD_SP(cmd)) 637 if (!CMD_SP(cmd))
619 return SUCCESS; 638 return SUCCESS;
620 639
@@ -748,6 +767,8 @@ qla2xxx_eh_device_reset(struct scsi_cmnd *cmd)
748 unsigned int id, lun; 767 unsigned int id, lun;
749 unsigned long serial; 768 unsigned long serial;
750 769
770 qla2x00_block_error_handler(cmd);
771
751 ret = FAILED; 772 ret = FAILED;
752 773
753 id = cmd->device->id; 774 id = cmd->device->id;
@@ -877,6 +898,8 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd)
877 unsigned int id, lun; 898 unsigned int id, lun;
878 unsigned long serial; 899 unsigned long serial;
879 900
901 qla2x00_block_error_handler(cmd);
902
880 ret = FAILED; 903 ret = FAILED;
881 904
882 id = cmd->device->id; 905 id = cmd->device->id;
@@ -936,6 +959,8 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
936 unsigned int id, lun; 959 unsigned int id, lun;
937 unsigned long serial; 960 unsigned long serial;
938 961
962 qla2x00_block_error_handler(cmd);
963
939 ret = FAILED; 964 ret = FAILED;
940 965
941 id = cmd->device->id; 966 id = cmd->device->id;