aboutsummaryrefslogtreecommitdiff
path: root/arch/powerpc/kernel
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-07-13 17:45:49 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2012-07-13 17:45:49 +1000
commitdcd261ba58d7a49f4624b34b3bd2d535f63643a2 (patch)
treeb170d0c3581d11294e25bd8f5cb795a930876d10 /arch/powerpc/kernel
parentaf3bf7fbe0148aadc8fedd6f5e5279cabef9ced5 (diff)
powerpc/iommu: Fix iommu pool initialization
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>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r--arch/powerpc/kernel/iommu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c
index fbefe729df3..ff5a6ce027b 100644
--- a/arch/powerpc/kernel/iommu.c
+++ b/arch/powerpc/kernel/iommu.c
@@ -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;