diff options
| author | Giridhar Malavali <giridhar.malavali@qlogic.com> | 2010-10-15 14:27:49 -0400 |
|---|---|---|
| committer | James Bottomley <James.Bottomley@suse.de> | 2010-10-25 17:04:12 -0400 |
| commit | 38170fa8e66bb75fe806bdc91657732aef0eae90 (patch) | |
| tree | 1130ec0eede771d40b82ffa58cd1216faae0ffaa | |
| parent | 9dac0d9a93095ff5a27b975af30c25186bdcfeab (diff) | |
[SCSI] qla2xxx: Avoid depending on SCSI host_lock in queuecommand function.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
| -rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 8 | ||||
| -rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 2 | ||||
| -rw-r--r-- | drivers/scsi/qla2xxx/qla_os.c | 14 |
3 files changed, 11 insertions, 13 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index a9ceb39751a1..bc8194f74625 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
| @@ -1538,6 +1538,10 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport) | |||
| 1538 | if (!fcport) | 1538 | if (!fcport) |
| 1539 | return; | 1539 | return; |
| 1540 | 1540 | ||
| 1541 | /* Now that the rport has been deleted, set the fcport state to | ||
| 1542 | FCS_DEVICE_DEAD */ | ||
| 1543 | atomic_set(&fcport->state, FCS_DEVICE_DEAD); | ||
| 1544 | |||
| 1541 | /* | 1545 | /* |
| 1542 | * Transport has effectively 'deleted' the rport, clear | 1546 | * Transport has effectively 'deleted' the rport, clear |
| 1543 | * all local references. | 1547 | * all local references. |
| @@ -1547,10 +1551,6 @@ qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport) | |||
| 1547 | *((fc_port_t **)rport->dd_data) = NULL; | 1551 | *((fc_port_t **)rport->dd_data) = NULL; |
| 1548 | spin_unlock_irq(host->host_lock); | 1552 | spin_unlock_irq(host->host_lock); |
| 1549 | 1553 | ||
| 1550 | /* Now that the rport has been deleted, set the fcport state to | ||
| 1551 | FCS_DEVICE_DEAD */ | ||
| 1552 | atomic_set(&fcport->state, FCS_DEVICE_DEAD); | ||
| 1553 | |||
| 1554 | if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags)) | 1554 | if (test_bit(ABORT_ISP_ACTIVE, &fcport->vha->dpc_flags)) |
| 1555 | return; | 1555 | return; |
| 1556 | 1556 | ||
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index a7ad22bf77e0..259f51137493 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
| @@ -2928,8 +2928,8 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) | |||
| 2928 | fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT); | 2928 | fcport->flags &= ~(FCF_LOGIN_NEEDED | FCF_ASYNC_SENT); |
| 2929 | 2929 | ||
| 2930 | qla2x00_iidma_fcport(vha, fcport); | 2930 | qla2x00_iidma_fcport(vha, fcport); |
| 2931 | atomic_set(&fcport->state, FCS_ONLINE); | ||
| 2932 | qla2x00_reg_remote_port(vha, fcport); | 2931 | qla2x00_reg_remote_port(vha, fcport); |
| 2932 | atomic_set(&fcport->state, FCS_ONLINE); | ||
| 2933 | } | 2933 | } |
| 2934 | 2934 | ||
| 2935 | /* | 2935 | /* |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index 02232deaf82d..1830e6e97315 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
| @@ -545,6 +545,7 @@ qla2xxx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | |||
| 545 | srb_t *sp; | 545 | srb_t *sp; |
| 546 | int rval; | 546 | int rval; |
| 547 | 547 | ||
| 548 | spin_unlock_irq(vha->host->host_lock); | ||
| 548 | if (ha->flags.eeh_busy) { | 549 | if (ha->flags.eeh_busy) { |
| 549 | if (ha->flags.pci_channel_io_perm_failure) | 550 | if (ha->flags.pci_channel_io_perm_failure) |
| 550 | cmd->result = DID_NO_CONNECT << 16; | 551 | cmd->result = DID_NO_CONNECT << 16; |
| @@ -559,10 +560,6 @@ qla2xxx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | |||
| 559 | goto qc24_fail_command; | 560 | goto qc24_fail_command; |
| 560 | } | 561 | } |
| 561 | 562 | ||
| 562 | /* Close window on fcport/rport state-transitioning. */ | ||
| 563 | if (fcport->drport) | ||
| 564 | goto qc24_target_busy; | ||
| 565 | |||
| 566 | if (!vha->flags.difdix_supported && | 563 | if (!vha->flags.difdix_supported && |
| 567 | scsi_get_prot_op(cmd) != SCSI_PROT_NORMAL) { | 564 | scsi_get_prot_op(cmd) != SCSI_PROT_NORMAL) { |
| 568 | DEBUG2(qla_printk(KERN_ERR, ha, | 565 | DEBUG2(qla_printk(KERN_ERR, ha, |
| @@ -573,15 +570,14 @@ qla2xxx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)) | |||
| 573 | } | 570 | } |
| 574 | if (atomic_read(&fcport->state) != FCS_ONLINE) { | 571 | if (atomic_read(&fcport->state) != FCS_ONLINE) { |
| 575 | if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || | 572 | if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || |
| 576 | atomic_read(&base_vha->loop_state) == LOOP_DEAD) { | 573 | atomic_read(&fcport->state) == FCS_DEVICE_LOST || |
| 574 | atomic_read(&base_vha->loop_state) == LOOP_DEAD) { | ||
| 577 | cmd->result = DID_NO_CONNECT << 16; | 575 | cmd->result = DID_NO_CONNECT << 16; |
| 578 | goto qc24_fail_command; | 576 | goto qc24_fail_command; |
| 579 | } | 577 | } |
| 580 | goto qc24_target_busy; | 578 | goto qc24_target_busy; |
| 581 | } | 579 | } |
| 582 | 580 | ||
| 583 | spin_unlock_irq(vha->host->host_lock); | ||
| 584 | |||
| 585 | sp = qla2x00_get_new_sp(base_vha, fcport, cmd, done); | 581 | sp = qla2x00_get_new_sp(base_vha, fcport, cmd, done); |
| 586 | if (!sp) | 582 | if (!sp) |
| 587 | goto qc24_host_busy_lock; | 583 | goto qc24_host_busy_lock; |
| @@ -603,9 +599,11 @@ qc24_host_busy_lock: | |||
| 603 | return SCSI_MLQUEUE_HOST_BUSY; | 599 | return SCSI_MLQUEUE_HOST_BUSY; |
| 604 | 600 | ||
| 605 | qc24_target_busy: | 601 | qc24_target_busy: |
| 602 | spin_lock_irq(vha->host->host_lock); | ||
| 606 | return SCSI_MLQUEUE_TARGET_BUSY; | 603 | return SCSI_MLQUEUE_TARGET_BUSY; |
| 607 | 604 | ||
| 608 | qc24_fail_command: | 605 | qc24_fail_command: |
| 606 | spin_lock_irq(vha->host->host_lock); | ||
| 609 | done(cmd); | 607 | done(cmd); |
| 610 | 608 | ||
| 611 | return 0; | 609 | return 0; |
| @@ -2613,12 +2611,12 @@ qla2x00_mark_all_devices_lost(scsi_qla_host_t *vha, int defer) | |||
| 2613 | if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD) | 2611 | if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD) |
| 2614 | continue; | 2612 | continue; |
| 2615 | if (atomic_read(&fcport->state) == FCS_ONLINE) { | 2613 | if (atomic_read(&fcport->state) == FCS_ONLINE) { |
| 2614 | atomic_set(&fcport->state, FCS_DEVICE_LOST); | ||
| 2616 | if (defer) | 2615 | if (defer) |
| 2617 | qla2x00_schedule_rport_del(vha, fcport, defer); | 2616 | qla2x00_schedule_rport_del(vha, fcport, defer); |
| 2618 | else if (vha->vp_idx == fcport->vp_idx) | 2617 | else if (vha->vp_idx == fcport->vp_idx) |
| 2619 | qla2x00_schedule_rport_del(vha, fcport, defer); | 2618 | qla2x00_schedule_rport_del(vha, fcport, defer); |
| 2620 | } | 2619 | } |
| 2621 | atomic_set(&fcport->state, FCS_DEVICE_LOST); | ||
| 2622 | } | 2620 | } |
| 2623 | } | 2621 | } |
| 2624 | 2622 | ||
