aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/fusion/mptsas.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/message/fusion/mptsas.c')
-rw-r--r--drivers/message/fusion/mptsas.c47
1 files changed, 40 insertions, 7 deletions
diff --git a/drivers/message/fusion/mptsas.c b/drivers/message/fusion/mptsas.c
index 7596aecd5072..9d9504298549 100644
--- a/drivers/message/fusion/mptsas.c
+++ b/drivers/message/fusion/mptsas.c
@@ -92,6 +92,11 @@ static int max_lun = MPTSAS_MAX_LUN;
92module_param(max_lun, int, 0); 92module_param(max_lun, int, 0);
93MODULE_PARM_DESC(max_lun, " max lun, default=16895 "); 93MODULE_PARM_DESC(max_lun, " max lun, default=16895 ");
94 94
95static int mpt_loadtime_max_sectors = 8192;
96module_param(mpt_loadtime_max_sectors, int, 0);
97MODULE_PARM_DESC(mpt_loadtime_max_sectors,
98 " Maximum sector define for Host Bus Adaptor.Range 64 to 8192 default=8192");
99
95static u8 mptsasDoneCtx = MPT_MAX_PROTOCOL_DRIVERS; 100static u8 mptsasDoneCtx = MPT_MAX_PROTOCOL_DRIVERS;
96static u8 mptsasTaskCtx = MPT_MAX_PROTOCOL_DRIVERS; 101static u8 mptsasTaskCtx = MPT_MAX_PROTOCOL_DRIVERS;
97static u8 mptsasInternalCtx = MPT_MAX_PROTOCOL_DRIVERS; /* Used only for internal commands */ 102static u8 mptsasInternalCtx = MPT_MAX_PROTOCOL_DRIVERS; /* Used only for internal commands */
@@ -285,10 +290,11 @@ mptsas_add_fw_event(MPT_ADAPTER *ioc, struct fw_event_work *fw_event,
285 spin_lock_irqsave(&ioc->fw_event_lock, flags); 290 spin_lock_irqsave(&ioc->fw_event_lock, flags);
286 list_add_tail(&fw_event->list, &ioc->fw_event_list); 291 list_add_tail(&fw_event->list, &ioc->fw_event_list);
287 INIT_DELAYED_WORK(&fw_event->work, mptsas_firmware_event_work); 292 INIT_DELAYED_WORK(&fw_event->work, mptsas_firmware_event_work);
288 devtprintk(ioc, printk(MYIOC_s_DEBUG_FMT "%s: add (fw_event=0x%p)\n", 293 devtprintk(ioc, printk(MYIOC_s_DEBUG_FMT "%s: add (fw_event=0x%p)"
289 ioc->name, __func__, fw_event)); 294 "on cpuid %d\n", ioc->name, __func__,
290 queue_delayed_work(ioc->fw_event_q, &fw_event->work, 295 fw_event, smp_processor_id()));
291 delay); 296 queue_delayed_work_on(smp_processor_id(), ioc->fw_event_q,
297 &fw_event->work, delay);
292 spin_unlock_irqrestore(&ioc->fw_event_lock, flags); 298 spin_unlock_irqrestore(&ioc->fw_event_lock, flags);
293} 299}
294 300
@@ -300,10 +306,11 @@ mptsas_requeue_fw_event(MPT_ADAPTER *ioc, struct fw_event_work *fw_event,
300 unsigned long flags; 306 unsigned long flags;
301 spin_lock_irqsave(&ioc->fw_event_lock, flags); 307 spin_lock_irqsave(&ioc->fw_event_lock, flags);
302 devtprintk(ioc, printk(MYIOC_s_DEBUG_FMT "%s: reschedule task " 308 devtprintk(ioc, printk(MYIOC_s_DEBUG_FMT "%s: reschedule task "
303 "(fw_event=0x%p)\n", ioc->name, __func__, fw_event)); 309 "(fw_event=0x%p)on cpuid %d\n", ioc->name, __func__,
310 fw_event, smp_processor_id()));
304 fw_event->retries++; 311 fw_event->retries++;
305 queue_delayed_work(ioc->fw_event_q, &fw_event->work, 312 queue_delayed_work_on(smp_processor_id(), ioc->fw_event_q,
306 msecs_to_jiffies(delay)); 313 &fw_event->work, msecs_to_jiffies(delay));
307 spin_unlock_irqrestore(&ioc->fw_event_lock, flags); 314 spin_unlock_irqrestore(&ioc->fw_event_lock, flags);
308} 315}
309 316
@@ -1943,6 +1950,15 @@ static enum blk_eh_timer_return mptsas_eh_timed_out(struct scsi_cmnd *sc)
1943 goto done; 1950 goto done;
1944 } 1951 }
1945 1952
1953 /* In case if IOC is in reset from internal context.
1954 * Do not execute EEH for the same IOC. SML should to reset timer.
1955 */
1956 if (ioc->ioc_reset_in_progress) {
1957 dtmprintk(ioc, printk(MYIOC_s_WARN_FMT ": %s: ioc is in reset,"
1958 "SML need to reset the timer (sc=%p)\n",
1959 ioc->name, __func__, sc));
1960 rc = BLK_EH_RESET_TIMER;
1961 }
1946 vdevice = sc->device->hostdata; 1962 vdevice = sc->device->hostdata;
1947 if (vdevice && vdevice->vtarget && (vdevice->vtarget->inDMD 1963 if (vdevice && vdevice->vtarget && (vdevice->vtarget->inDMD
1948 || vdevice->vtarget->deleted)) { 1964 || vdevice->vtarget->deleted)) {
@@ -5142,6 +5158,8 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
5142 ioc->TaskCtx = mptsasTaskCtx; 5158 ioc->TaskCtx = mptsasTaskCtx;
5143 ioc->InternalCtx = mptsasInternalCtx; 5159 ioc->InternalCtx = mptsasInternalCtx;
5144 ioc->schedule_target_reset = &mptsas_schedule_target_reset; 5160 ioc->schedule_target_reset = &mptsas_schedule_target_reset;
5161 ioc->schedule_dead_ioc_flush_running_cmds =
5162 &mptscsih_flush_running_cmds;
5145 /* Added sanity check on readiness of the MPT adapter. 5163 /* Added sanity check on readiness of the MPT adapter.
5146 */ 5164 */
5147 if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) { 5165 if (ioc->last_state != MPI_IOC_STATE_OPERATIONAL) {
@@ -5239,6 +5257,21 @@ mptsas_probe(struct pci_dev *pdev, const struct pci_device_id *id)
5239 sh->sg_tablesize = numSGE; 5257 sh->sg_tablesize = numSGE;
5240 } 5258 }
5241 5259
5260 if (mpt_loadtime_max_sectors) {
5261 if (mpt_loadtime_max_sectors < 64 ||
5262 mpt_loadtime_max_sectors > 8192) {
5263 printk(MYIOC_s_INFO_FMT "Invalid value passed for"
5264 "mpt_loadtime_max_sectors %d."
5265 "Range from 64 to 8192\n", ioc->name,
5266 mpt_loadtime_max_sectors);
5267 }
5268 mpt_loadtime_max_sectors &= 0xFFFFFFFE;
5269 dprintk(ioc, printk(MYIOC_s_DEBUG_FMT
5270 "Resetting max sector to %d from %d\n",
5271 ioc->name, mpt_loadtime_max_sectors, sh->max_sectors));
5272 sh->max_sectors = mpt_loadtime_max_sectors;
5273 }
5274
5242 hd = shost_priv(sh); 5275 hd = shost_priv(sh);
5243 hd->ioc = ioc; 5276 hd->ioc = ioc;
5244 5277