security: tlk_driver: ensure VPR SMC occurs on CPU0
authorChris Johnson <cwj@nvidia.com>
Mon, 24 Mar 2014 23:54:40 +0000 (16:54 -0700)
committerSimone Willett <swillett@nvidia.com>
Tue, 13 May 2014 21:34:00 +0000 (14:34 -0700)
commitb42a6d5d4475c0ef5339d7583abb7347ea6276e8
tree75c2d0828f468306ef8093db5be63b87a2c0bf3e
parent17fa41423e194410d5270706733e77344aff3a42
security: tlk_driver: ensure VPR SMC occurs on CPU0

The te_set_vpr_params routine is called both by normal user mode
threads and worker threads as part of a free/shrink of VPR.

The calls from worker threads, will fail in sched_setaffinity()
because they have  PF_NO_SETAFFINITY set, so previously no switch
occurred and the SMC issued on something other than CPU0.

This change detects the worker thread case, and if needed, issues
a work_on_cpu() instead for the VPR programming.

Bug 1473456

Change-Id: I76fa71c577e243b073cabb93928e688fdf7833ec
Signed-off-by: Chris Johnson <cwj@nvidia.com>
Reviewed-on: http://git-master/r/385924
(cherry picked from commit 30fed4ced5517c8c78b34d3a8db734263cf5d798)
Reviewed-on: http://git-master/r/406698
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Tested-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Thomas Cherry <tcherry@nvidia.com>
security/tlk_driver/ote_comms.c