aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-05-28 07:54:40 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-06-17 13:04:55 -0400
commit8fa728a26886f56a9ee10a44fea0ddda301d21c3 (patch)
tree105ead5c90057400abae0c8aa9e2b5ba1818c327 /drivers
parent3471c288036bf0835a82d0b1bbce2002f6e68390 (diff)
[SCSI] allow sleeping in ->eh_abort_handler()
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/message/fusion/mptscsih.c5
-rw-r--r--drivers/s390/scsi/zfcp_scsi.c13
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.c8
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.c4
-rw-r--r--drivers/scsi/aic7xxx_old.c15
-rw-r--r--drivers/scsi/ibmmca.c14
-rw-r--r--drivers/scsi/ibmvscsi/ibmvscsi.c2
-rw-r--r--drivers/scsi/in2000.c12
-rw-r--r--drivers/scsi/ipr.c24
-rw-r--r--drivers/scsi/ips.c7
-rw-r--r--drivers/scsi/lpfc/lpfc_scsi.c12
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.c17
-rw-r--r--drivers/scsi/qla1280.c8
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c2
-rw-r--r--drivers/scsi/scsi_error.c13
-rw-r--r--drivers/scsi/sym53c8xx_2/sym_glue.c8
-rw-r--r--drivers/scsi/ultrastor.c2
-rw-r--r--drivers/usb/storage/scsiglue.c2
18 files changed, 121 insertions, 47 deletions
diff --git a/drivers/message/fusion/mptscsih.c b/drivers/message/fusion/mptscsih.c
index c8492034cfe7..6a5851c51a21 100644
--- a/drivers/message/fusion/mptscsih.c
+++ b/drivers/message/fusion/mptscsih.c
@@ -1707,7 +1707,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1707 MPT_FRAME_HDR *mf; 1707 MPT_FRAME_HDR *mf;
1708 u32 ctx2abort; 1708 u32 ctx2abort;
1709 int scpnt_idx; 1709 int scpnt_idx;
1710 spinlock_t *host_lock = SCpnt->device->host->host_lock;
1711 1710
1712 /* If we can't locate our host adapter structure, return FAILED status. 1711 /* If we can't locate our host adapter structure, return FAILED status.
1713 */ 1712 */
@@ -1755,7 +1754,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1755 1754
1756 hd->abortSCpnt = SCpnt; 1755 hd->abortSCpnt = SCpnt;
1757 1756
1758 spin_unlock_irq(host_lock);
1759 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK, 1757 if (mptscsih_TMHandler(hd, MPI_SCSITASKMGMT_TASKTYPE_ABORT_TASK,
1760 SCpnt->device->channel, SCpnt->device->id, SCpnt->device->lun, 1758 SCpnt->device->channel, SCpnt->device->id, SCpnt->device->lun,
1761 ctx2abort, 2 /* 2 second timeout */) 1759 ctx2abort, 2 /* 2 second timeout */)
@@ -1772,8 +1770,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1772 hd->tmPending = 0; 1770 hd->tmPending = 0;
1773 hd->tmState = TM_STATE_NONE; 1771 hd->tmState = TM_STATE_NONE;
1774 1772
1775 spin_lock_irq(host_lock);
1776
1777 /* Unmap the DMA buffers, if any. */ 1773 /* Unmap the DMA buffers, if any. */
1778 if (SCpnt->use_sg) { 1774 if (SCpnt->use_sg) {
1779 pci_unmap_sg(ioc->pcidev, (struct scatterlist *) SCpnt->request_buffer, 1775 pci_unmap_sg(ioc->pcidev, (struct scatterlist *) SCpnt->request_buffer,
@@ -1789,7 +1785,6 @@ mptscsih_abort(struct scsi_cmnd * SCpnt)
1789 mpt_free_msg_frame(ioc, mf); 1785 mpt_free_msg_frame(ioc, mf);
1790 return FAILED; 1786 return FAILED;
1791 } 1787 }
1792 spin_lock_irq(host_lock);
1793 return SUCCESS; 1788 return SUCCESS;
1794} 1789}
1795 1790
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c
index c6f69fc475a2..6e4447598495 100644
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -433,7 +433,7 @@ zfcp_port_lookup(struct zfcp_adapter *adapter, int channel, scsi_id_t id)
433 * FAILED - otherwise 433 * FAILED - otherwise
434 */ 434 */
435int 435int
436zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) 436__zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
437{ 437{
438 int retval = SUCCESS; 438 int retval = SUCCESS;
439 struct zfcp_fsf_req *new_fsf_req, *old_fsf_req; 439 struct zfcp_fsf_req *new_fsf_req, *old_fsf_req;
@@ -611,6 +611,17 @@ zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
611 return retval; 611 return retval;
612} 612}
613 613
614int
615zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt)
616{
617 int rc;
618 struct Scsi_Host *scsi_host = scpnt->device->host;
619 spin_lock_irq(scsi_host->host_lock);
620 rc = __zfcp_scsi_eh_abort_handler(scpnt);
621 spin_unlock_irq(scsi_host->host_lock);
622 return rc;
623}
624
614/* 625/*
615 * function: zfcp_scsi_eh_device_reset_handler 626 * function: zfcp_scsi_eh_device_reset_handler
616 * 627 *
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 550c9921691a..7fc6c76e519b 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -941,7 +941,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
941 */ 941 */
942 cmd->scsi_done = scsi_done; 942 cmd->scsi_done = scsi_done;
943 943
944 ahd_midlayer_entrypoint_lock(ahd, &flags); 944 ahd_lock(ahd, &flags);
945 945
946 /* 946 /*
947 * Close the race of a command that was in the process of 947 * Close the race of a command that was in the process of
@@ -955,7 +955,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
955 ahd_cmd_set_transaction_status(cmd, CAM_REQUEUE_REQ); 955 ahd_cmd_set_transaction_status(cmd, CAM_REQUEUE_REQ);
956 ahd_linux_queue_cmd_complete(ahd, cmd); 956 ahd_linux_queue_cmd_complete(ahd, cmd);
957 ahd_schedule_completeq(ahd); 957 ahd_schedule_completeq(ahd);
958 ahd_midlayer_entrypoint_unlock(ahd, &flags); 958 ahd_unlock(ahd, &flags);
959 return (0); 959 return (0);
960 } 960 }
961 dev = ahd_linux_get_device(ahd, cmd->device->channel, 961 dev = ahd_linux_get_device(ahd, cmd->device->channel,
@@ -965,7 +965,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
965 ahd_cmd_set_transaction_status(cmd, CAM_RESRC_UNAVAIL); 965 ahd_cmd_set_transaction_status(cmd, CAM_RESRC_UNAVAIL);
966 ahd_linux_queue_cmd_complete(ahd, cmd); 966 ahd_linux_queue_cmd_complete(ahd, cmd);
967 ahd_schedule_completeq(ahd); 967 ahd_schedule_completeq(ahd);
968 ahd_midlayer_entrypoint_unlock(ahd, &flags); 968 ahd_unlock(ahd, &flags);
969 printf("%s: aic79xx_linux_queue - Unable to allocate device!\n", 969 printf("%s: aic79xx_linux_queue - Unable to allocate device!\n",
970 ahd_name(ahd)); 970 ahd_name(ahd));
971 return (0); 971 return (0);
@@ -979,7 +979,7 @@ ahd_linux_queue(Scsi_Cmnd * cmd, void (*scsi_done) (Scsi_Cmnd *))
979 dev->flags |= AHD_DEV_ON_RUN_LIST; 979 dev->flags |= AHD_DEV_ON_RUN_LIST;
980 ahd_linux_run_device_queues(ahd); 980 ahd_linux_run_device_queues(ahd);
981 } 981 }
982 ahd_midlayer_entrypoint_unlock(ahd, &flags); 982 ahd_unlock(ahd, &flags);
983 return (0); 983 return (0);
984} 984}
985 985
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index e3892585d7e6..89f073a3b766 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -2249,6 +2249,8 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2249 printf(" 0x%x", cmd->cmnd[cdb_byte]); 2249 printf(" 0x%x", cmd->cmnd[cdb_byte]);
2250 printf("\n"); 2250 printf("\n");
2251 2251
2252 spin_lock_irq(&ahc->platform_data->spin_lock);
2253
2252 /* 2254 /*
2253 * First determine if we currently own this command. 2255 * First determine if we currently own this command.
2254 * Start by searching the device queue. If not found 2256 * Start by searching the device queue. If not found
@@ -2503,6 +2505,8 @@ done:
2503 } 2505 }
2504 spin_lock_irq(&ahc->platform_data->spin_lock); 2506 spin_lock_irq(&ahc->platform_data->spin_lock);
2505 } 2507 }
2508
2509 spin_unlock_irq(&ahc->platform_data->spin_lock);
2506 return (retval); 2510 return (retval);
2507} 2511}
2508 2512
diff --git a/drivers/scsi/aic7xxx_old.c b/drivers/scsi/aic7xxx_old.c
index 9e9d0c40187e..ee127e8aea55 100644
--- a/drivers/scsi/aic7xxx_old.c
+++ b/drivers/scsi/aic7xxx_old.c
@@ -10585,7 +10585,7 @@ aic7xxx_panic_abort(struct aic7xxx_host *p, Scsi_Cmnd *cmd)
10585 * Abort the current SCSI command(s). 10585 * Abort the current SCSI command(s).
10586 *-F*************************************************************************/ 10586 *-F*************************************************************************/
10587static int 10587static int
10588aic7xxx_abort(Scsi_Cmnd *cmd) 10588__aic7xxx_abort(Scsi_Cmnd *cmd)
10589{ 10589{
10590 struct aic7xxx_scb *scb = NULL; 10590 struct aic7xxx_scb *scb = NULL;
10591 struct aic7xxx_host *p; 10591 struct aic7xxx_host *p;
@@ -10802,6 +10802,19 @@ success:
10802 return SUCCESS; 10802 return SUCCESS;
10803} 10803}
10804 10804
10805static int
10806aic7xxx_abort(Scsi_Cmnd *cmd)
10807{
10808 int rc;
10809
10810 spin_lock_irq(cmd->device->host->host_lock);
10811 rc = __aic7xxx_abort(cmd);
10812 spin_unlock_irq(cmd->device->host->host_lock);
10813
10814 return rc;
10815}
10816
10817
10805/*+F************************************************************************* 10818/*+F*************************************************************************
10806 * Function: 10819 * Function:
10807 * aic7xxx_reset 10820 * aic7xxx_reset
diff --git a/drivers/scsi/ibmmca.c b/drivers/scsi/ibmmca.c
index a3fdead9bce9..0018fb5c09a9 100644
--- a/drivers/scsi/ibmmca.c
+++ b/drivers/scsi/ibmmca.c
@@ -2118,7 +2118,7 @@ static int ibmmca_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
2118 return 0; 2118 return 0;
2119} 2119}
2120 2120
2121static int ibmmca_abort(Scsi_Cmnd * cmd) 2121static int __ibmmca_abort(Scsi_Cmnd * cmd)
2122{ 2122{
2123 /* Abort does not work, as the adapter never generates an interrupt on 2123 /* Abort does not work, as the adapter never generates an interrupt on
2124 * whatever situation is simulated, even when really pending commands 2124 * whatever situation is simulated, even when really pending commands
@@ -2225,6 +2225,18 @@ static int ibmmca_abort(Scsi_Cmnd * cmd)
2225 } 2225 }
2226} 2226}
2227 2227
2228static int ibmmca_abort(Scsi_Cmnd * cmd)
2229{
2230 struct Scsi_Host *shpnt = cmd->device->host;
2231 int rc;
2232
2233 spin_lock_irq(shpnt->host_lock);
2234 rc = __ibmmca_abort(cmd);
2235 spin_unlock_irq(shpnt->host_lock);
2236
2237 return rc;
2238}
2239
2228static int ibmmca_host_reset(Scsi_Cmnd * cmd) 2240static int ibmmca_host_reset(Scsi_Cmnd * cmd)
2229{ 2241{
2230 struct Scsi_Host *shpnt; 2242 struct Scsi_Host *shpnt;
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c
index e89f76e5dd53..d857842bc45b 100644
--- a/drivers/scsi/ibmvscsi/ibmvscsi.c
+++ b/drivers/scsi/ibmvscsi/ibmvscsi.c
@@ -874,9 +874,7 @@ static int ibmvscsi_eh_abort_handler(struct scsi_cmnd *cmd)
874 return FAILED; 874 return FAILED;
875 } 875 }
876 876
877 spin_unlock_irq(hostdata->host->host_lock);
878 wait_for_completion(&evt->comp); 877 wait_for_completion(&evt->comp);
879 spin_lock_irq(hostdata->host->host_lock);
880 878
881 /* make sure we got a good response */ 879 /* make sure we got a good response */
882 if (unlikely(srp_rsp.srp.generic.type != SRP_RSP_TYPE)) { 880 if (unlikely(srp_rsp.srp.generic.type != SRP_RSP_TYPE)) {
diff --git a/drivers/scsi/in2000.c b/drivers/scsi/in2000.c
index e1fe6f13b829..fbb29f7971d7 100644
--- a/drivers/scsi/in2000.c
+++ b/drivers/scsi/in2000.c
@@ -1671,7 +1671,7 @@ static int in2000_bus_reset(Scsi_Cmnd * cmd)
1671 return SUCCESS; 1671 return SUCCESS;
1672} 1672}
1673 1673
1674static int in2000_abort(Scsi_Cmnd * cmd) 1674static int __in2000_abort(Scsi_Cmnd * cmd)
1675{ 1675{
1676 struct Scsi_Host *instance; 1676 struct Scsi_Host *instance;
1677 struct IN2000_hostdata *hostdata; 1677 struct IN2000_hostdata *hostdata;
@@ -1792,6 +1792,16 @@ static int in2000_abort(Scsi_Cmnd * cmd)
1792 return SUCCESS; 1792 return SUCCESS;
1793} 1793}
1794 1794
1795static int in2000_abort(Scsi_Cmnd * cmd)
1796{
1797 int rc;
1798
1799 spin_lock_irq(cmd->device->host->host_lock);
1800 rc = __in2000_abort(cmd);
1801 spin_unlock_irq(cmd->device->host->host_lock);
1802
1803 return rc;
1804}
1795 1805
1796 1806
1797#define MAX_IN2000_HOSTS 3 1807#define MAX_IN2000_HOSTS 3
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index a3d9cf675681..f9c01a13abef 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -3068,6 +3068,12 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd)
3068 ioa_cfg = (struct ipr_ioa_cfg *)scsi_cmd->device->host->hostdata; 3068 ioa_cfg = (struct ipr_ioa_cfg *)scsi_cmd->device->host->hostdata;
3069 res = scsi_cmd->device->hostdata; 3069 res = scsi_cmd->device->hostdata;
3070 3070
3071 /* If we are currently going through reset/reload, return failed.
3072 * This will force the mid-layer to call ipr_eh_host_reset,
3073 * which will then go to sleep and wait for the reset to complete
3074 */
3075 if (ioa_cfg->in_reset_reload || ioa_cfg->ioa_is_dead)
3076 return FAILED;
3071 if (!res || (!ipr_is_gscsi(res) && !ipr_is_vset_device(res))) 3077 if (!res || (!ipr_is_gscsi(res) && !ipr_is_vset_device(res)))
3072 return FAILED; 3078 return FAILED;
3073 3079
@@ -3118,23 +3124,17 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd)
3118 **/ 3124 **/
3119static int ipr_eh_abort(struct scsi_cmnd * scsi_cmd) 3125static int ipr_eh_abort(struct scsi_cmnd * scsi_cmd)
3120{ 3126{
3121 struct ipr_ioa_cfg *ioa_cfg; 3127 unsigned long flags;
3128 int rc;
3122 3129
3123 ENTER; 3130 ENTER;
3124 ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata;
3125 3131
3126 /* If we are currently going through reset/reload, return failed. This will force the 3132 spin_lock_irqsave(scsi_cmd->device->host->host_lock, flags);
3127 mid-layer to call ipr_eh_host_reset, which will then go to sleep and wait for the 3133 rc = ipr_cancel_op(scsi_cmd);
3128 reset to complete */ 3134 spin_unlock_irqrestore(scsi_cmd->device->host->host_lock, flags);
3129 if (ioa_cfg->in_reset_reload)
3130 return FAILED;
3131 if (ioa_cfg->ioa_is_dead)
3132 return FAILED;
3133 if (!scsi_cmd->device->hostdata)
3134 return FAILED;
3135 3135
3136 LEAVE; 3136 LEAVE;
3137 return ipr_cancel_op(scsi_cmd); 3137 return rc;
3138} 3138}
3139 3139
3140/** 3140/**
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index fbc2cb6667a1..6572e100f7b2 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -819,12 +819,15 @@ ips_eh_abort(Scsi_Cmnd * SC)
819 ips_ha_t *ha; 819 ips_ha_t *ha;
820 ips_copp_wait_item_t *item; 820 ips_copp_wait_item_t *item;
821 int ret; 821 int ret;
822 unsigned long cpu_flags;
823 struct Scsi_Host *host;
822 824
823 METHOD_TRACE("ips_eh_abort", 1); 825 METHOD_TRACE("ips_eh_abort", 1);
824 826
825 if (!SC) 827 if (!SC)
826 return (FAILED); 828 return (FAILED);
827 829
830 host = SC->device->host;
828 ha = (ips_ha_t *) SC->device->host->hostdata; 831 ha = (ips_ha_t *) SC->device->host->hostdata;
829 832
830 if (!ha) 833 if (!ha)
@@ -833,6 +836,8 @@ ips_eh_abort(Scsi_Cmnd * SC)
833 if (!ha->active) 836 if (!ha->active)
834 return (FAILED); 837 return (FAILED);
835 838
839 IPS_LOCK_SAVE(host->host_lock, cpu_flags);
840
836 /* See if the command is on the copp queue */ 841 /* See if the command is on the copp queue */
837 item = ha->copp_waitlist.head; 842 item = ha->copp_waitlist.head;
838 while ((item) && (item->scsi_cmd != SC)) 843 while ((item) && (item->scsi_cmd != SC))
@@ -851,6 +856,8 @@ ips_eh_abort(Scsi_Cmnd * SC)
851 /* command must have already been sent */ 856 /* command must have already been sent */
852 ret = (FAILED); 857 ret = (FAILED);
853 } 858 }
859
860 IPS_UNLOCK_RESTORE(host->host_lock, cpu_flags);
854 return ret; 861 return ret;
855} 862}
856 863
diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
index 42fab03ad2ba..e9b84f9d8e81 100644
--- a/drivers/scsi/lpfc/lpfc_scsi.c
+++ b/drivers/scsi/lpfc/lpfc_scsi.c
@@ -798,7 +798,7 @@ lpfc_queuecommand(struct scsi_cmnd *cmnd, void (*done) (struct scsi_cmnd *))
798} 798}
799 799
800static int 800static int
801lpfc_abort_handler(struct scsi_cmnd *cmnd) 801__lpfc_abort_handler(struct scsi_cmnd *cmnd)
802{ 802{
803 struct lpfc_hba *phba = 803 struct lpfc_hba *phba =
804 (struct lpfc_hba *)cmnd->device->host->hostdata[0]; 804 (struct lpfc_hba *)cmnd->device->host->hostdata[0];
@@ -918,6 +918,16 @@ lpfc_abort_handler(struct scsi_cmnd *cmnd)
918} 918}
919 919
920static int 920static int
921lpfc_abort_handler(struct scsi_cmnd *cmnd)
922{
923 int rc;
924 spin_lock_irq(cmnd->device->host->host_lock);
925 rc = __lpfc_abort_handler(cmnd);
926 spin_unlock_irq(cmnd->device->host->host_lock);
927 return rc;
928}
929
930static int
921lpfc_reset_lun_handler(struct scsi_cmnd *cmnd) 931lpfc_reset_lun_handler(struct scsi_cmnd *cmnd)
922{ 932{
923 struct Scsi_Host *shost = cmnd->device->host; 933 struct Scsi_Host *shost = cmnd->device->host;
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index 78768736077f..bec4406011aa 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -2566,7 +2566,7 @@ megaraid_mbox_dpc(unsigned long devp)
2566 * aborted. All the commands issued to the F/W must complete. 2566 * aborted. All the commands issued to the F/W must complete.
2567 **/ 2567 **/
2568static int 2568static int
2569megaraid_abort_handler(struct scsi_cmnd *scp) 2569__megaraid_abort_handler(struct scsi_cmnd *scp)
2570{ 2570{
2571 adapter_t *adapter; 2571 adapter_t *adapter;
2572 mraid_device_t *raid_dev; 2572 mraid_device_t *raid_dev;
@@ -2699,6 +2699,21 @@ megaraid_abort_handler(struct scsi_cmnd *scp)
2699 return FAILED; 2699 return FAILED;
2700} 2700}
2701 2701
2702static int
2703megaraid_abort_handler(struct scsi_cmnd *scp)
2704{
2705 adapter_t *adapter;
2706 int rc;
2707
2708 adapter = SCP2ADAPTER(scp);
2709
2710 spin_lock_irq(adapter->host_lock);
2711 rc = __megaraid_abort_handler(scp);
2712 spin_unlock_irq(adapter->host_lock);
2713
2714 return rc;
2715}
2716
2702 2717
2703/** 2718/**
2704 * megaraid_reset_handler - device reset hadler for mailbox based driver 2719 * megaraid_reset_handler - device reset hadler for mailbox based driver
diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c
index 653e589b7d7f..638be81c4509 100644
--- a/drivers/scsi/qla1280.c
+++ b/drivers/scsi/qla1280.c
@@ -1098,7 +1098,13 @@ qla1280_error_action(struct scsi_cmnd *cmd, enum action action)
1098static int 1098static int
1099qla1280_eh_abort(struct scsi_cmnd * cmd) 1099qla1280_eh_abort(struct scsi_cmnd * cmd)
1100{ 1100{
1101 return qla1280_error_action(cmd, ABORT_COMMAND); 1101 int rc;
1102
1103 spin_lock_irq(cmd->device->host->host_lock);
1104 rc = qla1280_error_action(cmd, ABORT_COMMAND);
1105 spin_unlock_irq(cmd->device->host->host_lock);
1106
1107 return rc;
1102} 1108}
1103 1109
1104/************************************************************************** 1110/**************************************************************************
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 7f8d747bd5e5..1693998aa727 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -476,7 +476,6 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
476 serial = cmd->serial_number; 476 serial = cmd->serial_number;
477 477
478 /* Check active list for command command. */ 478 /* Check active list for command command. */
479 spin_unlock_irq(ha->host->host_lock);
480 spin_lock(&ha->hardware_lock); 479 spin_lock(&ha->hardware_lock);
481 for (i = 1; i < MAX_OUTSTANDING_COMMANDS; i++) { 480 for (i = 1; i < MAX_OUTSTANDING_COMMANDS; i++) {
482 sp = ha->outstanding_cmds[i]; 481 sp = ha->outstanding_cmds[i];
@@ -516,7 +515,6 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
516 } 515 }
517 spin_lock(&ha->hardware_lock); 516 spin_lock(&ha->hardware_lock);
518 } 517 }
519 spin_lock_irq(ha->host->host_lock);
520 518
521 qla_printk(KERN_INFO, ha, 519 qla_printk(KERN_INFO, ha,
522 "scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no, 520 "scsi(%ld:%d:%d): Abort command issued -- %lx %x.\n", ha->host_no,
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 113c02dbb2df..3877a78f5e50 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -526,10 +526,8 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, int timeout)
526 * abort a timed out command or not. not sure how 526 * abort a timed out command or not. not sure how
527 * we should treat them differently anyways. 527 * we should treat them differently anyways.
528 */ 528 */
529 spin_lock_irqsave(shost->host_lock, flags);
530 if (shost->hostt->eh_abort_handler) 529 if (shost->hostt->eh_abort_handler)
531 shost->hostt->eh_abort_handler(scmd); 530 shost->hostt->eh_abort_handler(scmd);
532 spin_unlock_irqrestore(shost->host_lock, flags);
533 531
534 scmd->request->rq_status = RQ_SCSI_DONE; 532 scmd->request->rq_status = RQ_SCSI_DONE;
535 scmd->owner = SCSI_OWNER_ERROR_HANDLER; 533 scmd->owner = SCSI_OWNER_ERROR_HANDLER;
@@ -735,11 +733,8 @@ static int scsi_eh_get_sense(struct list_head *work_q,
735 **/ 733 **/
736static int scsi_try_to_abort_cmd(struct scsi_cmnd *scmd) 734static int scsi_try_to_abort_cmd(struct scsi_cmnd *scmd)
737{ 735{
738 unsigned long flags;
739 int rtn = FAILED;
740
741 if (!scmd->device->host->hostt->eh_abort_handler) 736 if (!scmd->device->host->hostt->eh_abort_handler)
742 return rtn; 737 return FAILED;
743 738
744 /* 739 /*
745 * scsi_done was called just after the command timed out and before 740 * scsi_done was called just after the command timed out and before
@@ -750,11 +745,7 @@ static int scsi_try_to_abort_cmd(struct scsi_cmnd *scmd)
750 745
751 scmd->owner = SCSI_OWNER_LOWLEVEL; 746 scmd->owner = SCSI_OWNER_LOWLEVEL;
752 747
753 spin_lock_irqsave(scmd->device->host->host_lock, flags); 748 return scmd->device->host->hostt->eh_abort_handler(scmd);
754 rtn = scmd->device->host->hostt->eh_abort_handler(scmd);
755 spin_unlock_irqrestore(scmd->device->host->host_lock, flags);
756
757 return rtn;
758} 749}
759 750
760/** 751/**
diff --git a/drivers/scsi/sym53c8xx_2/sym_glue.c b/drivers/scsi/sym53c8xx_2/sym_glue.c
index be58ffd5a432..e2d055ed5b6f 100644
--- a/drivers/scsi/sym53c8xx_2/sym_glue.c
+++ b/drivers/scsi/sym53c8xx_2/sym_glue.c
@@ -856,7 +856,13 @@ prepare:
856 */ 856 */
857static int sym53c8xx_eh_abort_handler(struct scsi_cmnd *cmd) 857static int sym53c8xx_eh_abort_handler(struct scsi_cmnd *cmd)
858{ 858{
859 return sym_eh_handler(SYM_EH_ABORT, "ABORT", cmd); 859 int rc;
860
861 spin_lock_irq(cmd->device->host->host_lock);
862 rc = sym_eh_handler(SYM_EH_ABORT, "ABORT", cmd);
863 spin_unlock_irq(cmd->device->host->host_lock);
864
865 return rc;
860} 866}
861 867
862static int sym53c8xx_eh_device_reset_handler(struct scsi_cmnd *cmd) 868static int sym53c8xx_eh_device_reset_handler(struct scsi_cmnd *cmd)
diff --git a/drivers/scsi/ultrastor.c b/drivers/scsi/ultrastor.c
index 2c17470a229d..486551bd54ba 100644
--- a/drivers/scsi/ultrastor.c
+++ b/drivers/scsi/ultrastor.c
@@ -879,7 +879,7 @@ static int ultrastor_abort(Scsi_Cmnd *SCpnt)
879 ogm_addr = (unsigned int)isa_bus_to_virt(inl(port0 + 23)); 879 ogm_addr = (unsigned int)isa_bus_to_virt(inl(port0 + 23));
880 icm_status = inb(port0 + 27); 880 icm_status = inb(port0 + 27);
881 icm_addr = (unsigned int)isa_bus_to_virt(inl(port0 + 28)); 881 icm_addr = (unsigned int)isa_bus_to_virt(inl(port0 + 28));
882 spin_lock_irqsave(host->host_lock, flags); 882 spin_unlock_irqrestore(host->host_lock, flags);
883 } 883 }
884 884
885 /* First check to see if an interrupt is pending. I suspect the SiS 885 /* First check to see if an interrupt is pending. I suspect the SiS
diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
index 22e48a2b0bd1..7dce9c01c357 100644
--- a/drivers/usb/storage/scsiglue.c
+++ b/drivers/usb/storage/scsiglue.c
@@ -233,13 +233,11 @@ static int command_abort(struct scsi_cmnd *srb)
233 set_bit(US_FLIDX_ABORTING, &us->flags); 233 set_bit(US_FLIDX_ABORTING, &us->flags);
234 usb_stor_stop_transport(us); 234 usb_stor_stop_transport(us);
235 } 235 }
236 scsi_unlock(us_to_host(us));
237 236
238 /* Wait for the aborted command to finish */ 237 /* Wait for the aborted command to finish */
239 wait_for_completion(&us->notify); 238 wait_for_completion(&us->notify);
240 239
241 /* Reacquire the lock and allow USB transfers to resume */ 240 /* Reacquire the lock and allow USB transfers to resume */
242 scsi_lock(us_to_host(us));
243 clear_bit(US_FLIDX_ABORTING, &us->flags); 241 clear_bit(US_FLIDX_ABORTING, &us->flags);
244 clear_bit(US_FLIDX_TIMED_OUT, &us->flags); 242 clear_bit(US_FLIDX_TIMED_OUT, &us->flags);
245 return SUCCESS; 243 return SUCCESS;