[SCSI] lpfc 8.3.7: Fix SCSI protocol related errors.
[pandora-kernel.git] / drivers / scsi / lpfc / lpfc_init.c
index 226920d..974ea6d 100644 (file)
@@ -4506,9 +4506,13 @@ lpfc_sli_pci_mem_setup(struct lpfc_hba *phba)
                pdev = phba->pcidev;
 
        /* Set the device DMA mask size */
-       if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0)
-               if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0)
+       if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0
+        || pci_set_consistent_dma_mask(pdev,DMA_BIT_MASK(64)) != 0) {
+               if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0
+                || pci_set_consistent_dma_mask(pdev,DMA_BIT_MASK(32)) != 0) {
                        return error;
+               }
+       }
 
        /* Get the bus address of Bar0 and Bar2 and the number of bytes
         * required by each mapping.
@@ -6021,9 +6025,13 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba)
                pdev = phba->pcidev;
 
        /* Set the device DMA mask size */
-       if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0)
-               if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0)
+       if (pci_set_dma_mask(pdev, DMA_BIT_MASK(64)) != 0
+        || pci_set_consistent_dma_mask(pdev,DMA_BIT_MASK(64)) != 0) {
+               if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0
+                || pci_set_consistent_dma_mask(pdev,DMA_BIT_MASK(32)) != 0) {
                        return error;
+               }
+       }
 
        /* Get the bus address of SLI4 device Bar0, Bar1, and Bar2 and the
         * number of bytes required by each mapping. They are actually
@@ -7218,8 +7226,6 @@ lpfc_prep_dev_for_perm_failure(struct lpfc_hba *phba)
 {
        lpfc_printf_log(phba, KERN_ERR, LOG_INIT,
                        "2711 PCI channel permanent disable for failure\n");
-       /* Block all SCSI devices' I/Os on the host */
-       lpfc_scsi_dev_block(phba);
        /* Clean up all driver's outstanding SCSI I/Os */
        lpfc_sli_flush_fcp_rings(phba);
 }
@@ -7248,6 +7254,9 @@ lpfc_io_error_detected_s3(struct pci_dev *pdev, pci_channel_state_t state)
        struct Scsi_Host *shost = pci_get_drvdata(pdev);
        struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba;
 
+       /* Block all SCSI devices' I/Os on the host */
+       lpfc_scsi_dev_block(phba);
+
        switch (state) {
        case pci_channel_io_normal:
                /* Non-fatal error, prepare for recovery */
@@ -7499,6 +7508,9 @@ lpfc_pci_probe_one_s4(struct pci_dev *pdev, const struct pci_device_id *pid)
                        error = -ENODEV;
                        goto out_free_sysfs_attr;
                }
+               /* Default to single FCP EQ for non-MSI-X */
+               if (phba->intr_type != MSIX)
+                       phba->cfg_fcp_eq_count = 1;
                /* Set up SLI-4 HBA */
                if (lpfc_sli4_hba_setup(phba)) {
                        lpfc_printf_log(phba, KERN_ERR, LOG_INIT,