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)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Wed, 14 May 2014 06:09:24 +0000 (23:09 -0700)
commit9e723827c76c34bdab7b8ca9584537c3366f280d
tree35c92911a9987101499ba80c771e6ece7ee13a6e
parent7d8fd07a26e33ba53a71dae475dc1074d52767a8
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/385920
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
Tested-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
security/tlk_driver/ote_comms.c