aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc
diff options
context:
space:
mode:
authorJames Smart <james.smart@emulex.com>2010-02-12 14:40:50 -0500
committerJames Bottomley <James.Bottomley@suse.de>2010-02-17 18:40:08 -0500
commit1dfb5a47bc76c700969e41cdc2df6d1bf0adeb62 (patch)
treec176c4870e64ce3688226a5d1b7faef1c4958ef8 /drivers/scsi/lpfc
parentf98c96b0b6572b5491e954148509b20f08f31491 (diff)
[SCSI] lpfc 8.3.9: PCI Changes to lpfc driver
- Call pci_save_state() after pci_restore_state() call to cope with kernel change. - Add support for PCI BAR region 0 if BAR0 is a 64 bit register. Signed-off-by: James Smart <james.smart@emulex.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r--drivers/scsi/lpfc/lpfc_hw4.h4
-rw-r--r--drivers/scsi/lpfc/lpfc_init.c40
2 files changed, 32 insertions, 12 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h
index c2bec6e6222f..ae0c53dba845 100644
--- a/drivers/scsi/lpfc/lpfc_hw4.h
+++ b/drivers/scsi/lpfc/lpfc_hw4.h
@@ -77,10 +77,6 @@ struct lpfc_sli_intf {
77#define LPFC_SLI_INTF_VALID 6 77#define LPFC_SLI_INTF_VALID 6
78}; 78};
79 79
80#define LPFC_SLI4_BAR0 1
81#define LPFC_SLI4_BAR1 2
82#define LPFC_SLI4_BAR2 4
83
84#define LPFC_SLI4_MBX_EMBED true 80#define LPFC_SLI4_MBX_EMBED true
85#define LPFC_SLI4_MBX_NEMBED false 81#define LPFC_SLI4_MBX_NEMBED false
86 82
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c
index 52fc758b8f77..25a97dfd4ea7 100644
--- a/drivers/scsi/lpfc/lpfc_init.c
+++ b/drivers/scsi/lpfc/lpfc_init.c
@@ -6079,16 +6079,20 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba)
6079 6079
6080 /* Get the bus address of SLI4 device Bar0, Bar1, and Bar2 and the 6080 /* Get the bus address of SLI4 device Bar0, Bar1, and Bar2 and the
6081 * number of bytes required by each mapping. They are actually 6081 * number of bytes required by each mapping. They are actually
6082 * mapping to the PCI BAR regions 1, 2, and 4 by the SLI4 device. 6082 * mapping to the PCI BAR regions 0 or 1, 2, and 4 by the SLI4 device.
6083 */ 6083 */
6084 phba->pci_bar0_map = pci_resource_start(pdev, LPFC_SLI4_BAR0); 6084 if (pci_resource_start(pdev, 0)) {
6085 bar0map_len = pci_resource_len(pdev, LPFC_SLI4_BAR0); 6085 phba->pci_bar0_map = pci_resource_start(pdev, 0);
6086 6086 bar0map_len = pci_resource_len(pdev, 0);
6087 phba->pci_bar1_map = pci_resource_start(pdev, LPFC_SLI4_BAR1); 6087 } else {
6088 bar1map_len = pci_resource_len(pdev, LPFC_SLI4_BAR1); 6088 phba->pci_bar0_map = pci_resource_start(pdev, 1);
6089 bar0map_len = pci_resource_len(pdev, 1);
6090 }
6091 phba->pci_bar1_map = pci_resource_start(pdev, 2);
6092 bar1map_len = pci_resource_len(pdev, 2);
6089 6093
6090 phba->pci_bar2_map = pci_resource_start(pdev, LPFC_SLI4_BAR2); 6094 phba->pci_bar2_map = pci_resource_start(pdev, 4);
6091 bar2map_len = pci_resource_len(pdev, LPFC_SLI4_BAR2); 6095 bar2map_len = pci_resource_len(pdev, 4);
6092 6096
6093 /* Map SLI4 PCI Config Space Register base to a kernel virtual addr */ 6097 /* Map SLI4 PCI Config Space Register base to a kernel virtual addr */
6094 phba->sli4_hba.conf_regs_memmap_p = 6098 phba->sli4_hba.conf_regs_memmap_p =
@@ -7174,6 +7178,12 @@ lpfc_pci_resume_one_s3(struct pci_dev *pdev)
7174 pci_set_power_state(pdev, PCI_D0); 7178 pci_set_power_state(pdev, PCI_D0);
7175 pci_restore_state(pdev); 7179 pci_restore_state(pdev);
7176 7180
7181 /*
7182 * As the new kernel behavior of pci_restore_state() API call clears
7183 * device saved_state flag, need to save the restored state again.
7184 */
7185 pci_save_state(pdev);
7186
7177 if (pdev->is_busmaster) 7187 if (pdev->is_busmaster)
7178 pci_set_master(pdev); 7188 pci_set_master(pdev);
7179 7189
@@ -7357,6 +7367,13 @@ lpfc_io_slot_reset_s3(struct pci_dev *pdev)
7357 } 7367 }
7358 7368
7359 pci_restore_state(pdev); 7369 pci_restore_state(pdev);
7370
7371 /*
7372 * As the new kernel behavior of pci_restore_state() API call clears
7373 * device saved_state flag, need to save the restored state again.
7374 */
7375 pci_save_state(pdev);
7376
7360 if (pdev->is_busmaster) 7377 if (pdev->is_busmaster)
7361 pci_set_master(pdev); 7378 pci_set_master(pdev);
7362 7379
@@ -7766,6 +7783,13 @@ lpfc_pci_resume_one_s4(struct pci_dev *pdev)
7766 /* Restore device state from PCI config space */ 7783 /* Restore device state from PCI config space */
7767 pci_set_power_state(pdev, PCI_D0); 7784 pci_set_power_state(pdev, PCI_D0);
7768 pci_restore_state(pdev); 7785 pci_restore_state(pdev);
7786
7787 /*
7788 * As the new kernel behavior of pci_restore_state() API call clears
7789 * device saved_state flag, need to save the restored state again.
7790 */
7791 pci_save_state(pdev);
7792
7769 if (pdev->is_busmaster) 7793 if (pdev->is_busmaster)
7770 pci_set_master(pdev); 7794 pci_set_master(pdev);
7771 7795