diff options
author | Ivan Kokshaysky <ink@jurassic.park.msu.ru> | 2008-03-09 09:31:17 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-03-09 13:05:15 -0400 |
commit | ab875cf67e89eef150ae8d4ef09c361e47b6b398 (patch) | |
tree | 172ba1078681d4b49b041ead998412f127cb52a4 | |
parent | 393d94d98b19089ec172566e23557997931b137e (diff) |
alpha: fix iommu-related boot panic
This fixes a boot panic due to a typo in the recent iommu patchset from
FUJITA Tomonori <tomof@acm.org> - the code used dma_get_max_seg_size()
instead of dma_get_seg_boundary().
It also removes a couple of unnecessary BUG_ON() and ALIGN() macros.
Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Reported-and-tested-by: Bob Tracy <rct@frus.com>
Acked-by: FUJITA Tomonori <tomof@acm.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | arch/alpha/kernel/pci_iommu.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c index be6fa105cd34..e07a23fc5b74 100644 --- a/arch/alpha/kernel/pci_iommu.c +++ b/arch/alpha/kernel/pci_iommu.c | |||
@@ -144,15 +144,14 @@ iommu_arena_find_pages(struct device *dev, struct pci_iommu_arena *arena, | |||
144 | unsigned long base; | 144 | unsigned long base; |
145 | unsigned long boundary_size; | 145 | unsigned long boundary_size; |
146 | 146 | ||
147 | BUG_ON(arena->dma_base & ~PAGE_MASK); | ||
148 | base = arena->dma_base >> PAGE_SHIFT; | 147 | base = arena->dma_base >> PAGE_SHIFT; |
149 | if (dev) | 148 | if (dev) { |
150 | boundary_size = ALIGN(dma_get_max_seg_size(dev) + 1, PAGE_SIZE) | 149 | boundary_size = dma_get_seg_boundary(dev) + 1; |
151 | >> PAGE_SHIFT; | 150 | BUG_ON(!is_power_of_2(boundary_size)); |
152 | else | 151 | boundary_size >>= PAGE_SHIFT; |
153 | boundary_size = ALIGN(1UL << 32, PAGE_SIZE) >> PAGE_SHIFT; | 152 | } else { |
154 | 153 | boundary_size = 1UL << (32 - PAGE_SHIFT); | |
155 | BUG_ON(!is_power_of_2(boundary_size)); | 154 | } |
156 | 155 | ||
157 | /* Search forward for the first mask-aligned sequence of N free ptes */ | 156 | /* Search forward for the first mask-aligned sequence of N free ptes */ |
158 | ptes = arena->ptes; | 157 | ptes = arena->ptes; |