powerpc/powernv/npu: Prevent overwriting of pnv_npu2_init_contex() callback parameters
authorAlistair Popple <alistair@popple.id.au>
Wed, 11 Apr 2018 06:38:55 +0000 (16:38 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Mon, 23 Apr 2018 23:46:57 +0000 (09:46 +1000)
commita1409adac748f0db655e096521bbe6904aadeb98
treeaa0b71b847bac835ef5bd59704f308d4b2e0998f
parent28a5933e8d362766462ea9e5f135e19f41e658ba
powerpc/powernv/npu: Prevent overwriting of pnv_npu2_init_contex() callback parameters

There is a single npu context per set of callback parameters. Callers
should be prevented from overwriting existing callback values so
instead return an error if different parameters are passed.

Fixes: 1ab66d1fbada ("powerpc/powernv: Introduce address translation services for Nvlink2")
Cc: stable@vger.kernel.org # v4.12+
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reviewed-by: Mark Hairgrove <mhairgrove@nvidia.com>
Tested-by: Mark Hairgrove <mhairgrove@nvidia.com>
Reviewed-by: Balbir Singh <bsingharora@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/powernv.h
arch/powerpc/platforms/powernv/npu-dma.c