diff options
author | Mike Christie <michaelc@cs.wisc.edu> | 2008-08-17 16:24:40 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-10-13 09:28:46 -0400 |
commit | 7b594131c4f38edeb13d8c6c0147949173c47013 (patch) | |
tree | c8c8d063eda1067b23d438ad4e82c3e889f9c69c /drivers/scsi/qla2xxx | |
parent | c5e98e912c5423a0ec2eed7aa1064578d44f8a8e (diff) |
[SCSI] qla2xxx: return SCSI_MLQUEUE_TARGET_BUSY when driver has detected rport error or race
If the fcport is not online then we do not want to block IO to all ports on
the host. We just want to stop IO on port not online, so we should be using
the SCSI_MLQUEUE_TARGET_BUSY return value.
For the case where we race with the rport memset initialization
we do not want the queuecommand to be called again so we can just use
SCSI_MLQUEUE_TARGET_BUSY for this.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Acked-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 26 |
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 | ||
429 | qc_host_busy_lock: | 427 | qc_host_busy_lock: |
430 | spin_lock_irq(ha->host->host_lock); | 428 | spin_lock_irq(ha->host->host_lock); |
431 | |||
432 | qc_host_busy: | ||
433 | return SCSI_MLQUEUE_HOST_BUSY; | 429 | return SCSI_MLQUEUE_HOST_BUSY; |
434 | 430 | ||
431 | qc_target_busy: | ||
432 | return SCSI_MLQUEUE_TARGET_BUSY; | ||
433 | |||
435 | qc_fail_command: | 434 | qc_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 | ||
496 | qc24_host_busy_lock: | 493 | qc24_host_busy_lock: |
497 | spin_lock_irq(ha->host->host_lock); | 494 | spin_lock_irq(ha->host->host_lock); |
498 | |||
499 | qc24_host_busy: | ||
500 | return SCSI_MLQUEUE_HOST_BUSY; | 495 | return SCSI_MLQUEUE_HOST_BUSY; |
501 | 496 | ||
497 | qc24_target_busy: | ||
498 | return SCSI_MLQUEUE_TARGET_BUSY; | ||
499 | |||
502 | qc24_fail_command: | 500 | qc24_fail_command: |
503 | done(cmd); | 501 | done(cmd); |
504 | 502 | ||