diff options
author | Joerg Roedel <joerg.roedel@amd.com> | 2009-05-19 04:23:15 -0400 |
---|---|---|
committer | Joerg Roedel <joerg.roedel@amd.com> | 2009-05-28 12:15:57 -0400 |
commit | 11b83888ae729457b5cfb936dbd498481f6408df (patch) | |
tree | c36205ce5df9ea1ff06fe6f70670ff6dd4cf81d3 /arch/x86/kernel/amd_iommu.c | |
parent | 00cd122ae5e5e7c60cce2af3c35b190d4c3f2d0d (diff) |
amd-iommu: enlarge the aperture dynamically
By dynamically increasing the aperture the extended allocator is now
ready for use.
Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
Diffstat (limited to 'arch/x86/kernel/amd_iommu.c')
-rw-r--r-- | arch/x86/kernel/amd_iommu.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index 59ee1b94a7ce..d129d8feba07 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -1403,10 +1403,26 @@ static dma_addr_t __map_single(struct device *dev, | |||
1403 | if (align) | 1403 | if (align) |
1404 | align_mask = (1UL << get_order(size)) - 1; | 1404 | align_mask = (1UL << get_order(size)) - 1; |
1405 | 1405 | ||
1406 | retry: | ||
1406 | address = dma_ops_alloc_addresses(dev, dma_dom, pages, align_mask, | 1407 | address = dma_ops_alloc_addresses(dev, dma_dom, pages, align_mask, |
1407 | dma_mask); | 1408 | dma_mask); |
1408 | if (unlikely(address == bad_dma_address)) | 1409 | if (unlikely(address == bad_dma_address)) { |
1409 | goto out; | 1410 | /* |
1411 | * setting next_address here will let the address | ||
1412 | * allocator only scan the new allocated range in the | ||
1413 | * first run. This is a small optimization. | ||
1414 | */ | ||
1415 | dma_dom->next_address = dma_dom->aperture_size; | ||
1416 | |||
1417 | if (alloc_new_range(iommu, dma_dom, false, GFP_ATOMIC)) | ||
1418 | goto out; | ||
1419 | |||
1420 | /* | ||
1421 | * aperture was sucessfully enlarged by 128 MB, try | ||
1422 | * allocation again | ||
1423 | */ | ||
1424 | goto retry; | ||
1425 | } | ||
1410 | 1426 | ||
1411 | start = address; | 1427 | start = address; |
1412 | for (i = 0; i < pages; ++i) { | 1428 | for (i = 0; i < pages; ++i) { |