[SCSI] lpfc 8.3.42: Avoided making pci bar ioremap call during dual-chute WQ/RQ pci bar selection

Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

authored by James Smart and committed by James Bottomley f5ca6f2e 1b8d11ab

+12 -38
+12 -22
drivers/scsi/lpfc/lpfc_init.c
··· 7135 7135 phba->sli4_hba.fcp_wq = NULL; 7136 7136 } 7137 7137 7138 - if (phba->pci_bar0_memmap_p) { 7139 - iounmap(phba->pci_bar0_memmap_p); 7140 - phba->pci_bar0_memmap_p = NULL; 7141 - } 7142 - if (phba->pci_bar2_memmap_p) { 7143 - iounmap(phba->pci_bar2_memmap_p); 7144 - phba->pci_bar2_memmap_p = NULL; 7145 - } 7146 - if (phba->pci_bar4_memmap_p) { 7147 - iounmap(phba->pci_bar4_memmap_p); 7148 - phba->pci_bar4_memmap_p = NULL; 7149 - } 7150 - 7151 7138 /* Release FCP CQ mapping array */ 7152 7139 if (phba->sli4_hba.fcp_cq_map != NULL) { 7153 7140 kfree(phba->sli4_hba.fcp_cq_map); ··· 7923 7936 * particular PCI BARs regions is dependent on the type of 7924 7937 * SLI4 device. 7925 7938 */ 7926 - if (pci_resource_start(pdev, 0)) { 7927 - phba->pci_bar0_map = pci_resource_start(pdev, 0); 7928 - bar0map_len = pci_resource_len(pdev, 0); 7939 + if (pci_resource_start(pdev, PCI_64BIT_BAR0)) { 7940 + phba->pci_bar0_map = pci_resource_start(pdev, PCI_64BIT_BAR0); 7941 + bar0map_len = pci_resource_len(pdev, PCI_64BIT_BAR0); 7929 7942 7930 7943 /* 7931 7944 * Map SLI4 PCI Config Space Register base to a kernel virtual ··· 7939 7952 "registers.\n"); 7940 7953 goto out; 7941 7954 } 7955 + phba->pci_bar0_memmap_p = phba->sli4_hba.conf_regs_memmap_p; 7942 7956 /* Set up BAR0 PCI config space register memory map */ 7943 7957 lpfc_sli4_bar0_register_memmap(phba, if_type); 7944 7958 } else { ··· 7962 7974 } 7963 7975 7964 7976 if ((if_type == LPFC_SLI_INTF_IF_TYPE_0) && 7965 - (pci_resource_start(pdev, 2))) { 7977 + (pci_resource_start(pdev, PCI_64BIT_BAR2))) { 7966 7978 /* 7967 7979 * Map SLI4 if type 0 HBA Control Register base to a kernel 7968 7980 * virtual address and setup the registers. 7969 7981 */ 7970 - phba->pci_bar1_map = pci_resource_start(pdev, 2); 7971 - bar1map_len = pci_resource_len(pdev, 2); 7982 + phba->pci_bar1_map = pci_resource_start(pdev, PCI_64BIT_BAR2); 7983 + bar1map_len = pci_resource_len(pdev, PCI_64BIT_BAR2); 7972 7984 phba->sli4_hba.ctrl_regs_memmap_p = 7973 7985 ioremap(phba->pci_bar1_map, bar1map_len); 7974 7986 if (!phba->sli4_hba.ctrl_regs_memmap_p) { ··· 7976 7988 "ioremap failed for SLI4 HBA control registers.\n"); 7977 7989 goto out_iounmap_conf; 7978 7990 } 7991 + phba->pci_bar2_memmap_p = phba->sli4_hba.ctrl_regs_memmap_p; 7979 7992 lpfc_sli4_bar1_register_memmap(phba); 7980 7993 } 7981 7994 7982 7995 if ((if_type == LPFC_SLI_INTF_IF_TYPE_0) && 7983 - (pci_resource_start(pdev, 4))) { 7996 + (pci_resource_start(pdev, PCI_64BIT_BAR4))) { 7984 7997 /* 7985 7998 * Map SLI4 if type 0 HBA Doorbell Register base to a kernel 7986 7999 * virtual address and setup the registers. 7987 8000 */ 7988 - phba->pci_bar2_map = pci_resource_start(pdev, 4); 7989 - bar2map_len = pci_resource_len(pdev, 4); 8001 + phba->pci_bar2_map = pci_resource_start(pdev, PCI_64BIT_BAR4); 8002 + bar2map_len = pci_resource_len(pdev, PCI_64BIT_BAR4); 7990 8003 phba->sli4_hba.drbl_regs_memmap_p = 7991 8004 ioremap(phba->pci_bar2_map, bar2map_len); 7992 8005 if (!phba->sli4_hba.drbl_regs_memmap_p) { ··· 7995 8006 "ioremap failed for SLI4 HBA doorbell registers.\n"); 7996 8007 goto out_iounmap_ctrl; 7997 8008 } 8009 + phba->pci_bar4_memmap_p = phba->sli4_hba.drbl_regs_memmap_p; 7998 8010 error = lpfc_sli4_bar2_register_memmap(phba, LPFC_VF0); 7999 8011 if (error) 8000 8012 goto out_iounmap_all;
-16
drivers/scsi/lpfc/lpfc_sli.c
··· 12233 12233 lpfc_dual_chute_pci_bar_map(struct lpfc_hba *phba, uint16_t pci_barset) 12234 12234 { 12235 12235 struct pci_dev *pdev; 12236 - unsigned long bar_map, bar_map_len; 12237 12236 12238 12237 if (!phba->pcidev) 12239 12238 return NULL; ··· 12241 12242 12242 12243 switch (pci_barset) { 12243 12244 case WQ_PCI_BAR_0_AND_1: 12244 - if (!phba->pci_bar0_memmap_p) { 12245 - bar_map = pci_resource_start(pdev, PCI_64BIT_BAR0); 12246 - bar_map_len = pci_resource_len(pdev, PCI_64BIT_BAR0); 12247 - phba->pci_bar0_memmap_p = ioremap(bar_map, bar_map_len); 12248 - } 12249 12245 return phba->pci_bar0_memmap_p; 12250 12246 case WQ_PCI_BAR_2_AND_3: 12251 - if (!phba->pci_bar2_memmap_p) { 12252 - bar_map = pci_resource_start(pdev, PCI_64BIT_BAR2); 12253 - bar_map_len = pci_resource_len(pdev, PCI_64BIT_BAR2); 12254 - phba->pci_bar2_memmap_p = ioremap(bar_map, bar_map_len); 12255 - } 12256 12247 return phba->pci_bar2_memmap_p; 12257 12248 case WQ_PCI_BAR_4_AND_5: 12258 - if (!phba->pci_bar4_memmap_p) { 12259 - bar_map = pci_resource_start(pdev, PCI_64BIT_BAR4); 12260 - bar_map_len = pci_resource_len(pdev, PCI_64BIT_BAR4); 12261 - phba->pci_bar4_memmap_p = ioremap(bar_map, bar_map_len); 12262 - } 12263 12249 return phba->pci_bar4_memmap_p; 12264 12250 default: 12265 12251 break;