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 <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1227125
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Alex Waterman
2016-09-26 10:29:25 -07:00
committed by mobile promotions
parent bc4182afeb
commit 9d97af9e9f

View File

@@ -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);