diff options
Diffstat (limited to 'drivers/target/target_core_tmr.c')
-rw-r--r-- | drivers/target/target_core_tmr.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c index dcb0618c9388..a5c2e41debf8 100644 --- a/drivers/target/target_core_tmr.c +++ b/drivers/target/target_core_tmr.c | |||
@@ -150,7 +150,7 @@ static void core_tmr_drain_tmr_list( | |||
150 | continue; | 150 | continue; |
151 | 151 | ||
152 | spin_lock(&cmd->t_state_lock); | 152 | spin_lock(&cmd->t_state_lock); |
153 | if (!atomic_read(&cmd->t_transport_active)) { | 153 | if (!(cmd->transport_state & CMD_T_ACTIVE)) { |
154 | spin_unlock(&cmd->t_state_lock); | 154 | spin_unlock(&cmd->t_state_lock); |
155 | continue; | 155 | continue; |
156 | } | 156 | } |
@@ -255,15 +255,15 @@ static void core_tmr_drain_task_list( | |||
255 | cmd->t_task_cdb[0]); | 255 | cmd->t_task_cdb[0]); |
256 | pr_debug("LUN_RESET: ITT[0x%08x] - pr_res_key: 0x%016Lx" | 256 | pr_debug("LUN_RESET: ITT[0x%08x] - pr_res_key: 0x%016Lx" |
257 | " t_task_cdbs: %d t_task_cdbs_left: %d" | 257 | " t_task_cdbs: %d t_task_cdbs_left: %d" |
258 | " t_task_cdbs_sent: %d -- t_transport_active: %d" | 258 | " t_task_cdbs_sent: %d -- CMD_T_ACTIVE: %d" |
259 | " t_transport_stop: %d t_transport_sent: %d\n", | 259 | " CMD_T_STOP: %d CMD_T_SENT: %d\n", |
260 | cmd->se_tfo->get_task_tag(cmd), cmd->pr_res_key, | 260 | cmd->se_tfo->get_task_tag(cmd), cmd->pr_res_key, |
261 | cmd->t_task_list_num, | 261 | cmd->t_task_list_num, |
262 | atomic_read(&cmd->t_task_cdbs_left), | 262 | atomic_read(&cmd->t_task_cdbs_left), |
263 | atomic_read(&cmd->t_task_cdbs_sent), | 263 | atomic_read(&cmd->t_task_cdbs_sent), |
264 | atomic_read(&cmd->t_transport_active), | 264 | (cmd->transport_state & CMD_T_ACTIVE) != 0, |
265 | atomic_read(&cmd->t_transport_stop), | 265 | (cmd->transport_state & CMD_T_STOP) != 0, |
266 | atomic_read(&cmd->t_transport_sent)); | 266 | (cmd->transport_state & CMD_T_SENT) != 0); |
267 | 267 | ||
268 | /* | 268 | /* |
269 | * If the command may be queued onto a workqueue cancel it now. | 269 | * If the command may be queued onto a workqueue cancel it now. |
@@ -287,19 +287,19 @@ static void core_tmr_drain_task_list( | |||
287 | } | 287 | } |
288 | fe_count = atomic_read(&cmd->t_fe_count); | 288 | fe_count = atomic_read(&cmd->t_fe_count); |
289 | 289 | ||
290 | if (atomic_read(&cmd->t_transport_active)) { | 290 | if (!(cmd->transport_state & CMD_T_ACTIVE)) { |
291 | pr_debug("LUN_RESET: got t_transport_active = 1 for" | 291 | pr_debug("LUN_RESET: got CMD_T_ACTIVE for" |
292 | " task: %p, t_fe_count: %d dev: %p\n", task, | 292 | " task: %p, t_fe_count: %d dev: %p\n", task, |
293 | fe_count, dev); | 293 | fe_count, dev); |
294 | atomic_set(&cmd->t_transport_aborted, 1); | 294 | cmd->transport_state |= CMD_T_ABORTED; |
295 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | 295 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); |
296 | 296 | ||
297 | core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count); | 297 | core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count); |
298 | continue; | 298 | continue; |
299 | } | 299 | } |
300 | pr_debug("LUN_RESET: Got t_transport_active = 0 for task: %p," | 300 | pr_debug("LUN_RESET: Got !CMD_T_ACTIVE for task: %p," |
301 | " t_fe_count: %d dev: %p\n", task, fe_count, dev); | 301 | " t_fe_count: %d dev: %p\n", task, fe_count, dev); |
302 | atomic_set(&cmd->t_transport_aborted, 1); | 302 | cmd->transport_state |= CMD_T_ABORTED; |
303 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); | 303 | spin_unlock_irqrestore(&cmd->t_state_lock, flags); |
304 | 304 | ||
305 | core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count); | 305 | core_tmr_handle_tas_abort(tmr_nacl, cmd, tas, fe_count); |
@@ -339,7 +339,7 @@ static void core_tmr_drain_cmd_list( | |||
339 | if (prout_cmd == cmd) | 339 | if (prout_cmd == cmd) |
340 | continue; | 340 | continue; |
341 | 341 | ||
342 | atomic_set(&cmd->t_transport_queue_active, 0); | 342 | cmd->transport_state &= ~CMD_T_QUEUED; |
343 | atomic_dec(&qobj->queue_cnt); | 343 | atomic_dec(&qobj->queue_cnt); |
344 | list_move_tail(&cmd->se_queue_node, &drain_cmd_list); | 344 | list_move_tail(&cmd->se_queue_node, &drain_cmd_list); |
345 | } | 345 | } |