aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSreekanth Reddy <Sreekanth.Reddy@lsi.com>2012-12-18 08:45:30 -0500
committerJames Bottomley <JBottomley@Parallels.com>2013-01-28 22:15:35 -0500
commitb4730fb6e54a634a145c9c71c5cf856f00beb5cd (patch)
tree4de4c1d147ef66585909bfa6c63fc5e853788fbd
parent25ef16d0710e1d2476bb06232836650ea42763a5 (diff)
[SCSI] mpt2sas: fix for driver fails EEH, recovery from injected pci bus error
This patch stops the driver to invoke kthread (which remove the dead ioc) for some time while EEH recovery has started. [thenzl: add a 'non_operational_loop' reset.] Signed-off-by: Sreekanth Reddy <Sreekanth.Reddy@lsi.com> Signed-off-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.c19
-rw-r--r--drivers/scsi/mpt2sas/mpt2sas_base.h1
2 files changed, 19 insertions, 1 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.c b/drivers/scsi/mpt2sas/mpt2sas_base.c
index ffd85c511c8e..5e24e7e73714 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.c
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.c
@@ -155,7 +155,7 @@ _base_fault_reset_work(struct work_struct *work)
155 struct task_struct *p; 155 struct task_struct *p;
156 156
157 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags); 157 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock, flags);
158 if (ioc->shost_recovery) 158 if (ioc->shost_recovery || ioc->pci_error_recovery)
159 goto rearm_timer; 159 goto rearm_timer;
160 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); 160 spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
161 161
@@ -164,6 +164,20 @@ _base_fault_reset_work(struct work_struct *work)
164 printk(MPT2SAS_INFO_FMT "%s : SAS host is non-operational !!!!\n", 164 printk(MPT2SAS_INFO_FMT "%s : SAS host is non-operational !!!!\n",
165 ioc->name, __func__); 165 ioc->name, __func__);
166 166
167 /* It may be possible that EEH recovery can resolve some of
168 * pci bus failure issues rather removing the dead ioc function
169 * by considering controller is in a non-operational state. So
170 * here priority is given to the EEH recovery. If it doesn't
171 * not resolve this issue, mpt2sas driver will consider this
172 * controller to non-operational state and remove the dead ioc
173 * function.
174 */
175 if (ioc->non_operational_loop++ < 5) {
176 spin_lock_irqsave(&ioc->ioc_reset_in_progress_lock,
177 flags);
178 goto rearm_timer;
179 }
180
167 /* 181 /*
168 * Call _scsih_flush_pending_cmds callback so that we flush all 182 * Call _scsih_flush_pending_cmds callback so that we flush all
169 * pending commands back to OS. This call is required to aovid 183 * pending commands back to OS. This call is required to aovid
@@ -193,6 +207,8 @@ _base_fault_reset_work(struct work_struct *work)
193 return; /* don't rearm timer */ 207 return; /* don't rearm timer */
194 } 208 }
195 209
210 ioc->non_operational_loop = 0;
211
196 if ((doorbell & MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_FAULT) { 212 if ((doorbell & MPI2_IOC_STATE_MASK) == MPI2_IOC_STATE_FAULT) {
197 rc = mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP, 213 rc = mpt2sas_base_hard_reset_handler(ioc, CAN_SLEEP,
198 FORCE_BIG_HAMMER); 214 FORCE_BIG_HAMMER);
@@ -4386,6 +4402,7 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)
4386 if (missing_delay[0] != -1 && missing_delay[1] != -1) 4402 if (missing_delay[0] != -1 && missing_delay[1] != -1)
4387 _base_update_missing_delay(ioc, missing_delay[0], 4403 _base_update_missing_delay(ioc, missing_delay[0],
4388 missing_delay[1]); 4404 missing_delay[1]);
4405 ioc->non_operational_loop = 0;
4389 4406
4390 return 0; 4407 return 0;
4391 4408
diff --git a/drivers/scsi/mpt2sas/mpt2sas_base.h b/drivers/scsi/mpt2sas/mpt2sas_base.h
index 543d8d637479..c6ee7aad7501 100644
--- a/drivers/scsi/mpt2sas/mpt2sas_base.h
+++ b/drivers/scsi/mpt2sas/mpt2sas_base.h
@@ -835,6 +835,7 @@ struct MPT2SAS_ADAPTER {
835 u16 cpu_msix_table_sz; 835 u16 cpu_msix_table_sz;
836 u32 ioc_reset_count; 836 u32 ioc_reset_count;
837 MPT2SAS_FLUSH_RUNNING_CMDS schedule_dead_ioc_flush_running_cmds; 837 MPT2SAS_FLUSH_RUNNING_CMDS schedule_dead_ioc_flush_running_cmds;
838 u32 non_operational_loop;
838 839
839 /* internal commands, callback index */ 840 /* internal commands, callback index */
840 u8 scsi_io_cb_idx; 841 u8 scsi_io_cb_idx;