Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+2 -2
+2 -2
arch/powerpc/kernel/iommu.c
··· 676 676 tbl->nr_pools = 1; 677 677 678 678 /* We reserve the top 1/4 of the table for large allocations */ 679 - tbl->poolsize = (tbl->it_size * 3 / 4) / IOMMU_NR_POOLS; 679 + tbl->poolsize = (tbl->it_size * 3 / 4) / tbl->nr_pools; 680 680 681 - for (i = 0; i < IOMMU_NR_POOLS; i++) { 681 + for (i = 0; i < tbl->nr_pools; i++) { 682 682 p = &tbl->pools[i]; 683 683 spin_lock_init(&(p->lock)); 684 684 p->start = tbl->poolsize * i;