]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
powerpc/powernv: Fix insufficient memory allocation
authorAlexey Kardashevskiy <aik@ozlabs.ru>
Thu, 12 May 2016 05:47:09 +0000 (15:47 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Thu, 12 May 2016 09:55:42 +0000 (19:55 +1000)
commit92a86756904b127a3450262b33c0b9f8e99f6b36
treec18fbaa7f6befe90213fda1ff69cdb8c47bb5a42
parent8445a87f7092bc8336ea1305be9306f26b846d93
powerpc/powernv: Fix insufficient memory allocation

The pnv_pci_init_ioda_phb() helper allocates a blob to store auxilary
data such PE and M32/M64 segment allocation maps; this single blob has
few partitions, size of each is derived from the PE number -
phb->ioda.total_pe_num.

It was assumed that the minimum PE number is 8, however it is 4 for NPU
so the pe_alloc part was missing in the allocated blob. It was invisible
till recently as we were not tracking used M64 segments and NPUs do not
use M32 segments so the phb->ioda.m32_segmap (which was pointing to the
same address as phb->ioda.pe_alloc) has never been written to leaving
the pe_alloc memory intact.

After commit 401203ac2d "powerpc/powernv: Track M64 segment consumption"
the pe_alloc gets corrupted and PE allocation cannot work. This fixes
the issue by enforcing the minimum PE number to 8.

Fixes: 401203ac2d15 ("powerpc/powernv: Track M64 segment consumption")
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/platforms/powernv/pci-ioda.c