diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/message/fusion/mptfc.c | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/message/fusion/mptfc.c')
-rw-r--r-- | drivers/message/fusion/mptfc.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/message/fusion/mptfc.c b/drivers/message/fusion/mptfc.c index ebf6ae024da4..33f7256055b1 100644 --- a/drivers/message/fusion/mptfc.c +++ b/drivers/message/fusion/mptfc.c | |||
@@ -54,6 +54,7 @@ | |||
54 | #include <linux/reboot.h> /* notifier code */ | 54 | #include <linux/reboot.h> /* notifier code */ |
55 | #include <linux/workqueue.h> | 55 | #include <linux/workqueue.h> |
56 | #include <linux/sort.h> | 56 | #include <linux/sort.h> |
57 | #include <linux/slab.h> | ||
57 | 58 | ||
58 | #include <scsi/scsi.h> | 59 | #include <scsi/scsi.h> |
59 | #include <scsi/scsi_cmnd.h> | 60 | #include <scsi/scsi_cmnd.h> |
@@ -195,29 +196,34 @@ mptfc_block_error_handler(struct scsi_cmnd *SCpnt, | |||
195 | unsigned long flags; | 196 | unsigned long flags; |
196 | int ready; | 197 | int ready; |
197 | MPT_ADAPTER *ioc; | 198 | MPT_ADAPTER *ioc; |
199 | int loops = 40; /* seconds */ | ||
198 | 200 | ||
199 | hd = shost_priv(SCpnt->device->host); | 201 | hd = shost_priv(SCpnt->device->host); |
200 | ioc = hd->ioc; | 202 | ioc = hd->ioc; |
201 | spin_lock_irqsave(shost->host_lock, flags); | 203 | spin_lock_irqsave(shost->host_lock, flags); |
202 | while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY) { | 204 | while ((ready = fc_remote_port_chkready(rport) >> 16) == DID_IMM_RETRY |
205 | || (loops > 0 && ioc->active == 0)) { | ||
203 | spin_unlock_irqrestore(shost->host_lock, flags); | 206 | spin_unlock_irqrestore(shost->host_lock, flags); |
204 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT | 207 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT |
205 | "mptfc_block_error_handler.%d: %d:%d, port status is " | 208 | "mptfc_block_error_handler.%d: %d:%d, port status is " |
206 | "DID_IMM_RETRY, deferring %s recovery.\n", | 209 | "%x, active flag %d, deferring %s recovery.\n", |
207 | ioc->name, ioc->sh->host_no, | 210 | ioc->name, ioc->sh->host_no, |
208 | SCpnt->device->id, SCpnt->device->lun, caller)); | 211 | SCpnt->device->id, SCpnt->device->lun, |
212 | ready, ioc->active, caller)); | ||
209 | msleep(1000); | 213 | msleep(1000); |
210 | spin_lock_irqsave(shost->host_lock, flags); | 214 | spin_lock_irqsave(shost->host_lock, flags); |
215 | loops --; | ||
211 | } | 216 | } |
212 | spin_unlock_irqrestore(shost->host_lock, flags); | 217 | spin_unlock_irqrestore(shost->host_lock, flags); |
213 | 218 | ||
214 | if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata) { | 219 | if (ready == DID_NO_CONNECT || !SCpnt->device->hostdata |
220 | || ioc->active == 0) { | ||
215 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT | 221 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT |
216 | "%s.%d: %d:%d, failing recovery, " | 222 | "%s.%d: %d:%d, failing recovery, " |
217 | "port state %d, vdevice %p.\n", caller, | 223 | "port state %x, active %d, vdevice %p.\n", caller, |
218 | ioc->name, ioc->sh->host_no, | 224 | ioc->name, ioc->sh->host_no, |
219 | SCpnt->device->id, SCpnt->device->lun, ready, | 225 | SCpnt->device->id, SCpnt->device->lun, ready, |
220 | SCpnt->device->hostdata)); | 226 | ioc->active, SCpnt->device->hostdata)); |
221 | return FAILED; | 227 | return FAILED; |
222 | } | 228 | } |
223 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT | 229 | dfcprintk (ioc, printk(MYIOC_s_DEBUG_FMT |