projects/linux·commit ab875cf6

alpha: fix iommu-related boot panic

ab875cf6 · Ivan Kokshaysky <[email protected]> · 2008-03-09 16:31:17 +03:00

This fixes a boot panic due to a typo in the recent iommu patchset from
FUJITA Tomonori <[email protected]> - 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 <[email protected]>
Reported-and-tested-by: Bob Tracy <[email protected]>
Acked-by: FUJITA Tomonori <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Commit
ab875cf67e89eef150ae8d4ef09c361e47b6b398
Parents
393d94d9

Changes

1 files changed · +7 −8

FileStatusAddDelContent
arch/alpha/kernel/pci_iommu.cmodified+7−8View file

arch/alpha/kernel/pci_iommu.c

View file
diff --git a/arch/alpha/kernel/pci_iommu.c b/arch/alpha/kernel/pci_iommu.c
index be6fa10..e07a23f 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,
unsigned long base;
unsigned long boundary_size;
- BUG_ON(arena->dma_base & ~PAGE_MASK);
base = arena->dma_base >> PAGE_SHIFT;
- if (dev)
- boundary_size = ALIGN(dma_get_max_seg_size(dev) + 1, PAGE_SIZE)
- >> PAGE_SHIFT;
- else
- boundary_size = ALIGN(1UL << 32, PAGE_SIZE) >> PAGE_SHIFT;
-
- BUG_ON(!is_power_of_2(boundary_size));
+ if (dev) {
+ boundary_size = dma_get_seg_boundary(dev) + 1;
+ BUG_ON(!is_power_of_2(boundary_size));
+ boundary_size >>= PAGE_SHIFT;
+ } else {
+ boundary_size = 1UL << (32 - PAGE_SHIFT);
+ }
/* Search forward for the first mask-aligned sequence of N free ptes */
ptes = arena->ptes;