diff options
author | Christof Schmitt <christof.schmitt@de.ibm.com> | 2009-10-30 12:59:29 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-04 13:00:52 -0500 |
commit | 65d430fa99cbd0e88d09a3343f697c51fc8a7009 (patch) | |
tree | d0e7f7353bb227ff7585ff77cc682611acd1680b /drivers/scsi/qla2xxx | |
parent | 03b147083a2f9a2a3fbbd2505fa88ffa3c6ab194 (diff) |
[SCSI] scsi_transport_fc: Introduce helper function for blocking scsi_eh
Move the duplicated code from FC LLDs to SCSI FC transport class.
Acked-by: James Smart <james.smart@emulex.com>
Acked-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Acked-by: Abhijeet Joglekar <abjoglek@cisco.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index d69744a62fe4..41669357b186 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -728,23 +728,6 @@ qla2x00_abort_fcport_cmds(fc_port_t *fcport) | |||
728 | spin_unlock_irqrestore(&ha->hardware_lock, flags); | 728 | spin_unlock_irqrestore(&ha->hardware_lock, flags); |
729 | } | 729 | } |
730 | 730 | ||
731 | static void | ||
732 | qla2x00_block_error_handler(struct scsi_cmnd *cmnd) | ||
733 | { | ||
734 | struct Scsi_Host *shost = cmnd->device->host; | ||
735 | struct fc_rport *rport = starget_to_rport(scsi_target(cmnd->device)); | ||
736 | unsigned long flags; | ||
737 | |||
738 | spin_lock_irqsave(shost->host_lock, flags); | ||
739 | while (rport->port_state == FC_PORTSTATE_BLOCKED) { | ||
740 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
741 | msleep(1000); | ||
742 | spin_lock_irqsave(shost->host_lock, flags); | ||
743 | } | ||
744 | spin_unlock_irqrestore(shost->host_lock, flags); | ||
745 | return; | ||
746 | } | ||
747 | |||
748 | /************************************************************************** | 731 | /************************************************************************** |
749 | * qla2xxx_eh_abort | 732 | * qla2xxx_eh_abort |
750 | * | 733 | * |
@@ -774,7 +757,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd) | |||
774 | struct req_que *req = vha->req; | 757 | struct req_que *req = vha->req; |
775 | srb_t *spt; | 758 | srb_t *spt; |
776 | 759 | ||
777 | qla2x00_block_error_handler(cmd); | 760 | fc_block_scsi_eh(cmd); |
778 | 761 | ||
779 | if (!CMD_SP(cmd)) | 762 | if (!CMD_SP(cmd)) |
780 | return SUCCESS; | 763 | return SUCCESS; |
@@ -905,7 +888,7 @@ __qla2xxx_eh_generic_reset(char *name, enum nexus_wait_type type, | |||
905 | fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; | 888 | fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata; |
906 | int err; | 889 | int err; |
907 | 890 | ||
908 | qla2x00_block_error_handler(cmd); | 891 | fc_block_scsi_eh(cmd); |
909 | 892 | ||
910 | if (!fcport) | 893 | if (!fcport) |
911 | return FAILED; | 894 | return FAILED; |
@@ -985,7 +968,7 @@ qla2xxx_eh_bus_reset(struct scsi_cmnd *cmd) | |||
985 | unsigned long serial; | 968 | unsigned long serial; |
986 | srb_t *sp = (srb_t *) CMD_SP(cmd); | 969 | srb_t *sp = (srb_t *) CMD_SP(cmd); |
987 | 970 | ||
988 | qla2x00_block_error_handler(cmd); | 971 | fc_block_scsi_eh(cmd); |
989 | 972 | ||
990 | id = cmd->device->id; | 973 | id = cmd->device->id; |
991 | lun = cmd->device->lun; | 974 | lun = cmd->device->lun; |
@@ -1048,7 +1031,7 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd) | |||
1048 | srb_t *sp = (srb_t *) CMD_SP(cmd); | 1031 | srb_t *sp = (srb_t *) CMD_SP(cmd); |
1049 | scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev); | 1032 | scsi_qla_host_t *base_vha = pci_get_drvdata(ha->pdev); |
1050 | 1033 | ||
1051 | qla2x00_block_error_handler(cmd); | 1034 | fc_block_scsi_eh(cmd); |
1052 | 1035 | ||
1053 | id = cmd->device->id; | 1036 | id = cmd->device->id; |
1054 | lun = cmd->device->lun; | 1037 | lun = cmd->device->lun; |