diff options
author | Seokmann Ju <seokmann.ju@qlogic.com> | 2008-04-03 16:13:30 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@HansenPartnership.com> | 2008-04-07 13:19:16 -0400 |
commit | bd2a1846b2313e32d0270151a31a6b8335384a20 (patch) | |
tree | 6e14558f0504ffdf308911ad4dc3a39781b70043 /drivers/scsi/qla2xxx | |
parent | 463717edc9d675ead14b02f060425ff7860d1dc1 (diff) |
[SCSI] qla2xxx: Use proper HA during asynchrounous event handling.
Changes are added to the driver so that it can behave properly
upon having asynchronous events, for example, addition of target
devices to the VPs.
Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-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_isr.c | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 360af4e09d12..285479b62d8f 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -272,6 +272,8 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
272 | uint32_t rscn_entry, host_pid; | 272 | uint32_t rscn_entry, host_pid; |
273 | uint8_t rscn_queue_index; | 273 | uint8_t rscn_queue_index; |
274 | unsigned long flags; | 274 | unsigned long flags; |
275 | scsi_qla_host_t *vha; | ||
276 | int i; | ||
275 | 277 | ||
276 | /* Setup to process RIO completion. */ | 278 | /* Setup to process RIO completion. */ |
277 | handle_cnt = 0; | 279 | handle_cnt = 0; |
@@ -542,6 +544,18 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
542 | break; | 544 | break; |
543 | 545 | ||
544 | case MBA_PORT_UPDATE: /* Port database update */ | 546 | case MBA_PORT_UPDATE: /* Port database update */ |
547 | if ((ha->flags.npiv_supported) && (ha->num_vhosts)) { | ||
548 | for_each_mapped_vp_idx(ha, i) { | ||
549 | list_for_each_entry(vha, &ha->vp_list, | ||
550 | vp_list) { | ||
551 | if ((mb[3] & 0xff) | ||
552 | == vha->vp_idx) { | ||
553 | ha = vha; | ||
554 | break; | ||
555 | } | ||
556 | } | ||
557 | } | ||
558 | } | ||
545 | /* | 559 | /* |
546 | * If PORT UPDATE is global (recieved LIP_OCCURED/LIP_RESET | 560 | * If PORT UPDATE is global (recieved LIP_OCCURED/LIP_RESET |
547 | * event etc. earlier indicating loop is down) then process | 561 | * event etc. earlier indicating loop is down) then process |
@@ -576,12 +590,18 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
576 | break; | 590 | break; |
577 | 591 | ||
578 | case MBA_RSCN_UPDATE: /* State Change Registration */ | 592 | case MBA_RSCN_UPDATE: /* State Change Registration */ |
579 | /* Check if the Vport has issued a SCR */ | 593 | if ((ha->flags.npiv_supported) && (ha->num_vhosts)) { |
580 | if (ha->parent && test_bit(VP_SCR_NEEDED, &ha->vp_flags)) | 594 | for_each_mapped_vp_idx(ha, i) { |
581 | break; | 595 | list_for_each_entry(vha, &ha->vp_list, |
582 | /* Only handle SCNs for our Vport index. */ | 596 | vp_list) { |
583 | if (ha->flags.npiv_supported && ha->vp_idx != mb[3]) | 597 | if ((mb[3] & 0xff) |
584 | break; | 598 | == vha->vp_idx) { |
599 | ha = vha; | ||
600 | break; | ||
601 | } | ||
602 | } | ||
603 | } | ||
604 | } | ||
585 | 605 | ||
586 | DEBUG2(printk("scsi(%ld): Asynchronous RSCR UPDATE.\n", | 606 | DEBUG2(printk("scsi(%ld): Asynchronous RSCR UPDATE.\n", |
587 | ha->host_no)); | 607 | ha->host_no)); |