From 9d97af9e9fd461ed8e69cadb027fe639d7e3247b Mon Sep 17 00:00:00 2001 From: Alex Waterman Date: Mon, 26 Sep 2016 10:29:25 -0700 Subject: gpu: nvgpu: Return -EINVAL for bad l2 flush args When the L2 flush IOCTL gets no l2 flush and no fb flush we now return -EINVAL. This can sometimes happen if the user tries to just invalidate. Currently we do not support L2 invalidates only. Bug 1661242 Change-Id: I87f3259bfbd736b5f4222cfe7b3cfa4a6475389e Signed-off-by: Alex Waterman Reviewed-on: https://git-master.nvidia.com/r/1227125 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c index 0357f098..220cb3e7 100644 --- a/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/common/linux/ioctl_ctrl.c @@ -330,6 +330,10 @@ static int nvgpu_gpu_ioctl_l2_fb_ops(struct gk20a *g, { int err = 0; + if ((!args->l2_flush && !args->fb_flush) || + (!args->l2_flush && args->l2_invalidate)) + return -EINVAL; + if (args->l2_flush) g->ops.mm.l2_flush(g, args->l2_invalidate ? true : false); -- cgit v1.2.2