]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/scsi/qla2xxx/qla_isr.c
[SCSI] qla2xxx: Remove interrupt request bit check in the response processing path...
[net-next-2.6.git] / drivers / scsi / qla2xxx / qla_isr.c
index d5fb79a880018cf7f0ddb461e3fcf1df5a68451f..b5554ea4693bb429a1cb10305c121fa662b57b3d 100644 (file)
@@ -275,7 +275,7 @@ void
 qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
 {
 #define LS_UNKNOWN     2
-       static char     *link_speeds[5] = { "1", "2", "?", "4", "8" };
+       static char     *link_speeds[] = { "1", "2", "?", "4", "8", "10" };
        char            *link_speed;
        uint16_t        handle_cnt;
        uint16_t        cnt;
@@ -288,6 +288,8 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
 
        /* Setup to process RIO completion. */
        handle_cnt = 0;
+       if (IS_QLA81XX(ha))
+               goto skip_rio;
        switch (mb[0]) {
        case MBA_SCSI_COMPLETION:
                handles[0] = le32_to_cpu((uint32_t)((mb[2] << 16) | mb[1]));
@@ -339,7 +341,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
        default:
                break;
        }
-
+skip_rio:
        switch (mb[0]) {
        case MBA_SCSI_COMPLETION:       /* Fast Post */
                if (!vha->flags.online)
@@ -362,7 +364,6 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
                    "ISP System Error - mbx1=%xh mbx2=%xh mbx3=%xh.\n",
                    mb[1], mb[2], mb[3]);
 
-               qla2x00_post_hwe_work(vha, mb[0], mb[1], mb[2], mb[3]);
                ha->isp_ops->fw_dump(vha, 1);
 
                if (IS_FWI2_CAPABLE(ha)) {
@@ -387,7 +388,6 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
                    vha->host_no));
                qla_printk(KERN_WARNING, ha, "ISP Request Transfer Error.\n");
 
-               qla2x00_post_hwe_work(vha, mb[0], mb[1], mb[2], mb[3]);
                set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
                break;
 
@@ -396,7 +396,6 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
                    vha->host_no));
                qla_printk(KERN_WARNING, ha, "ISP Response Transfer Error.\n");
 
-               qla2x00_post_hwe_work(vha, mb[0], mb[1], mb[2], mb[3]);
                set_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
                break;
 
@@ -436,6 +435,8 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
                        link_speed = link_speeds[LS_UNKNOWN];
                        if (mb[1] < 5)
                                link_speed = link_speeds[mb[1]];
+                       else if (mb[1] == 0x13)
+                               link_speed = link_speeds[5];
                        ha->link_data_rate = mb[1];
                }
 
@@ -495,12 +496,17 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
                qla2x00_post_aen_work(vha, FCH_EVT_LIPRESET, mb[1]);
                break;
 
+       /* case MBA_DCBX_COMPLETE: */
        case MBA_POINT_TO_POINT:        /* Point-to-Point */
                if (IS_QLA2100(ha))
                        break;
 
-               DEBUG2(printk("scsi(%ld): Asynchronous P2P MODE received.\n",
-                   vha->host_no));
+               if (IS_QLA81XX(ha))
+                       DEBUG2(printk("scsi(%ld): DCBX Completed -- %04x %04x "
+                           "%04x\n", vha->host_no, mb[1], mb[2], mb[3]));
+               else
+                       DEBUG2(printk("scsi(%ld): Asynchronous P2P MODE "
+                           "received.\n", vha->host_no));
 
                /*
                 * Until there's a transition from loop down to loop up, treat
@@ -641,10 +647,7 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
 
        /* case MBA_RIO_RESPONSE: */
        case MBA_ZIO_RESPONSE:
