aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.c13
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.h3
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_ctl.c16
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_scsih.c40
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_transport.c29
5 files changed, 47 insertions, 54 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index cc5a8dae4ae1..1cfb503125b6 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -94,7 +94,7 @@ _base_fault_reset_work(struct work_struct *work)
94 int rc; 94 int rc;
95 95
96 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 96 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);
97 if (ioc->ioc_reset_in_progress) 97 if (ioc->shost_recovery)
98 goto rearm_timer; 98 goto rearm_timer;
99 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); 99 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
100 100
@@ -3501,20 +3501,13 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag,
3501 __func__)); 3501 __func__));
3502 3502
3503 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 3503 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);
3504 if (ioc->ioc_reset_in_progress) { 3504 if (ioc->shost_recovery) {
3505 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); 3505 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
3506 printk(MPT2SAS_ERR_FMT "%s: busy\n", 3506 printk(MPT2SAS_ERR_FMT "%s: busy\n",
3507 ioc->name, __func__); 3507 ioc->name, __func__);
3508 return -EBUSY; 3508 return -EBUSY;
3509 } 3509 }
3510 ioc->ioc_reset_in_progress = 1;
3511 ioc->shost_recovery = 1; 3510 ioc->shost_recovery = 1;
3512 if (ioc->shost->shost_state == SHOST_RUNNING) {
3513 /* set back to SHOST_RUNNING in mpt2sas_scsih.c */
3514 scsi_host_set_state(ioc->shost, SHOST_RECOVERY);
3515 printk(MPT2SAS_INFO_FMT "putting controller into "
3516 "SHOST_RECOVERY\n", ioc->name);
3517 }
3518 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); 3511 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
3519 3512
3520 _base_reset_handler(ioc, MPT2_IOC_PRE_RESET); 3513 _base_reset_handler(ioc, MPT2_IOC_PRE_RESET);
@@ -3534,7 +3527,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag,
3534 ioc->name, __func__, ((r == 0) ? "SUCCESS" : "FAILED"))); 3527 ioc->name, __func__, ((r == 0) ? "SUCCESS" : "FAILED")));
3535 3528
3536 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 3529 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);
3537 ioc->ioc_reset_in_progress = 0; 3530 ioc->shost_recovery = 0;
3538 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); 3531 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
3539 3532
3540 if (!r) 3533 if (!r)
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 998a7b847b3d..15827582a90e 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -432,7 +432,7 @@ typedef void (*MPT_ADD_SGE)(void *paddr, u32 flags_length, dma_addr_t dma_addr);
432 * @fw_event_list: list of fw events 432 * @fw_event_list: list of fw events
433 * @aen_event_read_flag: event log was read 433 * @aen_event_read_flag: event log was read
434 * @broadcast_aen_busy: broadcast aen waiting to be serviced 434 * @broadcast_aen_busy: broadcast aen waiting to be serviced
435 * @ioc_reset_in_progress: host reset in progress 435 * @shost_recovery: host reset in progress
436 * @ioc_reset_in_progress_lock: 436 * @ioc_reset_in_progress_lock:
437 * @ioc_link_reset_in_progress: phy/hard reset in progress 437 * @ioc_link_reset_in_progress: phy/hard reset in progress
438 * @ignore_loginfos: ignore loginfos during task managment 438 * @ignore_loginfos: ignore loginfos during task managment
@@ -545,7 +545,6 @@ struct MPT2SAS_ADAPTER {
545 /* misc flags */ 545 /* misc flags */
546 int aen_event_read_flag; 546 int aen_event_read_flag;
547 u8 broadcast_aen_busy; 547 u8 broadcast_aen_busy;
548 u8 ioc_reset_in_progress;
549 u8 shost_recovery; 548 u8 shost_recovery;
550 spinlock_t ioc_reset_in_progress_lock; 549 spinlock_t ioc_reset_in_progress_lock;
551 u8 ioc_link_reset_in_progress; 550 u8 ioc_link_reset_in_progress;
diff --git a/drivers/scsi/mpt2sas/mpt2sas_ctl.c b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
index 14e473d1fa7b..c2a51018910f 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_ctl.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_ctl.c
@@ -1963,7 +1963,6 @@ _ctl_ioctl_main(struct file *file, unsigned int cmd, void __user *arg)
1963{ 1963{
1964 enum block_state state; 1964 enum block_state state;
1965 long ret = -EINVAL; 1965 long ret = -EINVAL;
1966 unsigned long flags;
1967 1966
1968 state = (file->f_flags & O_NONBLOCK) ? NON_BLOCKING : 1967 state = (file->f_flags & O_NONBLOCK) ? NON_BLOCKING :
1969 BLOCKING; 1968 BLOCKING;
@@ -1989,13 +1988,8 @@ _ctl_ioctl_main(struct file *file, unsigned int cmd, void __user *arg)
1989 !ioc) 1988 !ioc)
1990 return -ENODEV; 1989 return -ENODEV;
1991 1990
1992 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 1991 if (ioc->shost_recovery)
1993 if (ioc->shost_recovery) {
1994 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock,
1995 flags);
1996 return -EAGAIN; 1992 return -EAGAIN;
1997 }
1998 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
1999 1993
2000 if (_IOC_SIZE(cmd) == sizeof(struct mpt2_ioctl_command)) { 1994 if (_IOC_SIZE(cmd) == sizeof(struct mpt2_ioctl_command)) {
2001 uarg = arg; 1995 uarg = arg;
@@ -2098,7 +2092,6 @@ _ctl_compat_mpt_command(struct file *file, unsigned cmd, unsigned long arg)
2098 struct mpt2_ioctl_command karg; 2092 struct mpt2_ioctl_command karg;
2099 struct MPT2SAS_ADAPTER *ioc; 2093 struct MPT2SAS_ADAPTER *ioc;
2100 enum block_state state; 2094 enum block_state state;
2101 unsigned long flags;
2102 2095
2103 if (_IOC_SIZE(cmd) != sizeof(struct mpt2_ioctl_command32)) 2096 if (_IOC_SIZE(cmd) != sizeof(struct mpt2_ioctl_command32))
2104 return -EINVAL; 2097 return -EINVAL;
@@ -2113,13 +2106,8 @@ _ctl_compat_mpt_command(struct file *file, unsigned cmd, unsigned long arg)
2113 if (_ctl_verify_adapter(karg32.hdr.ioc_number, &ioc) == -1 || !ioc) 2106 if (_ctl_verify_adapter(karg32.hdr.ioc_number, &ioc) == -1 || !ioc)
2114 return -ENODEV; 2107 return -ENODEV;
2115 2108
2116 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 2109 if (ioc->shost_recovery)
2117 if (ioc->shost_recovery) {
2118 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock,
2119 flags);
2120 return -EAGAIN; 2110 return -EAGAIN;
2121 }
2122 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
2123 2111
2124 memset(&karg, 0, sizeof(struct mpt2_ioctl_command)); 2112 memset(&karg, 0, sizeof(struct mpt2_ioctl_command));
2125 karg.hdr.ioc_number = karg32.hdr.ioc_number; 2113 karg.hdr.ioc_number = karg32.hdr.ioc_number;
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
index 471c3b604596..195f5e5aabf1 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c
@@ -1785,17 +1785,18 @@ mpt2sas_scsih_issue_tm(struct MPT2SAS_ADAPTER *ioc, u16 handle, uint lun,
1785 u32 ioc_state; 1785 u32 ioc_state;
1786 unsigned long timeleft; 1786 unsigned long timeleft;
1787 u8 VF_ID = 0; 1787 u8 VF_ID = 0;
1788 unsigned long flags;
1789 1788
1790 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 1789 if (ioc->tm_cmds.status != MPT2_CMD_NOT_USED) {
1791 if (ioc->tm_cmds.status != MPT2_CMD_NOT_USED || 1790 printk(MPT2SAS_INFO_FMT "%s: tm_cmd busy!!!\n",
1792 ioc->shost_recovery) { 1791 __func__, ioc->name);
1793 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); 1792 return;
1793 }
1794
1795 if (ioc->shost_recovery) {
1794 printk(MPT2SAS_INFO_FMT "%s: host reset in progress!\n", 1796 printk(MPT2SAS_INFO_FMT "%s: host reset in progress!\n",
1795 __func__, ioc->name); 1797 __func__, ioc->name);
1796 return; 1798 return;
1797 } 1799 }
1798 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
1799 1800
1800 ioc_state = mpt2sas_base_get_iocstate(ioc, 0); 1801 ioc_state = mpt2sas_base_get_iocstate(ioc, 0);
1801 if (ioc_state & MPI2_DOORBELL_USED) { 1802 if (ioc_state & MPI2_DOORBELL_USED) {
@@ -2553,7 +2554,6 @@ _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *))
2553 Mpi2SCSIIORequest_t *mpi_request; 2554 Mpi2SCSIIORequest_t *mpi_request;
2554 u32 mpi_control; 2555 u32 mpi_control;
2555 u16 smid; 2556 u16 smid;
2556 unsigned long flags;
2557 2557
2558 scmd->scsi_done = done; 2558 scmd->scsi_done = done;
2559 sas_device_priv_data = scmd->device->hostdata; 2559 sas_device_priv_data = scmd->device->hostdata;
@@ -2572,13 +2572,10 @@ _scsih_qcmd(struct scsi_cmnd *scmd, void (*done)(struct scsi_cmnd *))
2572 } 2572 }
2573 2573
2574 /* see if we are busy with task managment stuff */ 2574 /* see if we are busy with task managment stuff */
2575 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 2575 if (sas_target_priv_data->tm_busy)
2576 if (sas_target_priv_data->tm_busy || 2576 return SCSI_MLQUEUE_DEVICE_BUSY;
2577 ioc->shost_recovery || ioc->ioc_link_reset_in_progress) { 2577 else if (ioc->shost_recovery || ioc->ioc_link_reset_in_progress)
2578 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
2579 return SCSI_MLQUEUE_HOST_BUSY; 2578 return SCSI_MLQUEUE_HOST_BUSY;
2580 }
2581 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
2582 2579
2583 if (scmd->sc_data_direction == DMA_FROM_DEVICE) 2580 if (scmd->sc_data_direction == DMA_FROM_DEVICE)
2584 mpi_control = MPI2_SCSIIO_CONTROL_READ; 2581 mpi_control = MPI2_SCSIIO_CONTROL_READ;
@@ -3374,6 +3371,9 @@ _scsih_expander_add(struct MPT2SAS_ADAPTER *ioc, u16 handle)
3374 if (!handle) 3371 if (!handle)
3375 return -1; 3372 return -1;
3376 3373
3374 if (ioc->shost_recovery)
3375 return -1;
3376
3377 if ((mpt2sas_config_get_expander_pg0(ioc, &mpi_reply, &expander_pg0, 3377 if ((mpt2sas_config_get_expander_pg0(ioc, &mpi_reply, &expander_pg0,
3378 MPI2_SAS_EXPAND_PGAD_FORM_HNDL, handle))) { 3378 MPI2_SAS_EXPAND_PGAD_FORM_HNDL, handle))) {
3379 printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", 3379 printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
@@ -3510,6 +3510,9 @@ _scsih_expander_remove(struct MPT2SAS_ADAPTER *ioc, u16 handle)
3510 struct _sas_node *sas_expander; 3510 struct _sas_node *sas_expander;
3511 unsigned long flags; 3511 unsigned long flags;
3512 3512
3513 if (ioc->shost_recovery)
3514 return;
3515
3513 spin_lock_irqsave(&ioc->sas_node_lock, flags); 3516 spin_lock_irqsave(&ioc->sas_node_lock, flags);
3514 sas_expander = mpt2sas_scsih_expander_find_by_handle(ioc, handle); 3517 sas_expander = mpt2sas_scsih_expander_find_by_handle(ioc, handle);
3515 spin_unlock_irqrestore(&ioc->sas_node_lock, flags); 3518 spin_unlock_irqrestore(&ioc->sas_node_lock, flags);
@@ -3681,6 +3684,8 @@ _scsih_remove_device(struct MPT2SAS_ADAPTER *ioc, u16 handle)
3681 mutex_unlock(&ioc->tm_cmds.mutex); 3684 mutex_unlock(&ioc->tm_cmds.mutex);
3682 dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "issue target reset " 3685 dewtprintk(ioc, printk(MPT2SAS_INFO_FMT "issue target reset "
3683 "done: handle(0x%04x)\n", ioc->name, device_handle)); 3686 "done: handle(0x%04x)\n", ioc->name, device_handle));
3687 if (ioc->shost_recovery)
3688 goto out;
3684 } 3689 }
3685 3690
3686 /* SAS_IO_UNIT_CNTR - send REMOVE_DEVICE */ 3691 /* SAS_IO_UNIT_CNTR - send REMOVE_DEVICE */
@@ -3846,6 +3851,8 @@ _scsih_sas_topology_change_event(struct MPT2SAS_ADAPTER *ioc, u8 VF_ID,
3846 "expander event\n", ioc->name)); 3851 "expander event\n", ioc->name));
3847 return; 3852 return;
3848 } 3853 }
3854 if (ioc->shost_recovery)
3855 return;
3849 if (event_data->PHY[i].PhyStatus & 3856 if (event_data->PHY[i].PhyStatus &
3850 MPI2_EVENT_SAS_TOPO_PHYSTATUS_VACANT) 3857 MPI2_EVENT_SAS_TOPO_PHYSTATUS_VACANT)
3851 continue; 3858 continue;
@@ -5217,13 +5224,10 @@ _firmware_event_work(struct work_struct *work)
5217 } 5224 }
5218 spin_unlock_irqrestore(&ioc->fw_event_lock, flags); 5225 spin_unlock_irqrestore(&ioc->fw_event_lock, flags);
5219 5226
5220 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);
5221 if (ioc->shost_recovery) { 5227 if (ioc->shost_recovery) {
5222 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
5223 _scsih_fw_event_requeue(ioc, fw_event, 1000); 5228 _scsih_fw_event_requeue(ioc, fw_event, 1000);
5224 return; 5229 return;
5225 } 5230 }
5226 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
5227 5231
5228 switch (fw_event->event) { 5232 switch (fw_event->event) {
5229 case MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST: 5233 case MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST:
@@ -5425,6 +5429,8 @@ _scsih_expander_node_remove(struct MPT2SAS_ADAPTER *ioc,
5425 if (!sas_device) 5429 if (!sas_device)
5426 continue; 5430 continue;
5427 _scsih_remove_device(ioc, sas_device->handle); 5431 _scsih_remove_device(ioc, sas_device->handle);
5432 if (ioc->shost_recovery)
5433 return;
5428 goto retry_device_search; 5434 goto retry_device_search;
5429 } 5435 }
5430 } 5436 }
@@ -5446,6 +5452,8 @@ _scsih_expander_node_remove(struct MPT2SAS_ADAPTER *ioc,
5446 if (!expander_sibling) 5452 if (!expander_sibling)
5447 continue; 5453 continue;
5448 _scsih_expander_remove(ioc, expander_sibling->handle); 5454 _scsih_expander_remove(ioc, expander_sibling->handle);
5455 if (ioc->shost_recovery)
5456 return;
5449 goto retry_expander_search; 5457 goto retry_expander_search;
5450 } 5458 }
5451 } 5459 }
diff --git a/drivers/scsi/mpt2sas/mpt2sas_transport.c b/drivers/scsi/mpt2sas/mpt2sas_transport.c
index 686695b155c7..a53086d0381a 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_transport.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_transport.c
@@ -140,11 +140,18 @@ _transport_set_identify(struct MPT2SAS_ADAPTER *ioc, u16 handle,
140 u32 device_info; 140 u32 device_info;
141 u32 ioc_status; 141 u32 ioc_status;
142 142
143 if (ioc->shost_recovery) {
144 printk(MPT2SAS_INFO_FMT "%s: host reset in progress!\n",
145 __func__, ioc->name);
146 return -EFAULT;
147 }
148
143 if ((mpt2sas_config_get_sas_device_pg0(ioc, &mpi_reply, &sas_device_pg0, 149 if ((mpt2sas_config_get_sas_device_pg0(ioc, &mpi_reply, &sas_device_pg0,
144 MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) { 150 MPI2_SAS_DEVICE_PGAD_FORM_HANDLE, handle))) {
145 printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", 151 printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n",
152
146 ioc->name, __FILE__, __LINE__, __func__); 153 ioc->name, __FILE__, __LINE__, __func__);
147 return -1; 154 return -ENXIO;
148 } 155 }
149 156
150 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & 157 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) &
@@ -153,7 +160,7 @@ _transport_set_identify(struct MPT2SAS_ADAPTER *ioc, u16 handle,
153 printk(MPT2SAS_ERR_FMT "handle(0x%04x), ioc_status(0x%04x)" 160 printk(MPT2SAS_ERR_FMT "handle(0x%04x), ioc_status(0x%04x)"
154 "\nfailure at %s:%d/%s()!\n", ioc->name, handle, ioc_status, 161 "\nfailure at %s:%d/%s()!\n", ioc->name, handle, ioc_status,
155 __FILE__, __LINE__, __func__); 162 __FILE__, __LINE__, __func__);
156 return -1; 163 return -EIO;
157 } 164 }
158 165
159 memset(identify, 0, sizeof(identify)); 166 memset(identify, 0, sizeof(identify));
@@ -288,21 +295,17 @@ _transport_expander_report_manufacture(struct MPT2SAS_ADAPTER *ioc,
288 void *psge; 295 void *psge;
289 u32 sgl_flags; 296 u32 sgl_flags;
290 u8 issue_reset = 0; 297 u8 issue_reset = 0;
291 unsigned long flags;
292 void *data_out = NULL; 298 void *data_out = NULL;
293 dma_addr_t data_out_dma; 299 dma_addr_t data_out_dma;
294 u32 sz; 300 u32 sz;
295 u64 *sas_address_le; 301 u64 *sas_address_le;
296 u16 wait_state_count; 302 u16 wait_state_count;
297 303
298 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 304 if (ioc->shost_recovery) {
299 if (ioc->ioc_reset_in_progress) {
300 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
301 printk(MPT2SAS_INFO_FMT "%s: host reset in progress!\n", 305 printk(MPT2SAS_INFO_FMT "%s: host reset in progress!\n",
302 __func__, ioc->name); 306 __func__, ioc->name);
303 return -EFAULT; 307 return -EFAULT;
304 } 308 }
305 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
306 309
307 mutex_lock(&ioc->transport_cmds.mutex); 310 mutex_lock(&ioc->transport_cmds.mutex);
308 311
@@ -806,6 +809,12 @@ mpt2sas_transport_update_phy_link_change(struct MPT2SAS_ADAPTER *ioc,
806 struct _sas_node *sas_node; 809 struct _sas_node *sas_node;
807 struct _sas_phy *mpt2sas_phy; 810 struct _sas_phy *mpt2sas_phy;
808 811
812 if (ioc->shost_recovery) {
813 printk(MPT2SAS_INFO_FMT "%s: host reset in progress!\n",
814 __func__, ioc->name);
815 return;
816 }
817
809 spin_lock_irqsave(&ioc->sas_node_lock, flags); 818 spin_lock_irqsave(&ioc->sas_node_lock, flags);
810 sas_node = _transport_sas_node_find_by_handle(ioc, handle); 819 sas_node = _transport_sas_node_find_by_handle(ioc, handle);
811 spin_unlock_irqrestore(&ioc->sas_node_lock, flags); 820 spin_unlock_irqrestore(&ioc->sas_node_lock, flags);
@@ -1025,7 +1034,6 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1025 void *psge; 1034 void *psge;
1026 u32 sgl_flags; 1035 u32 sgl_flags;
1027 u8 issue_reset = 0; 1036 u8 issue_reset = 0;
1028 unsigned long flags;
1029 dma_addr_t dma_addr_in = 0; 1037 dma_addr_t dma_addr_in = 0;
1030 dma_addr_t dma_addr_out = 0; 1038 dma_addr_t dma_addr_out = 0;
1031 u16 wait_state_count; 1039 u16 wait_state_count;
@@ -1045,14 +1053,11 @@ _transport_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
1045 return -EINVAL; 1053 return -EINVAL;
1046 } 1054 }
1047 1055
1048 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 1056 if (ioc->shost_recovery) {
1049 if (ioc->ioc_reset_in_progress) {
1050 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
1051 printk(MPT2SAS_INFO_FMT "%s: host reset in progress!\n", 1057 printk(MPT2SAS_INFO_FMT "%s: host reset in progress!\n",
1052 __func__, ioc->name); 1058 __func__, ioc->name);
1053 return -EFAULT; 1059 return -EFAULT;
1054 } 1060 }
1055 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
1056 1061
1057 rc = mutex_lock_interruptible(&ioc->transport_cmds.mutex); 1062 rc = mutex_lock_interruptible(&ioc->transport_cmds.mutex);
1058 if (rc) 1063 if (rc)