Skip to content

Commit d3d4ffa

Browse files
aikmpe
authored andcommitted
powerpc/powernv/ioda2: Reduce upper limit for DMA window size
We use PHB in mode1 which uses bit 59 to select a correct DMA window. However there is mode2 which uses bits 59:55 and allows up to 32 DMA windows per a PE. Even though documentation does not clearly specify that, it seems that the actual hardware does not support bits 59:55 even in mode1, in other words we can create a window as big as 1<<58 but DMA simply won't work. This reduces the upper limit from 59 to 55 bits to let the userspace know about the hardware limits. Fixes: 7aafac1 "powerpc/powernv/ioda2: Gracefully fail if too many TCE levels requested" Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
1 parent aad15cc commit d3d4ffa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/powerpc/platforms/powernv/pci-ioda.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2840,7 +2840,7 @@ static long pnv_pci_ioda2_table_alloc_pages(int nid, __u64 bus_offset,
28402840
level_shift = entries_shift + 3;
28412841
level_shift = max_t(unsigned, level_shift, PAGE_SHIFT);
28422842

2843-
if ((level_shift - 3) * levels + page_shift >= 60)
2843+
if ((level_shift - 3) * levels + page_shift >= 55)
28442844
return -EINVAL;
28452845

28462846
/* Allocate TCE table */

0 commit comments

Comments
 (0)