aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorJames.Smart@Emulex.Com <James.Smart@Emulex.Com>2005-11-28 11:41:53 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2005-12-13 20:20:22 -0500
commit63c59c3b8ff444b771a245f59935c0202ece963b (patch)
treeeccb686ade63b3c8997f6dd797caca81a2740608 /drivers/scsi
parent23dc04f1ec0d2f8fdda82ad1f9aa87b6ed74cd4a (diff)
[SCSI] lpfc 8.1.1 : Remove locking wrappers around error handlers
Remove locking wrappers around error handlers. Wrappers were added in early 2.6.13 api change Signed-off-by: James Smart <James.Smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c52
1 files changed, 14 insertions, 38 deletions
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 0aa5ca68433f..a4d8455de446 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -760,11 +760,12 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))
760 return 0; 760 return 0;
761} 761}
762 762
763
763static int 764static int
764__lpfc_abort_handler(struct scsi_cmnd *cmnd) 765lpfc_abort_handler(struct scsi_cmnd *cmnd)
765{ 766{
766 struct lpfc_hba *phba = 767 struct Scsi_Host *shost = cmnd->device->host;
767 (struct lpfc_hba *)cmnd->device->host->hostdata[0]; 768 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0];
768 struct lpfc_sli_ring *pring = &phba->sli.ring[phba->sli.fcp_ring]; 769 struct lpfc_sli_ring *pring = &phba->sli.ring[phba->sli.fcp_ring];
769 struct lpfc_iocbq *iocb; 770 struct lpfc_iocbq *iocb;
770 struct lpfc_iocbq *abtsiocb; 771 struct lpfc_iocbq *abtsiocb;
@@ -773,6 +774,7 @@ __lpfc_abort_handler(struct scsi_cmnd *cmnd)
773 unsigned int loop_count = 0; 774 unsigned int loop_count = 0;
774 int ret = SUCCESS; 775 int ret = SUCCESS;
775 776
777 spin_lock_irq(shost->host_lock);
776 778
777 lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble; 779 lpfc_cmd = (struct lpfc_scsi_buf *)cmnd->host_scribble;
778 BUG_ON(!lpfc_cmd); 780 BUG_ON(!lpfc_cmd);
@@ -850,21 +852,13 @@ __lpfc_abort_handler(struct scsi_cmnd *cmnd)
850 phba->brd_no, ret, cmnd->device->id, 852 phba->brd_no, ret, cmnd->device->id,
851 cmnd->device->lun, cmnd->serial_number); 853 cmnd->device->lun, cmnd->serial_number);
852 854
853 return ret; 855 spin_unlock_irq(shost->host_lock);
854}
855 856
856static int 857 return ret;
857lpfc_abort_handler(struct scsi_cmnd *cmnd)
858{
859 int rc;
860 spin_lock_irq(cmnd->device->host->host_lock);
861 rc = __lpfc_abort_handler(cmnd);
862 spin_unlock_irq(cmnd->device->host->host_lock);
863 return rc;
864} 858}
865 859
866static int 860static int
867__lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) 861lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
868{ 862{
869 struct Scsi_Host *shost = cmnd->device->host; 863 struct Scsi_Host *shost = cmnd->device->host;
870 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; 864 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0];
@@ -875,6 +869,7 @@ __lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
875 int ret = FAILED; 869 int ret = FAILED;
876 int cnt, loopcnt; 870 int cnt, loopcnt;
877 871
872 spin_lock_irq(shost->host_lock);
878 /* 873 /*
879 * If target is not in a MAPPED state, delay the reset until 874 * If target is not in a MAPPED state, delay the reset until
880 * target is rediscovered or nodev timeout expires. 875 * target is rediscovered or nodev timeout expires.
@@ -964,24 +959,12 @@ out_free_scsi_buf:
964 lpfc_cmd->result); 959 lpfc_cmd->result);
965 lpfc_release_scsi_buf(phba, lpfc_cmd); 960 lpfc_release_scsi_buf(phba, lpfc_cmd);
966out: 961out:
962 spin_unlock_irq(shost->host_lock);
967 return ret; 963 return ret;
968} 964}
969 965
970static int 966static int
971lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) 967lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
972{
973 int rc;
974 spin_lock_irq(cmnd->device->host->host_lock);
975 rc = __lpfc_reset_lun_handler(cmnd);
976 spin_unlock_irq(cmnd->device->host->host_lock);
977 return rc;
978}
979
980/*
981 * Note: midlayer calls this function with the host_lock held
982 */
983static int
984__lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
985{ 968{
986 struct Scsi_Host *shost = cmnd->device->host; 969 struct Scsi_Host *shost = cmnd->device->host;
987 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0]; 970 struct lpfc_hba *phba = (struct lpfc_hba *)shost->hostdata[0];
@@ -992,6 +975,8 @@ __lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
992 unsigned int midlayer_id = 0; 975 unsigned int midlayer_id = 0;
993 struct lpfc_scsi_buf * lpfc_cmd; 976 struct lpfc_scsi_buf * lpfc_cmd;
994 977
978 spin_lock_irq(shost->host_lock);
979
995 lpfc_cmd = lpfc_sli_get_scsi_buf (phba); 980 lpfc_cmd = lpfc_sli_get_scsi_buf (phba);
996 if (lpfc_cmd == NULL) 981 if (lpfc_cmd == NULL)
997 goto out; 982 goto out;
@@ -1067,20 +1052,11 @@ __lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
1067 "%d:0714 SCSI layer issued Bus Reset Data: x%x\n", 1052 "%d:0714 SCSI layer issued Bus Reset Data: x%x\n",
1068 phba->brd_no, ret); 1053 phba->brd_no, ret);
1069out: 1054out:
1055 spin_unlock_irq(shost->host_lock);
1070 return ret; 1056 return ret;
1071} 1057}
1072 1058
1073static int 1059static int
1074lpfc_reset_bus_handler(struct scsi_cmnd *cmnd)
1075{
1076 int rc;
1077 spin_lock_irq(cmnd->device->host->host_lock);
1078 rc = __lpfc_reset_bus_handler(cmnd);
1079 spin_unlock_irq(cmnd->device->host->host_lock);
1080 return rc;
1081}
1082
1083static int
1084lpfc_slave_alloc(struct scsi_device *sdev) 1060lpfc_slave_alloc(struct scsi_device *sdev)
1085{ 1061{
1086 struct lpfc_hba *phba = (struct lpfc_hba *)sdev->host->hostdata[0]; 1062 struct lpfc_hba *phba = (struct lpfc_hba *)sdev->host->hostdata[0];