/* Sets the FW busy flag and reduces the host->can_queue if the cmd has not been completed within the timeout period.  */
static enum blk_eh_timer_return megasas_reset_timer(struct scsi_cmnd *scmd)
/* Sets the FW busy flag and reduces the host->can_queue if the cmd has not been completed within the timeout period.  */
static enum blk_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 BLK_EH_NOT_HANDLED;
	}
	instance = cmd->instance;
	if (!(instance->flag & MEGASAS_FW_BUSY)) {
		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 BLK_EH_RESET_TIMER;
}