-               DEBUG2(printk("scsi(%ld): [R|Z]IO update completion.\n",
-                   vha->host_no));
-               DEBUG(printk(KERN_INFO
-                   "scsi(%ld): [R|Z]IO update completion.\n",
+               DEBUG3(printk("scsi(%ld): [R|Z]IO update completion.\n",
                    vha->host_no));
 
                if (IS_FWI2_CAPABLE(ha))
@@ -698,6 +701,35 @@ qla2x00_async_event(scsi_qla_host_t *vha, struct rsp_que *rsp, uint16_t *mb)
                }
                spin_unlock_irqrestore(&ha->cs84xx->access_lock, flags);
                break;
+       case MBA_DCBX_START:
+               DEBUG2(printk("scsi(%ld): DCBX Started -- %04x %04x %04x\n",
+                   vha->host_no, mb[1], mb[2], mb[3]));
+               break;
+       case MBA_DCBX_PARAM_UPDATE:
+               DEBUG2(printk("scsi(%ld): DCBX Parameters Updated -- "
+                   "%04x %04x %04x\n", vha->host_no, mb[1], mb[2], mb[3]));
+               break;
+       case MBA_FCF_CONF_ERR:
+               DEBUG2(printk("scsi(%ld): FCF Configuration Error -- "
+                   "%04x %04x %04x\n", vha->host_no, mb[1], mb[2], mb[3]));
+               break;
+       case MBA_IDC_COMPLETE:
+               DEBUG2(printk("scsi(%ld): Inter-Driver Commucation "
+                   "Complete -- %04x %04x %04x\n", vha->host_no, mb[1], mb[2],
+                   mb[3]));
+               break;
+       case MBA_IDC_NOTIFY:
+               DEBUG2(printk("scsi(%ld): Inter-Driver Commucation "
+                   "Request Notification -- %04x %04x %04x\n", vha->host_no,
+                   mb[1], mb[2], mb[3]));
+               /**** Mailbox registers 4 - 7 valid!!! */
+               break;
+       case MBA_IDC_TIME_EXT:
+               DEBUG2(printk("scsi(%ld): Inter-Driver Commucation "
+                   "Time Extension -- %04x %04x %04x\n", vha->host_no, mb[1],
+                   mb[2], mb[3]));
+               /**** Mailbox registers 4 - 7 valid!!! */
+               break;
        }
 
        if (!vha->vp_idx && ha->num_vhosts)
@@ -1510,7 +1542,7 @@ qla2xxx_check_risc_status(scsi_qla_host_t *vha)
        struct qla_hw_data *ha = vha->hw;
        struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
 
-       if (!IS_QLA25XX(ha))
+       if (!IS_QLA25XX(ha) && !IS_QLA81XX(ha))
                return;
 
        rval = QLA_SUCCESS;
@@ -1590,12 +1622,6 @@ qla24xx_intr_handler(int irq, void *dev_id)
                        if (pci_channel_offline(ha->pdev))
                                break;
 
-                       if (ha->hw_event_pause_errors == 0)
-                               qla2x00_post_hwe_work(vha, HW_EVENT_PARITY_ERR,
-                                   0, MSW(stat), LSW(stat));
-                       else if (ha->hw_event_pause_errors < 0xffffffff)
-                               ha->hw_event_pause_errors++;
-
                        hccr = RD_REG_DWORD(&reg->hccr);
 
                        qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, "
@@ -1681,7 +1707,6 @@ qla25xx_msix_rsp_q(int irq, void *dev_id)
        struct qla_hw_data *ha;
        struct rsp_que *rsp;
        struct device_reg_24xx __iomem *reg;
