mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-29 18:00:18 +00:00
Minor TM-related fixes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@80 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -2270,7 +2270,7 @@ static int tm_dbg_state;
|
||||
static int tm_dbg_on_state_passes;
|
||||
static DEFINE_TIMER(tm_dbg_timer, tm_dbg_timer_fn, 0, 0);
|
||||
|
||||
static const int tm_dbg_on_state_num_passes[] = { 10, 1, 0x7ffffff };
|
||||
static const int tm_dbg_on_state_num_passes[] = { 5, 1, 0x7ffffff };
|
||||
|
||||
void tm_dbg_init_tgt_dev(struct scst_tgt_dev *tgt_dev,
|
||||
struct scst_acg_dev *acg_dev)
|
||||
@@ -2308,16 +2308,20 @@ static void tm_dbg_delay_cmd(struct scst_cmd *cmd)
|
||||
if (tm_dbg_delayed_cmds_count == 0) {
|
||||
unsigned long d = 58*HZ + (scst_random() % (4*HZ));
|
||||
TRACE_MGMT_DBG("%s: delaying timed cmd %p (tag %d) "
|
||||
"for %ld.%ld seconds (%ld HZ)", __func__, cmd, cmd->tag,
|
||||
d/HZ, (d%HZ)*100/HZ, d);
|
||||
"for %ld.%ld seconds (%ld HZ), "
|
||||
"tm_dbg_on_state_passes=%d", __func__, cmd,
|
||||
cmd->tag, d/HZ, (d%HZ)*100/HZ, d,
|
||||
tm_dbg_on_state_passes);
|
||||
mod_timer(&tm_dbg_timer, jiffies + d);
|
||||
#if 0
|
||||
tm_dbg_blocked = 1;
|
||||
#endif
|
||||
} else {
|
||||
TRACE_MGMT_DBG("%s: delaying another timed cmd %p "
|
||||
"(tag %d), delayed_cmds_count=%d", __func__, cmd,
|
||||
cmd->tag, tm_dbg_delayed_cmds_count);
|
||||
"(tag %d), delayed_cmds_count=%d, "
|
||||
"tm_dbg_on_state_passes=%d", __func__, cmd,
|
||||
cmd->tag, tm_dbg_delayed_cmds_count,
|
||||
tm_dbg_on_state_passes);
|
||||
if (tm_dbg_delayed_cmds_count == 2)
|
||||
tm_dbg_blocked = 0;
|
||||
}
|
||||
@@ -2326,8 +2330,10 @@ static void tm_dbg_delay_cmd(struct scst_cmd *cmd)
|
||||
case TM_DBG_STATE_RESET:
|
||||
case TM_DBG_STATE_OFFLINE:
|
||||
TRACE_MGMT_DBG("%s: delaying cmd %p "
|
||||
"(tag %d), delayed_cmds_count=%d", __func__, cmd,
|
||||
cmd->tag, tm_dbg_delayed_cmds_count);
|
||||
"(tag %d), delayed_cmds_count=%d, "
|
||||
"tm_dbg_on_state_passes=%d", __func__, cmd,
|
||||
cmd->tag, tm_dbg_delayed_cmds_count,
|
||||
tm_dbg_on_state_passes);
|
||||
tm_dbg_blocked = 1;
|
||||
break;
|
||||
|
||||
|
||||
@@ -722,6 +722,8 @@ void scst_restart_cmd(struct scst_cmd *cmd, int status, int pref_context)
|
||||
scst_cmd_set_sn(cmd);
|
||||
spin_unlock_irqrestore(&scst_list_lock, flags);
|
||||
}
|
||||
if (tm_dbg_check_cmd(cmd) != 0)
|
||||
goto out;
|
||||
break;
|
||||
|
||||
case SCST_PREPROCESS_STATUS_ERROR_SENSE_SET:
|
||||
@@ -3403,7 +3405,7 @@ static void scst_mgmt_cmd_send_done(struct scst_mgmt_cmd *mcmd)
|
||||
|
||||
mcmd->state = SCST_MGMT_CMD_STATE_FINISHED;
|
||||
if (scst_is_strict_mgmt_fn(mcmd->fn) && (mcmd->completed_cmd_count > 0))
|
||||
mcmd->status = SCST_MGMT_STATUS_FAILED;
|
||||
mcmd->status = SCST_MGMT_STATUS_TASK_NOT_EXIST;
|
||||
|
||||
if (mcmd->sess->tgt->tgtt->task_mgmt_fn_done) {
|
||||
TRACE_DBG("Calling target %s task_mgmt_fn_done()",
|
||||
|
||||
Reference in New Issue
Block a user