summaryrefslogtreecommitdiff
path: root/drivers/scsi
diff options
context:
space:
mode:
authorSeokmann Ju <seokmann.ju@qlogic.com>2008-04-03 20:13:30 (GMT)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-04-07 17:19:16 (GMT)
commitbd2a1846b2313e32d0270151a31a6b8335384a20 (patch)
tree6e14558f0504ffdf308911ad4dc3a39781b70043 /drivers/scsi
parent463717edc9d675ead14b02f060425ff7860d1dc1 (diff)
downloadlinux-fsl-qoriq-bd2a1846b2313e32d0270151a31a6b8335384a20.tar.xz
[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')
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c32
1 files changed, 26 insertions, 6 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index 360af4e..285479b 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)
uint32_t rscn_entry, host_pid;
uint8_t rscn_queue_index;
unsigned long flags;
+ scsi_qla_host_t *vha;
+ int i;
/* Setup to process RIO completion. */
handle_cnt = 0;
@@ -542,6 +544,18 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
break;
case MBA_PORT_UPDATE: /* Port database update */
+ if ((ha->flags.npiv_supported) && (ha->num_vhosts)) {
+ for_each_mapped_vp_idx(ha, i) {
+ list_for_each_entry(vha, &ha->vp_list,
+ vp_list) {
+ if ((mb[3] & 0xff)
+ == vha->vp_idx) {
+ ha = vha;
+ break;
+ }
+ }
+ }
+ }
/*
* If PORT UPDATE is global (recieved LIP_OCCURED/LIP_RESET
* event etc. earlier indicating loop is down) then process
@@ -576,12 +590,18 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
break;
case MBA_RSCN_UPDATE: /* State Change Registration */
- /* Check if the Vport has issued a SCR */
- if (ha->parent && test_bit(VP_SCR_NEEDED, &ha->vp_flags))
- break;
- /* Only handle SCNs for our Vport index. */
- if (ha->flags.npiv_supported && ha->vp_idx != mb[3])
- break;
+ if ((ha->flags.npiv_supported) && (ha->num_vhosts)) {
+ for_each_mapped_vp_idx(ha, i) {
+ list_for_each_entry(vha, &ha->vp_list,
+ vp_list) {
+ if ((mb[3] & 0xff)
+ == vha->vp_idx) {
+ ha = vha;
+ break;
+ }
+ }
+ }
+ }
DEBUG2(printk("scsi(%ld): Asynchronous RSCR UPDATE.\n",
ha->host_no));