Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181353
b: refs/heads/master
c: 1dfb5a4
h: refs/heads/master
i:
  181351: 9fa64ab
v: v3
  • Loading branch information
James Smart authored and James Bottomley committed Feb 17, 2010
1 parent f36f941 commit 40c4b31
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f98c96b0b6572b5491e954148509b20f08f31491
refs/heads/master: 1dfb5a47bc76c700969e41cdc2df6d1bf0adeb62
4 changes: 0 additions & 4 deletions trunk/drivers/scsi/lpfc/lpfc_hw4.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ struct lpfc_sli_intf {
#define LPFC_SLI_INTF_VALID 6
};

#define LPFC_SLI4_BAR0 1
#define LPFC_SLI4_BAR1 2
#define LPFC_SLI4_BAR2 4

#define LPFC_SLI4_MBX_EMBED true
#define LPFC_SLI4_MBX_NEMBED false

Expand Down
40 changes: 32 additions & 8 deletions trunk/drivers/scsi/lpfc/lpfc_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -6079,16 +6079,20 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba)

/* Get the bus address of SLI4 device Bar0, Bar1, and Bar2 and the
* number of bytes required by each mapping. They are actually
* mapping to the PCI BAR regions 1, 2, and 4 by the SLI4 device.
* mapping to the PCI BAR regions 0 or 1, 2, and 4 by the SLI4 device.
*/
phba->pci_bar0_map = pci_resource_start(pdev, LPFC_SLI4_BAR0);
bar0map_len = pci_resource_len(pdev, LPFC_SLI4_BAR0);

phba->pci_bar1_map = pci_resource_start(pdev, LPFC_SLI4_BAR1);
bar1map_len = pci_resource_len(pdev, LPFC_SLI4_BAR1);
if (pci_resource_start(pdev, 0)) {
phba->pci_bar0_map = pci_resource_start(pdev, 0);
bar0map_len = pci_resource_len(pdev, 0);
} else {
phba->pci_bar0_map = pci_resource_start(pdev, 1);
bar0map_len = pci_resource_len(pdev, 1);
}
phba->pci_bar1_map = pci_resource_start(pdev, 2);
bar1map_len = pci_resource_len(pdev, 2);

phba->pci_bar2_map = pci_resource_start(pdev, LPFC_SLI4_BAR2);
bar2map_len = pci_resource_len(pdev, LPFC_SLI4_BAR2);
phba->pci_bar2_map = pci_resource_start(pdev, 4);
bar2map_len = pci_resource_len(pdev, 4);

/* Map SLI4 PCI Config Space Register base to a kernel virtual addr */
phba->sli4_hba.conf_regs_memmap_p =
Expand Down Expand Up @@ -7174,6 +7178,12 @@ lpfc_pci_resume_one_s3(struct pci_dev *pdev)
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);

/*
* As the new kernel behavior of pci_restore_state() API call clears
* device saved_state flag, need to save the restored state again.
*/
pci_save_state(pdev);

if (pdev->is_busmaster)
pci_set_master(pdev);

Expand Down Expand Up @@ -7357,6 +7367,13 @@ lpfc_io_slot_reset_s3(struct pci_dev *pdev)
}

pci_restore_state(pdev);

/*
* As the new kernel behavior of pci_restore_state() API call clears
* device saved_state flag, need to save the restored state again.
*/
pci_save_state(pdev);

if (pdev->is_busmaster)
pci_set_master(pdev);

Expand Down Expand Up @@ -7766,6 +7783,13 @@ lpfc_pci_resume_one_s4(struct pci_dev *pdev)
/* Restore device state from PCI config space */
pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);

/*
* As the new kernel behavior of pci_restore_state() API call clears
* device saved_state flag, need to save the restored state again.
*/
pci_save_state(pdev);

if (pdev->is_busmaster)
pci_set_master(pdev);

Expand Down

0 comments on commit 40c4b31

Please sign in to comment.