diff options
Diffstat (limited to 'drivers/pci/setup-res.c')
-rw-r--r-- | drivers/pci/setup-res.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/pci/setup-res.c b/drivers/pci/setup-res.c index 1ca21d2ba11c..5598b4714f77 100644 --- a/drivers/pci/setup-res.c +++ b/drivers/pci/setup-res.c | |||
@@ -33,6 +33,11 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno) | |||
33 | u32 new, check, mask; | 33 | u32 new, check, mask; |
34 | int reg; | 34 | int reg; |
35 | 35 | ||
36 | /* Ignore resources for unimplemented BARs and unused resource slots | ||
37 | for 64 bit BARs. */ | ||
38 | if (!res->flags) | ||
39 | return; | ||
40 | |||
36 | pcibios_resource_to_bus(dev, ®ion, res); | 41 | pcibios_resource_to_bus(dev, ®ion, res); |
37 | 42 | ||
38 | pr_debug(" got res [%lx:%lx] bus [%lx:%lx] flags %lx for " | 43 | pr_debug(" got res [%lx:%lx] bus [%lx:%lx] flags %lx for " |
@@ -48,7 +53,9 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno) | |||
48 | if (resno < 6) { | 53 | if (resno < 6) { |
49 | reg = PCI_BASE_ADDRESS_0 + 4 * resno; | 54 | reg = PCI_BASE_ADDRESS_0 + 4 * resno; |
50 | } else if (resno == PCI_ROM_RESOURCE) { | 55 | } else if (resno == PCI_ROM_RESOURCE) { |
51 | new |= res->flags & IORESOURCE_ROM_ENABLE; | 56 | if (!(res->flags & IORESOURCE_ROM_ENABLE)) |
57 | return; | ||
58 | new |= PCI_ROM_ADDRESS_ENABLE; | ||
52 | reg = dev->rom_base_reg; | 59 | reg = dev->rom_base_reg; |
53 | } else { | 60 | } else { |
54 | /* Hmm, non-standard resource. */ | 61 | /* Hmm, non-standard resource. */ |
@@ -67,7 +74,7 @@ pci_update_resource(struct pci_dev *dev, struct resource *res, int resno) | |||
67 | 74 | ||
68 | if ((new & (PCI_BASE_ADDRESS_SPACE|PCI_BASE_ADDRESS_MEM_TYPE_MASK)) == | 75 | if ((new & (PCI_BASE_ADDRESS_SPACE|PCI_BASE_ADDRESS_MEM_TYPE_MASK)) == |
69 | (PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64)) { | 76 | (PCI_BASE_ADDRESS_SPACE_MEMORY|PCI_BASE_ADDRESS_MEM_TYPE_64)) { |
70 | new = 0; /* currently everyone zeros the high address */ | 77 | new = region.start >> 16 >> 16; |
71 | pci_write_config_dword(dev, reg + 4, new); | 78 | pci_write_config_dword(dev, reg + 4, new); |
72 | pci_read_config_dword(dev, reg + 4, &check); | 79 | pci_read_config_dword(dev, reg + 4, &check); |
73 | if (check != new) { | 80 | if (check != new) { |