Commit ab875cf6 authored by Ivan Kokshaysky's avatar Ivan Kokshaysky Committed by Linus Torvalds

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: default avatarIvan Kokshaysky <ink@jurassic.park.msu.ru>
Reported-and-tested-by: default avatarBob Tracy <rct@frus.com>
Acked-by: default avatarFUJITA Tomonori <tomof@acm.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 393d94d9
...@@ -144,15 +144,14 @@ iommu_arena_find_pages(struct device *dev, struct pci_iommu_arena *arena, ...@@ -144,15 +144,14 @@ iommu_arena_find_pages(struct device *dev, struct pci_iommu_arena *arena,
unsigned long base; unsigned long base;
unsigned long boundary_size; unsigned long boundary_size;
BUG_ON(arena->dma_base & ~PAGE_MASK);
base = arena->dma_base >> PAGE_SHIFT; base = arena->dma_base >> PAGE_SHIFT;
if (dev) if (dev) {
boundary_size = ALIGN(dma_get_max_seg_size(dev) + 1, PAGE_SIZE) boundary_size = dma_get_seg_boundary(dev) + 1;
>> PAGE_SHIFT; BUG_ON(!is_power_of_2(boundary_size));
else boundary_size >>= PAGE_SHIFT;
boundary_size = ALIGN(1UL << 32, PAGE_SIZE) >> PAGE_SHIFT; } else {
boundary_size = 1UL << (32 - PAGE_SHIFT);
BUG_ON(!is_power_of_2(boundary_size)); }
/* Search forward for the first mask-aligned sequence of N free ptes */ /* Search forward for the first mask-aligned sequence of N free ptes */
ptes = arena->ptes; ptes = arena->ptes;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment