aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c34
-rw-r--r--drivers/scsi/lpfc/lpfc_sli.c16
2 files changed, 12 insertions, 38 deletions
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index b0a500be8b1f..6e5a735702d3 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -7135,19 +7135,6 @@ lpfc_sli4_queue_destroy(struct lpfc_hba *phba)
7135 phba->sli4_hba.fcp_wq = NULL; 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 /* Release FCP CQ mapping array */ 7138 /* Release FCP CQ mapping array */
7152 if (phba->sli4_hba.fcp_cq_map != NULL) { 7139 if (phba->sli4_hba.fcp_cq_map != NULL) {
7153 kfree(phba->sli4_hba.fcp_cq_map); 7140 kfree(phba->sli4_hba.fcp_cq_map);
@@ -7936,9 +7923,9 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba)
7936 * particular PCI BARs regions is dependent on the type of 7923 * particular PCI BARs regions is dependent on the type of
7937 * SLI4 device. 7924 * SLI4 device.
7938 */ 7925 */
7939 if (pci_resource_start(pdev, 0)) { 7926 if (pci_resource_start(pdev, PCI_64BIT_BAR0)) {
7940 phba->pci_bar0_map = pci_resource_start(pdev, 0); 7927 phba->pci_bar0_map = pci_resource_start(pdev, PCI_64BIT_BAR0);
7941 bar0map_len = pci_resource_len(pdev, 0); 7928 bar0map_len = pci_resource_len(pdev, PCI_64BIT_BAR0);
7942 7929
7943 /* 7930 /*
7944 * Map SLI4 PCI Config Space Register base to a kernel virtual 7931 * Map SLI4 PCI Config Space Register base to a kernel virtual
@@ -7952,6 +7939,7 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba)
7952 "registers.\n"); 7939 "registers.\n");
7953 goto out; 7940 goto out;
7954 } 7941 }
7942 phba->pci_bar0_memmap_p = phba->sli4_hba.conf_regs_memmap_p;
7955 /* Set up BAR0 PCI config space register memory map */ 7943 /* Set up BAR0 PCI config space register memory map */
7956 lpfc_sli4_bar0_register_memmap(phba, if_type); 7944 lpfc_sli4_bar0_register_memmap(phba, if_type);
7957 } else { 7945 } else {
@@ -7974,13 +7962,13 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba)
7974 } 7962 }
7975 7963
7976 if ((if_type == LPFC_SLI_INTF_IF_TYPE_0) && 7964 if ((if_type == LPFC_SLI_INTF_IF_TYPE_0) &&
7977 (pci_resource_start(pdev, 2))) { 7965 (pci_resource_start(pdev, PCI_64BIT_BAR2))) {
7978 /* 7966 /*
7979 * Map SLI4 if type 0 HBA Control Register base to a kernel 7967 * Map SLI4 if type 0 HBA Control Register base to a kernel
7980 * virtual address and setup the registers. 7968 * virtual address and setup the registers.
7981 */ 7969 */
7982 phba->pci_bar1_map = pci_resource_start(pdev, 2); 7970 phba->pci_bar1_map = pci_resource_start(pdev, PCI_64BIT_BAR2);
7983 bar1map_len = pci_resource_len(pdev, 2); 7971 bar1map_len = pci_resource_len(pdev, PCI_64BIT_BAR2);
7984 phba->sli4_hba.ctrl_regs_memmap_p = 7972 phba->sli4_hba.ctrl_regs_memmap_p =
7985 ioremap(phba->pci_bar1_map, bar1map_len); 7973 ioremap(phba->pci_bar1_map, bar1map_len);
7986 if (!phba->sli4_hba.ctrl_regs_memmap_p) { 7974 if (!phba->sli4_hba.ctrl_regs_memmap_p) {
@@ -7988,17 +7976,18 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba)
7988 "ioremap failed for SLI4 HBA control registers.\n"); 7976 "ioremap failed for SLI4 HBA control registers.\n");
7989 goto out_iounmap_conf; 7977 goto out_iounmap_conf;
7990 } 7978 }
7979 phba->pci_bar2_memmap_p = phba->sli4_hba.ctrl_regs_memmap_p;
7991 lpfc_sli4_bar1_register_memmap(phba); 7980 lpfc_sli4_bar1_register_memmap(phba);
7992 } 7981 }
7993 7982
7994 if ((if_type == LPFC_SLI_INTF_IF_TYPE_0) && 7983 if ((if_type == LPFC_SLI_INTF_IF_TYPE_0) &&
7995 (pci_resource_start(pdev, 4))) { 7984 (pci_resource_start(pdev, PCI_64BIT_BAR4))) {
7996 /* 7985 /*
7997 * Map SLI4 if type 0 HBA Doorbell Register base to a kernel 7986 * Map SLI4 if type 0 HBA Doorbell Register base to a kernel
7998 * virtual address and setup the registers. 7987 * virtual address and setup the registers.
7999 */ 7988 */
8000 phba->pci_bar2_map = pci_resource_start(pdev, 4); 7989 phba->pci_bar2_map = pci_resource_start(pdev, PCI_64BIT_BAR4);
8001 bar2map_len = pci_resource_len(pdev, 4); 7990 bar2map_len = pci_resource_len(pdev, PCI_64BIT_BAR4);
8002 phba->sli4_hba.drbl_regs_memmap_p = 7991 phba->sli4_hba.drbl_regs_memmap_p =
8003 ioremap(phba->pci_bar2_map, bar2map_len); 7992 ioremap(phba->pci_bar2_map, bar2map_len);
8004 if (!phba->sli4_hba.drbl_regs_memmap_p) { 7993 if (!phba->sli4_hba.drbl_regs_memmap_p) {
@@ -8006,6 +7995,7 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba)
8006 "ioremap failed for SLI4 HBA doorbell registers.\n"); 7995 "ioremap failed for SLI4 HBA doorbell registers.\n");
8007 goto out_iounmap_ctrl; 7996 goto out_iounmap_ctrl;
8008 } 7997 }
7998 phba->pci_bar4_memmap_p = phba->sli4_hba.drbl_regs_memmap_p;
8009 error = lpfc_sli4_bar2_register_memmap(phba, LPFC_VF0); 7999 error = lpfc_sli4_bar2_register_memmap(phba, LPFC_VF0);
8010 if (error) 8000 if (error)
8011 goto out_iounmap_all; 8001 goto out_iounmap_all;
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
index d8fd7310766e..56d4055022a9 100644
--- a/drivers/scsi/lpfc/lpfc_sli.c
+++ b/drivers/scsi/lpfc/lpfc_sli.c
@@ -12233,7 +12233,6 @@ static void __iomem *
12233lpfc_dual_chute_pci_bar_map(struct lpfc_hba *phba, uint16_t pci_barset) 12233lpfc_dual_chute_pci_bar_map(struct lpfc_hba *phba, uint16_t pci_barset)
12234{ 12234{
12235 struct pci_dev *pdev; 12235 struct pci_dev *pdev;
12236 unsigned long bar_map, bar_map_len;
12237 12236
12238 if (!phba->pcidev) 12237 if (!phba->pcidev)
12239 return NULL; 12238 return NULL;
@@ -12242,25 +12241,10 @@ lpfc_dual_chute_pci_bar_map(struct lpfc_hba *phba, uint16_t pci_barset)
12242 12241
12243 switch (pci_barset) { 12242 switch (pci_barset) {
12244 case WQ_PCI_BAR_0_AND_1: 12243 case WQ_PCI_BAR_0_AND_1:
12245 if (!phba->pci_bar0_memmap_p) {
12246 bar_map = pci_resource_start(pdev, PCI_64BIT_BAR0);
12247 bar_map_len = pci_resource_len(pdev, PCI_64BIT_BAR0);
12248 phba->pci_bar0_memmap_p = ioremap(bar_map, bar_map_len);
12249 }
12250 return phba->pci_bar0_memmap_p; 12244 return phba->pci_bar0_memmap_p;
12251 case WQ_PCI_BAR_2_AND_3: 12245 case WQ_PCI_BAR_2_AND_3:
12252 if (!phba->pci_bar2_memmap_p) {
12253 bar_map = pci_resource_start(pdev, PCI_64BIT_BAR2);
12254 bar_map_len = pci_resource_len(pdev, PCI_64BIT_BAR2);
12255 phba->pci_bar2_memmap_p = ioremap(bar_map, bar_map_len);
12256 }
12257 return phba->pci_bar2_memmap_p; 12246 return phba->pci_bar2_memmap_p;
12258 case WQ_PCI_BAR_4_AND_5: 12247 case WQ_PCI_BAR_4_AND_5:
12259 if (!phba->pci_bar4_memmap_p) {
12260 bar_map = pci_resource_start(pdev, PCI_64BIT_BAR4);
12261 bar_map_len = pci_resource_len(pdev, PCI_64BIT_BAR4);
12262 phba->pci_bar4_memmap_p = ioremap(bar_map, bar_map_len);
12263 }
12264 return phba->pci_bar4_memmap_p; 12248 return phba->pci_bar4_memmap_p;
12265 default: 12249 default:
12266 break; 12250 break;