aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_os.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_os.c')
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 3433441b956a..2aed4721c0d0 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -394,10 +394,8 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
394 } 394 }
395 395
396 /* Close window on fcport/rport state-transitioning. */ 396 /* Close window on fcport/rport state-transitioning. */
397 if (fcport->drport) { 397 if (fcport->drport)
398 cmd->result = DID_IMM_RETRY << 16; 398 goto qc_target_busy;
399 goto qc_fail_command;
400 }
401 399
402 if (atomic_read(&fcport->state) != FCS_ONLINE) { 400 if (atomic_read(&fcport->state) != FCS_ONLINE) {
403 if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || 401 if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
@@ -405,7 +403,7 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
405 cmd->result = DID_NO_CONNECT << 16; 403 cmd->result = DID_NO_CONNECT << 16;
406 goto qc_fail_command; 404 goto qc_fail_command;
407 } 405 }
408 goto qc_host_busy; 406 goto qc_target_busy;
409 } 407 }
410 408
411 spin_unlock_irq(ha->host->host_lock); 409 spin_unlock_irq(ha->host->host_lock);
@@ -428,10 +426,11 @@ qc_host_busy_free_sp:
428 426
429qc_host_busy_lock: 427qc_host_busy_lock:
430 spin_lock_irq(ha->host->host_lock); 428 spin_lock_irq(ha->host->host_lock);
431
432qc_host_busy:
433 return SCSI_MLQUEUE_HOST_BUSY; 429 return SCSI_MLQUEUE_HOST_BUSY;
434 430
431qc_target_busy:
432 return SCSI_MLQUEUE_TARGET_BUSY;
433
435qc_fail_command: 434qc_fail_command:
436 done(cmd); 435 done(cmd);
437 436
@@ -461,10 +460,8 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
461 } 460 }
462 461
463 /* Close window on fcport/rport state-transitioning. */ 462 /* Close window on fcport/rport state-transitioning. */
464 if (fcport->drport) { 463 if (fcport->drport)
465 cmd->result = DID_IMM_RETRY << 16; 464 goto qc24_target_busy;
466 goto qc24_fail_command;
467 }
468 465
469 if (atomic_read(&fcport->state) != FCS_ONLINE) { 466 if (atomic_read(&fcport->state) != FCS_ONLINE) {
470 if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || 467 if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
@@ -472,7 +469,7 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
472 cmd->result = DID_NO_CONNECT << 16; 469 cmd->result = DID_NO_CONNECT << 16;
473 goto qc24_fail_command; 470 goto qc24_fail_command;
474 } 471 }
475 goto qc24_host_busy; 472 goto qc24_target_busy;
476 } 473 }
477 474
478 spin_unlock_irq(ha->host->host_lock); 475 spin_unlock_irq(ha->host->host_lock);
@@ -495,10 +492,11 @@ qc24_host_busy_free_sp:
495 492
496qc24_host_busy_lock: 493qc24_host_busy_lock:
497 spin_lock_irq(ha->host->host_lock); 494 spin_lock_irq(ha->host->host_lock);
498
499qc24_host_busy:
500 return SCSI_MLQUEUE_HOST_BUSY; 495 return SCSI_MLQUEUE_HOST_BUSY;
501 496
497qc24_target_busy:
498 return SCSI_MLQUEUE_TARGET_BUSY;
499
502qc24_fail_command: 500qc24_fail_command:
503 done(cmd); 501 done(cmd);
504 502