aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86_64/pci
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86_64/pci')
-rw-r--r--arch/x86_64/pci/mmconfig.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c
index 50512a8fc9e8..918fc5b95a06 100644
--- a/arch/x86_64/pci/mmconfig.c
+++ b/arch/x86_64/pci/mmconfig.c
@@ -13,10 +13,6 @@
13 13
14#include "pci.h" 14#include "pci.h"
15 15
16/* Verify the first 16 busses. We assume that systems with more busses
17 get MCFG right. */
18#define PCI_MMCFG_MAX_CHECK_BUS 16
19
20/* Static virtual mapping of the MMCONFIG aperture */ 16/* Static virtual mapping of the MMCONFIG aperture */
21struct mmcfg_virt { 17struct mmcfg_virt {
22 struct acpi_mcfg_allocation *cfg; 18 struct acpi_mcfg_allocation *cfg;
@@ -26,17 +22,13 @@ static struct mmcfg_virt *pci_mmcfg_virt;
26 22
27static char __iomem *get_virt(unsigned int seg, unsigned bus) 23static char __iomem *get_virt(unsigned int seg, unsigned bus)
28{ 24{
29 int cfg_num = -1;
30 struct acpi_mcfg_allocation *cfg; 25 struct acpi_mcfg_allocation *cfg;
26 int cfg_num;
31 27
32 while (1) { 28 for (cfg_num = 0; cfg_num < pci_mmcfg_config_num; cfg_num++) {
33 ++cfg_num;
34 if (cfg_num >= pci_mmcfg_config_num)
35 break;
36 cfg = pci_mmcfg_virt[cfg_num].cfg; 29 cfg = pci_mmcfg_virt[cfg_num].cfg;
37 if (cfg->pci_segment != seg) 30 if (cfg->pci_segment == seg &&
38 continue; 31 (cfg->start_bus_number <= bus) &&
39 if ((cfg->start_bus_number <= bus) &&
40 (cfg->end_bus_number >= bus)) 32 (cfg->end_bus_number >= bus))
41 return pci_mmcfg_virt[cfg_num].virt; 33 return pci_mmcfg_virt[cfg_num].virt;
42 } 34 }