Skip to content

Commit

Permalink
powerpc/iommu: Fix iommu pool initialization
Browse files Browse the repository at this point in the history
The iommu pool patch has a bug where it would cause a crash when using
only one pool (based on the size of the DMA window).

Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
  • Loading branch information
Benjamin Herrenschmidt committed Jul 13, 2012
1 parent af3bf7f commit dcd261b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/powerpc/kernel/iommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,9 @@ struct iommu_table *iommu_init_table(struct iommu_table *tbl, int nid)
tbl->nr_pools = 1;

/* We reserve the top 1/4 of the table for large allocations */
tbl->poolsize = (tbl->it_size * 3 / 4) / IOMMU_NR_POOLS;
tbl->poolsize = (tbl->it_size * 3 / 4) / tbl->nr_pools;

for (i = 0; i < IOMMU_NR_POOLS; i++) {
for (i = 0; i < tbl->nr_pools; i++) {
p = &tbl->pools[i];
spin_lock_init(&(p->lock));
p->start = tbl->poolsize * i;
Expand Down

0 comments on commit dcd261b

Please sign in to comment.