{PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1064R)},
/* xscale IOP */
{PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1078R)},
+ /* ppc IOP */
{PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_SAS1078DE)},
/* ppc IOP */
{PCI_DEVICE(PCI_VENDOR_ID_LSI_LOGIC, PCI_DEVICE_ID_LSI_VERDE_ZCR)},
*
* Returns the number of frames required for numnber of sge's (sge_count)
*/
-
static u32 megasas_get_frame_count(u8 sge_count, u8 frame_type)
{
int num_cnt;
u32 frame_count;
struct megasas_cmd *cmd;
struct megasas_instance *instance;
+ unsigned long sec;
instance = (struct megasas_instance *)
scmd->device->host->hostdata;
goto out_done;
}
+ /* If FW is busy donot accept any more cmds */
+ if(instance->is_busy){
+ sec = (jiffies - instance->last_time) / HZ;
+ if(sec<10)
+ return SCSI_MLQUEUE_HOST_BUSY;
+ else{
+ instance->is_busy=0;
+ instance->last_time=0;
+ }
+ }
+
+ if(scmd->retries>1){
+ instance->is_busy=1;
+ instance->last_time=jiffies;
+ }
+
cmd = megasas_get_cmd(instance);
if (!cmd)
return SCSI_MLQUEUE_HOST_BUSY;
goto out_return_cmd;
cmd->scmd = scmd;
- scmd->SCp.ptr = (char *)cmd;
/*
* Issue the command to the FW
* The RAID firmware may require extended timeouts.
*/
if (sdev->channel >= MEGASAS_MAX_PD_CHANNELS)
- sdev->timeout = MEGASAS_DEFAULT_CMD_TIMEOUT * HZ;
+ sdev->timeout = 90 * HZ;
return 0;
}
return ret_val;
}
- /**
- * megasas_reset_timer - quiesce the adapter if required
- * @scmd: scsi cmnd
- *
- * Sets the FW busy flag and reduces the host->can_queue if the
- * cmd has not been completed within the timeout period.
- */
-static enum
-scsi_eh_timer_return megasas_reset_timer(struct scsi_cmnd *scmd)
-{
- struct megasas_cmd *cmd = (struct megasas_cmd *)scmd->SCp.ptr;
- struct megasas_instance *instance;
- unsigned long flags;
-
- if (time_after(jiffies, scmd->jiffies_at_alloc +
- (MEGASAS_DEFAULT_CMD_TIMEOUT * 2) * HZ)) {
- return EH_NOT_HANDLED;
- }
-
- instance = cmd->instance;
- if (!(instance->flag & MEGASAS_FW_BUSY)) {
- /* FW is busy, throttle IO */
- spin_lock_irqsave(instance->host->host_lock, flags);
-
- instance->host->can_queue = 16;
- instance->last_time = jiffies;
- instance->flag |= MEGASAS_FW_BUSY;
-
- spin_unlock_irqrestore(instance->host->host_lock, flags);
- }
- return EH_RESET_TIMER;
-}
-
/**
* megasas_reset_device - Device reset handler entry point
*/
.eh_device_reset_handler = megasas_reset_device,
.eh_bus_reset_handler = megasas_reset_bus_host,
.eh_host_reset_handler = megasas_reset_bus_host,
- .eh_timed_out = megasas_reset_timer,
.bios_param = megasas_bios_param,
.use_clustering = ENABLE_CLUSTERING,
};
{
int exception = 0;
struct megasas_header *hdr = &cmd->frame->hdr;
- unsigned long flags;
-
- if (cmd->scmd)
- cmd->scmd->SCp.ptr = NULL;
+ int outstanding;
switch (hdr->cmd) {
hdr->cmd);
break;
}
-
- /*
- * Check if we can restore can_queue
- */
- if (instance->flag & MEGASAS_FW_BUSY
- && time_after(jiffies, instance->last_time + 5 * HZ)
- && atomic_read(&instance->fw_outstanding) < 17) {
-
- spin_lock_irqsave(instance->host->host_lock, flags);
- instance->flag &= ~MEGASAS_FW_BUSY;
- instance->host->can_queue =
- instance->max_fw_cmds - MEGASAS_INT_CMDS;
- spin_unlock_irqrestore(instance->host->host_lock, flags);
+ if(instance->is_busy){
+ outstanding = atomic_read(&instance->fw_outstanding);
+ if(outstanding<17)
+ instance->is_busy=0;
}
-
}
/**
/**
* megasas_isr - isr entry point
*/
-static irqreturn_t megasas_isr(int irq, void *devp)
+static irqreturn_t megasas_isr(int irq, void *devp, struct pt_regs *regs)
{
return megasas_deplete_reply_queue((struct megasas_instance *)devp,
DID_OK);
timer->data = (unsigned long)instance;
timer->function = fn;
add_timer(timer);
- }
+}
/**
* megasas_io_completion_timer - Timer fn
}
instance->max_sectors_per_req = instance->max_num_sge *
- PAGE_SIZE / 512;
+ PAGE_SIZE / 512;
if (tmp_sectors && (instance->max_sectors_per_req > tmp_sectors))
instance->max_sectors_per_req = tmp_sectors;
instance->init_id = MEGASAS_DEFAULT_INIT_ID;
megasas_dbg_lvl = 0;
- instance->flag = 0;
- instance->last_time = 0;
+ instance->is_busy=0;
+ instance->last_time=0;
/*
* Initialize MFI Firmware
if (poll_mode_io)
del_timer_sync(&instance->io_completion_timer);
+
sysfs_remove_bin_file(&host->shost_classdev.kobj, &sysfs_max_sectors_attr);
scsi_remove_host(instance->host);
megasas_flush_cache(instance);
* sense_buff points to the location that has the user
* sense buffer address
*/
+
sense_buff = (unsigned long *) ((unsigned long)ioc->frame.raw +
ioc->sense_off);
sense_ptr = (u32 *) ((unsigned long)ioc->frame.raw +
goto err_dcf_poll_mode_io;
return rval;
-
err_dcf_poll_mode_io:
driver_remove_file(&megasas_pci_driver.driver,
&driver_attr_dbg_lvl);
*/
static void __exit megasas_exit(void)
{
- driver_remove_file(&megasas_pci_driver.driver,
+ driver_remove_file(&megasas_pci_driver.driver,
&driver_attr_poll_mode_io);
driver_remove_file(&megasas_pci_driver.driver,
&driver_attr_dbg_lvl);