diff options
Diffstat (limited to 'drivers/pci/pci.c')
| -rw-r--r-- | drivers/pci/pci.c | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index d20f1334792b..111569ccab43 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
| @@ -991,8 +991,8 @@ static void pci_restore_config_dword(struct pci_dev *pdev, int offset, | |||
| 991 | } | 991 | } |
| 992 | } | 992 | } |
| 993 | 993 | ||
| 994 | static void pci_restore_config_space(struct pci_dev *pdev, int start, int end, | 994 | static void pci_restore_config_space_range(struct pci_dev *pdev, |
| 995 | int retry) | 995 | int start, int end, int retry) |
| 996 | { | 996 | { |
| 997 | int index; | 997 | int index; |
| 998 | 998 | ||
| @@ -1002,6 +1002,18 @@ static void pci_restore_config_space(struct pci_dev *pdev, int start, int end, | |||
| 1002 | retry); | 1002 | retry); |
| 1003 | } | 1003 | } |
| 1004 | 1004 | ||
| 1005 | static void pci_restore_config_space(struct pci_dev *pdev) | ||
| 1006 | { | ||
| 1007 | if (pdev->hdr_type == PCI_HEADER_TYPE_NORMAL) { | ||
| 1008 | pci_restore_config_space_range(pdev, 10, 15, 0); | ||
| 1009 | /* Restore BARs before the command register. */ | ||
| 1010 | pci_restore_config_space_range(pdev, 4, 9, 10); | ||
| 1011 | pci_restore_config_space_range(pdev, 0, 3, 0); | ||
| 1012 | } else { | ||
| 1013 | pci_restore_config_space_range(pdev, 0, 15, 0); | ||
| 1014 | } | ||
| 1015 | } | ||
| 1016 | |||
| 1005 | /** | 1017 | /** |
| 1006 | * pci_restore_state - Restore the saved state of a PCI device | 1018 | * pci_restore_state - Restore the saved state of a PCI device |
| 1007 | * @dev: - PCI device that we're dealing with | 1019 | * @dev: - PCI device that we're dealing with |
| @@ -1015,13 +1027,7 @@ void pci_restore_state(struct pci_dev *dev) | |||
| 1015 | pci_restore_pcie_state(dev); | 1027 | pci_restore_pcie_state(dev); |
| 1016 | pci_restore_ats_state(dev); | 1028 | pci_restore_ats_state(dev); |
| 1017 | 1029 | ||
| 1018 | pci_restore_config_space(dev, 10, 15, 0); | 1030 | pci_restore_config_space(dev); |
| 1019 | /* | ||
| 1020 | * The Base Address register should be programmed before the command | ||
| 1021 | * register(s) | ||
| 1022 | */ | ||
| 1023 | pci_restore_config_space(dev, 4, 9, 10); | ||
| 1024 | pci_restore_config_space(dev, 0, 3, 0); | ||
| 1025 | 1031 | ||
| 1026 | pci_restore_pcix_state(dev); | 1032 | pci_restore_pcix_state(dev); |
| 1027 | pci_restore_msi_state(dev); | 1033 | pci_restore_msi_state(dev); |
