diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_isr.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_isr.c | 63 |
1 files changed, 14 insertions, 49 deletions
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index 5d9a64a7879b..ec63b79f900a 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -272,8 +272,6 @@ 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; | ||
277 | 275 | ||
278 | /* Setup to process RIO completion. */ | 276 | /* Setup to process RIO completion. */ |
279 | handle_cnt = 0; | 277 | handle_cnt = 0; |
@@ -544,18 +542,10 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
544 | break; | 542 | break; |
545 | 543 | ||
546 | case MBA_PORT_UPDATE: /* Port database update */ | 544 | case MBA_PORT_UPDATE: /* Port database update */ |
547 | if ((ha->flags.npiv_supported) && (ha->num_vhosts)) { | 545 | /* Only handle SCNs for our Vport index. */ |
548 | for_each_mapped_vp_idx(ha, i) { | 546 | if (ha->parent && ha->vp_idx != (mb[3] & 0xff)) |
549 | list_for_each_entry(vha, &ha->vp_list, | 547 | break; |
550 | vp_list) { | 548 | |
551 | if ((mb[3] & 0xff) | ||
552 | == vha->vp_idx) { | ||
553 | ha = vha; | ||
554 | break; | ||
555 | } | ||
556 | } | ||
557 | } | ||
558 | } | ||
559 | /* | 549 | /* |
560 | * If PORT UPDATE is global (recieved LIP_OCCURED/LIP_RESET | 550 | * If PORT UPDATE is global (recieved LIP_OCCURED/LIP_RESET |
561 | * event etc. earlier indicating loop is down) then process | 551 | * event etc. earlier indicating loop is down) then process |
@@ -590,18 +580,12 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb) | |||
590 | break; | 580 | break; |
591 | 581 | ||
592 | case MBA_RSCN_UPDATE: /* State Change Registration */ | 582 | case MBA_RSCN_UPDATE: /* State Change Registration */ |
593 | if ((ha->flags.npiv_supported) && (ha->num_vhosts)) { | 583 | /* Check if the Vport has issued a SCR */ |
594 | for_each_mapped_vp_idx(ha, i) { | 584 | if (ha->parent && test_bit(VP_SCR_NEEDED, &ha->vp_flags)) |
595 | list_for_each_entry(vha, &ha->vp_list, | 585 | break; |
596 | vp_list) { | 586 | /* Only handle SCNs for our Vport index. */ |
597 | if ((mb[3] & 0xff) | 587 | if (ha->parent && ha->vp_idx != (mb[3] & 0xff)) |
598 | == vha->vp_idx) { | 588 | break; |
599 | ha = vha; | ||
600 | break; | ||
601 | } | ||
602 | } | ||
603 | } | ||
604 | } | ||
605 | 589 | ||
606 | DEBUG2(printk("scsi(%ld): Asynchronous RSCR UPDATE.\n", | 590 | DEBUG2(printk("scsi(%ld): Asynchronous RSCR UPDATE.\n", |
607 | ha->host_no)); | 591 | ha->host_no)); |
@@ -1132,25 +1116,6 @@ qla2x00_status_entry(scsi_qla_host_t *ha, void *pkt) | |||
1132 | break; | 1116 | break; |
1133 | 1117 | ||
1134 | qla2x00_handle_sense(sp, sense_data, sense_len); | 1118 | qla2x00_handle_sense(sp, sense_data, sense_len); |
1135 | |||
1136 | /* | ||
1137 | * In case of a Underrun condition, set both the lscsi | ||
1138 | * status and the completion status to appropriate | ||
1139 | * values. | ||
1140 | */ | ||
1141 | if (resid && | ||
1142 | ((unsigned)(scsi_bufflen(cp) - resid) < | ||
1143 | cp->underflow)) { | ||
1144 | DEBUG2(qla_printk(KERN_INFO, ha, | ||
1145 | "scsi(%ld:%d:%d:%d): Mid-layer underflow " | ||
1146 | "detected (%x of %x bytes)...returning " | ||
1147 | "error status.\n", ha->host_no, | ||
1148 | cp->device->channel, cp->device->id, | ||
1149 | cp->device->lun, resid, | ||
1150 | scsi_bufflen(cp))); | ||
1151 | |||
1152 | cp->result = DID_ERROR << 16 | lscsi_status; | ||
1153 | } | ||
1154 | } else { | 1119 | } else { |
1155 | /* | 1120 | /* |
1156 | * If RISC reports underrun and target does not report | 1121 | * If RISC reports underrun and target does not report |
@@ -1639,12 +1604,12 @@ qla24xx_msix_rsp_q(int irq, void *dev_id) | |||
1639 | ha = dev_id; | 1604 | ha = dev_id; |
1640 | reg = &ha->iobase->isp24; | 1605 | reg = &ha->iobase->isp24; |
1641 | 1606 | ||
1642 | spin_lock(&ha->hardware_lock); | 1607 | spin_lock_irq(&ha->hardware_lock); |
1643 | 1608 | ||
1644 | qla24xx_process_response_queue(ha); | 1609 | qla24xx_process_response_queue(ha); |
1645 | WRT_REG_DWORD(®->hccr, HCCRX_CLR_RISC_INT); | 1610 | WRT_REG_DWORD(®->hccr, HCCRX_CLR_RISC_INT); |
1646 | 1611 | ||
1647 | spin_unlock(&ha->hardware_lock); | 1612 | spin_unlock_irq(&ha->hardware_lock); |
1648 | 1613 | ||
1649 | return IRQ_HANDLED; | 1614 | return IRQ_HANDLED; |
1650 | } | 1615 | } |
@@ -1663,7 +1628,7 @@ qla24xx_msix_default(int irq, void *dev_id) | |||
1663 | reg = &ha->iobase->isp24; | 1628 | reg = &ha->iobase->isp24; |
1664 | status = 0; | 1629 | status = 0; |
1665 | 1630 | ||
1666 | spin_lock(&ha->hardware_lock); | 1631 | spin_lock_irq(&ha->hardware_lock); |
1667 | do { | 1632 | do { |
1668 | stat = RD_REG_DWORD(®->host_status); | 1633 | stat = RD_REG_DWORD(®->host_status); |
1669 | if (stat & HSRX_RISC_PAUSED) { | 1634 | if (stat & HSRX_RISC_PAUSED) { |
@@ -1716,7 +1681,7 @@ qla24xx_msix_default(int irq, void *dev_id) | |||
1716 | } | 1681 | } |
1717 | WRT_REG_DWORD(®->hccr, HCCRX_CLR_RISC_INT); | 1682 | WRT_REG_DWORD(®->hccr, HCCRX_CLR_RISC_INT); |
1718 | } while (0); | 1683 | } while (0); |
1719 | spin_unlock(&ha->hardware_lock); | 1684 | spin_unlock_irq(&ha->hardware_lock); |
1720 | 1685 | ||
1721 | if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) && | 1686 | if (test_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags) && |
1722 | (status & MBX_INTERRUPT) && ha->flags.mbox_int) { | 1687 | (status & MBX_INTERRUPT) && ha->flags.mbox_int) { |