[FOSS_TLK]security: tlk: common function to switch to CPU0
authorVarun Wadekar <vwadekar@nvidia.com>
Thu, 11 Dec 2014 01:16:40 +0000 (06:16 +0530)
committerVarun Wadekar <vwadekar@nvidia.com>
Thu, 18 Jun 2015 12:09:54 +0000 (05:09 -0700)
commit96d3be530ee87a78f86f58a8d8ff5d1cfa14c20b
tree0aadc6757036c66b4c696c769c9477a7996a7971
parent194cb64c4c0dff1acd67bda79c81da4298a21346
[FOSS_TLK]security: tlk: common function to switch to CPU0

TLK runs only on CPU0 so we have to switch CPUs before we
issue any request to the secure world. There are instances
when the requests are sent from workqueues which need some
extra code before we can run on CPU0. Previously, we used
this code only for resizing VPR regions. But it seems that
the requests for TAs can also benefit from this approach.

Encapsulate the logic in a common function, send_smc(), and
remove tlk_generic_smc(), tlk_extended_smc() functions. For
non-PF_NO_SETAFFINITY scnearios, check we can switch the
CPU mask to run on CPU0. If for some reason the CPU switch
fails, then we schedule work on CPU0 instead. This takes care
of the previous corner cases when the CPU switch failed and
we continued on the same CPU.

Change-Id: I3797bb50acbf379a4ddc49c90206d6d697549471
Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>
Reviewed-on: http://git-master/r/755006
Reviewed-by: Automatic_Commit_Validation_User
security/tlk_driver/ote_asm.S
security/tlk_driver/ote_comms.c
security/tlk_driver/ote_device.c
security/tlk_driver/ote_fiq_glue.c
security/tlk_driver/ote_fs.c
security/tlk_driver/ote_log.c
security/tlk_driver/ote_protocol.h