diff options
-rw-r--r-- | drivers/pci/bus.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/pci/bus.c b/drivers/pci/bus.c index c30baae929f4..86fb8ec5e448 100644 --- a/drivers/pci/bus.c +++ b/drivers/pci/bus.c | |||
@@ -102,6 +102,8 @@ static struct pci_bus_region pci_32_bit = {0, 0xffffffffULL}; | |||
102 | #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT | 102 | #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT |
103 | static struct pci_bus_region pci_64_bit = {0, | 103 | static struct pci_bus_region pci_64_bit = {0, |
104 | (dma_addr_t) 0xffffffffffffffffULL}; | 104 | (dma_addr_t) 0xffffffffffffffffULL}; |
105 | static struct pci_bus_region pci_high = {(dma_addr_t) 0x100000000ULL, | ||
106 | (dma_addr_t) 0xffffffffffffffffULL}; | ||
105 | #endif | 107 | #endif |
106 | 108 | ||
107 | /* | 109 | /* |
@@ -198,8 +200,7 @@ static int pci_bus_alloc_from_region(struct pci_bus *bus, struct resource *res, | |||
198 | * alignment and type, try to find an acceptable resource allocation | 200 | * alignment and type, try to find an acceptable resource allocation |
199 | * for a specific device resource. | 201 | * for a specific device resource. |
200 | */ | 202 | */ |
201 | int | 203 | int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, |
202 | pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | ||
203 | resource_size_t size, resource_size_t align, | 204 | resource_size_t size, resource_size_t align, |
204 | resource_size_t min, unsigned int type_mask, | 205 | resource_size_t min, unsigned int type_mask, |
205 | resource_size_t (*alignf)(void *, | 206 | resource_size_t (*alignf)(void *, |
@@ -209,10 +210,19 @@ pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | |||
209 | void *alignf_data) | 210 | void *alignf_data) |
210 | { | 211 | { |
211 | #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT | 212 | #ifdef CONFIG_ARCH_DMA_ADDR_T_64BIT |
212 | if (res->flags & IORESOURCE_MEM_64) | 213 | int rc; |
214 | |||
215 | if (res->flags & IORESOURCE_MEM_64) { | ||
216 | rc = pci_bus_alloc_from_region(bus, res, size, align, min, | ||
217 | type_mask, alignf, alignf_data, | ||
218 | &pci_high); | ||
219 | if (rc == 0) | ||
220 | return 0; | ||
221 | |||
213 | return pci_bus_alloc_from_region(bus, res, size, align, min, | 222 | return pci_bus_alloc_from_region(bus, res, size, align, min, |
214 | type_mask, alignf, alignf_data, | 223 | type_mask, alignf, alignf_data, |
215 | &pci_64_bit); | 224 | &pci_64_bit); |
225 | } | ||
216 | #endif | 226 | #endif |
217 | 227 | ||
218 | return pci_bus_alloc_from_region(bus, res, size, align, min, | 228 | return pci_bus_alloc_from_region(bus, res, size, align, min, |