security: tlk_driver: pass device info to DMA API
authorAmit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Tue, 25 Aug 2015 08:11:09 +0000 (13:11 +0530)
committerSachin Nikam <snikam@nvidia.com>
Mon, 31 Aug 2015 05:21:28 +0000 (22:21 -0700)
commit588d5915d732a454d245997cedadb5537c9b2220
treed8211531a3909912ff96c294564f844cdb33a950
parentfde164907949d2b40a5858cc71cf52aed84ed737
security: tlk_driver: pass device info to DMA API

API: circ_buf_init() allocates a shared buffer in DMA memory for TLK logging.
For this it calls dma_alloc_coherent() API with first arg: device as NULL.
However, in order to monitor the DMA'able memory in debugfs "/d/dma/usage",
we need the device name info of each client which uses the DMA memory API's
like: dma_{alloc/free}_coherent.

Inorder to get the device info do following:
1) change  startup sequence from arch_initcall to module_init
2) extern declaration of tlk_misc_device in 'ote_protocol.h' and pass
   'tlk_misc_device.this_device' info to DMA API's.

Bug 200134203

Change-Id: Idfb805f84cfd9df1d4c1762740628852c0acca9c
Signed-off-by: Amit Sharma (SW-TEGRA) <amisharma@nvidia.com>
Reviewed-on: http://git-master/r/788697
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
security/tlk_driver/ote_log.c
security/tlk_driver/ote_protocol.h