-       uint16_t msix_disabled_hccr = 0;
 
        rsp = (struct rsp_que *) dev_id;
        if (!rsp) {
@@ -1694,17 +1719,8 @@ qla25xx_msix_rsp_q(int irq, void *dev_id)
 
        spin_lock_irq(&ha->hardware_lock);
 
-       msix_disabled_hccr = rsp->options;
-       if (!rsp->id)
-               msix_disabled_hccr &= __constant_cpu_to_le32(BIT_22);
-       else
-               msix_disabled_hccr &= __constant_cpu_to_le32(BIT_6);
-
        qla24xx_process_response_queue(rsp);
 
-       if (!msix_disabled_hccr)
-               WRT_REG_DWORD(&reg->hccr, HCCRX_CLR_RISC_INT);
-
        spin_unlock_irq(&ha->hardware_lock);
 
        return IRQ_HANDLED;
@@ -1740,12 +1756,6 @@ qla24xx_msix_default(int irq, void *dev_id)
                        if (pci_channel_offline(ha->pdev))
                                break;
 
-                       if (ha->hw_event_pause_errors == 0)
-                               qla2x00_post_hwe_work(vha, HW_EVENT_PARITY_ERR,
-                                   0, MSW(stat), LSW(stat));
-                       else if (ha->hw_event_pause_errors < 0xffffffff)
-                               ha->hw_event_pause_errors++;
-
                        hccr = RD_REG_DWORD(&reg->hccr);
 
                        qla_printk(KERN_INFO, ha, "RISC paused -- HCCR=%x, "
@@ -1848,6 +1858,7 @@ qla24xx_disable_msix(struct qla_hw_data *ha)
 static int
 qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
 {
+#define MIN_MSIX_COUNT 2
        int i, ret;
        struct msix_entry *entries;
        struct qla_msix_entry *qentry;
@@ -1863,12 +1874,16 @@ qla24xx_enable_msix(struct qla_hw_data *ha, struct rsp_que *rsp)
 
        ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
        if (ret) {
+               if (ret < MIN_MSIX_COUNT)
+                       goto msix_failed;
+
                qla_printk(KERN_WARNING, ha,
                        "MSI-X: Failed to enable support -- %d/%d\n"
                        " Retry with %d vectors\n", ha->msix_count, ret, ret);
                ha->msix_count = ret;
                ret = pci_enable_msix(ha->pdev, entries, ha->msix_count);
                if (ret) {
+msix_failed:
                        qla_printk(KERN_WARNING, ha, "MSI-X: Failed to enable"
                                " support, giving up -- %d/%d\n",
                                ha->msix_count, ret);
@@ -1944,7 +1959,8 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp)
        device_reg_t __iomem *reg = ha->iobase;
 
        /* If possible, enable MSI-X. */
-       if (!IS_QLA2432(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha))
+       if (!IS_QLA2432(ha) && !IS_QLA2532(ha) &&
+           !IS_QLA8432(ha) && !IS_QLA8001(ha))
                goto skip_msix;
 
        if (IS_QLA2432(ha) && (ha->pdev->revision < QLA_MSIX_CHIP_REV_24XX ||
@@ -1979,7 +1995,8 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp)
            "MSI-X: Falling back-to INTa mode -- %d.\n", ret);
 skip_msix:
 
-       if (!IS_QLA24XX(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha))
+       if (!IS_QLA24XX(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha) &&
+           !IS_QLA8001(ha))
                goto skip_msi;
 
        ret = pci_enable_msi(ha->pdev);
@@ -2000,6 +2017,12 @@ skip_msi:
        ha->flags.inta_enabled = 1;
 clear_risc_ints:
 
+       /*
+        * FIXME: Noted that 8014s were being dropped during NK testing.
+        * Timing deltas during MSI-X/INTa transitions?
+        */
+       if (IS_QLA81XX(ha))
+               goto fail;
        spin_lock_irq(&ha->hardware_lock);
        if (IS_FWI2_CAPABLE(ha)) {
                WRT_REG_DWORD(&reg->isp24.hccr, HCCRX_CLR_HOST_INT);
@@ -2044,7 +2067,7 @@ qla2x00_get_rsp_host(struct rsp_que *rsp)
                if (pkt && pkt->handle < MAX_OUTSTANDING_COMMANDS) {
                        sp = req->outstanding_cmds[pkt->handle];
                        if (sp)
-                               vha = sp->vha;
+                               vha = sp->fcport->vha;
                }
        }
        if (!vha)