aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/fc4/fc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/fc4/fc.c')
-rw-r--r--drivers/fc4/fc.c32
1 files changed, 17 insertions, 15 deletions
diff --git a/drivers/fc4/fc.c b/drivers/fc4/fc.c
index 1fbb219aa9ba..e3c958823533 100644
--- a/drivers/fc4/fc.c
+++ b/drivers/fc4/fc.c
@@ -765,12 +765,8 @@ void fcp_release(fc_channel *fcchain, int count) /* count must > 0 */
765 765
766static void fcp_scsi_done (Scsi_Cmnd *SCpnt) 766static void fcp_scsi_done (Scsi_Cmnd *SCpnt)
767{ 767{
768 unsigned long flags;
769
770 spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
771 if (FCP_CMND(SCpnt)->done) 768 if (FCP_CMND(SCpnt)->done)
772 FCP_CMND(SCpnt)->done(SCpnt); 769 FCP_CMND(SCpnt)->done(SCpnt);
773 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
774} 770}
775 771
776static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, int prepare) 772static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, int prepare)
@@ -909,12 +905,8 @@ int fcp_scsi_abort(Scsi_Cmnd *SCpnt)
909 */ 905 */
910 906
911 if (++fc->abort_count < (fc->can_queue >> 1)) { 907 if (++fc->abort_count < (fc->can_queue >> 1)) {
912 unsigned long flags;
913
914 SCpnt->result = DID_ABORT; 908 SCpnt->result = DID_ABORT;
915 spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
916 fcmd->done(SCpnt); 909 fcmd->done(SCpnt);
917 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
918 printk("FC: soft abort\n"); 910 printk("FC: soft abort\n");
919 return SUCCESS; 911 return SUCCESS;
920 } else { 912 } else {
@@ -935,6 +927,7 @@ void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt)
935 927
936int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt) 928int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
937{ 929{
930 unsigned long flags;
938 fcp_cmd *cmd; 931 fcp_cmd *cmd;
939 fcp_cmnd *fcmd; 932 fcp_cmnd *fcmd;
940 fc_channel *fc = FC_SCMND(SCpnt); 933 fc_channel *fc = FC_SCMND(SCpnt);
@@ -987,7 +980,10 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
987 fc->rst_pkt->request->rq_status = RQ_SCSI_BUSY; 980 fc->rst_pkt->request->rq_status = RQ_SCSI_BUSY;
988 981
989 fc->rst_pkt->done = fcp_scsi_reset_done; 982 fc->rst_pkt->done = fcp_scsi_reset_done;
983
984 spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
990 fcp_scsi_queue_it(fc, fc->rst_pkt, fcmd, 0); 985 fcp_scsi_queue_it(fc, fc->rst_pkt, fcmd, 0);
986 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
991 987
992 down(&sem); 988 down(&sem);
993 989
@@ -1006,13 +1002,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
1006 return SUCCESS; 1002 return SUCCESS;
1007} 1003}
1008 1004
1009int fcp_scsi_bus_reset(Scsi_Cmnd *SCpnt) 1005static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
1010{
1011 printk ("FC: bus reset!\n");
1012 return FAILED;
1013}
1014
1015int fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
1016{ 1006{
1017 fc_channel *fc = FC_SCMND(SCpnt); 1007 fc_channel *fc = FC_SCMND(SCpnt);
1018 fcp_cmnd *fcmd = FCP_CMND(SCpnt); 1008 fcp_cmnd *fcmd = FCP_CMND(SCpnt);
@@ -1033,6 +1023,18 @@ int fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
1033 else return FAILED; 1023 else return FAILED;
1034} 1024}
1035 1025
1026int fcp_scsi_host_reset(Scsi_Cmnd *SCpnt)
1027{
1028 unsigned long flags;
1029 int rc;
1030
1031 spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
1032 rc = __fcp_scsi_host_reset(SCpnt);
1033 spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
1034
1035 return rc;
1036}
1037
1036static int fcp_els_queue_it(fc_channel *fc, fcp_cmnd *fcmd) 1038static int fcp_els_queue_it(fc_channel *fc, fcp_cmnd *fcmd)
1037{ 1039{
1038 long i; 1040 long i;