Commit Graph
1505 Commits
Author SHA1 Message Date
Gilad Broner fe77c2203e tspp: add locking to tspp_get_buffer() and tspp_release_buffer()
The tspp driver keeps a list of all the buffers and their current
state. When interrupt occurs to signal new data is available some
buffers state is updated. tspp_get_buffer and tspp_release_buffer
also change the state of buffers. This change adds locking in these
functions to protect against concurrent update which may lead to
an invalid state.

Change-Id: I6331a49bcd0a57e6b9ef8c3860bf8ca9d0e0190b
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2014-06-22 10:47:53 +03:00
Zhen Kong e5b434eba6 qseecom: update cumulative_mode and timer properly
qseecom.cumulative_mode is used to track the cummulative bus request
mode from all concurrent running clients. It is registered before
send_cmd operation, but is not un-registered after it is complete.
This may cause the bus bandwidth is restored to a wrong mode after
resuming from sleep. Thus, we make change to update it accordingly.
qseecom.current_mode is also updated in suspend/resume function to
ensure timer can scale down bus bw after resume when cumulative_mode
is non-zero. Besides, timer operation is optimized in case there are
multiple unserialized concurrent users of the same timer.

Change-Id: I06043d2b88a47e24da03460fe1ae26a94cb6a608
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-04-30 21:16:36 -07:00
Zhen Kong 4bead3c540 qseecom: register bus bandwidth mode when loading app
When there are multiple running qseecom clients, ce clock may be disabled
by one client while TZ is still loading another client's app, which will
lead to load app failure. So, we make a change to register bus bandwidth
mode before loading app and avoid to disable clock when current bandwidth
mode is not INACTIVE.

Change-Id: I1727f6fc038baf95da39089e1f0faefe42f3d40c
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-04-28 10:11:46 -07:00
Zhen Kong 05ed446763 qseecom: Check the return value of "ion_phys"
Check for return value of "ion_phys" and handle
the error cases appropriately.

Change-Id: Ib4f24af24de2b2553ed91479f46b2f79e0be0446
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-04-28 10:11:36 -07:00
Zhen Kong fd64c98e99 qseecom: Fix failure to load cmnlib image
Set the physical address field of load_req data struct
correctly using the right ion_phys API. Without this,
secure domain is not able to address/dereference memory
where cmnlib image resides.

Change-Id: I9f75e78227e4eee89fff9ad8b19701ff08e5d90a
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-04-28 10:11:23 -07:00
Zhen Kong c46b584500 qseecom: Replace kzalloc with ion_alloc
Allocate memory to common lib through kzalloc issues no page errors due to
higher order memory request. So allocate the memory from the heap specially
dedicated to QSEECOM.

Change-Id: Ice4a609d6791ce5adc84b9882231def31674f461
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-04-28 10:11:10 -07:00
Linux Build Service Account f32879bea7 Merge "msm: tspp: Request IRQs on first use" 2014-04-17 10:43:56 -07:00
Linux Build Service Account 19a7accb61 Merge "qseecom: add support to clear key for per file encryption" 2014-04-17 10:43:29 -07:00
Gilad Broner 6049ea35fb msm: tspp: Request IRQs on first use
Reserving the IRQs on driver initialization is redundant and should
be done only when client first uses the driver. Also, it may prevent
transition to power saving modes.
Move IRQ requests to be done when first stream is opened, and free
when last stream is closed.

Change-Id: Ifdb7099139f5eb775fcdd61dc0eece5c9959a050
Signed-off-by: Gilad Broner <gbroner@codeaurora.org>
2014-04-17 05:25:53 -07:00
Hariprasad Dhalinarasimha ba30614ac8 qseecom: Fix issues with failure to release client handle
There exists scenarios when qseecom_release is called,
the client handle type is incorrect; hence proper cleanup
is not done with regards to unloading app or cleaning up
memory allocated for the device handle.
This change addresses all cleanup issues related to qseecom
client in qseecom_release call by ensuring the handle type is
set correctly and cleanup is done properly based on client type.

Change-Id: I126aa431ce635ae98100b774e3d92b704635d199
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
(cherry picked from commit f12641d6733009c4cd502d3ba25cb3c5d61ab5e2)
2014-04-10 13:58:11 -07:00
Hariprasad Dhalinarasimha bd0c54513a qseecom: Unload the app upon receiving qseecom_release.
Upon receiving qseecom_release() app corresponding to the app id
needs to be shutdown.This is applicable to user space clients as well.

Change-Id: Ie659a9409f8470b7ed4a5088e6779b50c5dc1cca
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
(cherry picked from commit 1e34cdd714219a4cd0acb3d5b3dfe4280c380699)
2014-04-10 13:56:58 -07:00
Zhen Kong a69c16e0f7 qseecom: Validate pointer offset in qseecom_send_modfd_cmd
Validate cmd_req_buf pointer offset in qseecom_send_modfy_cmd, and
make sure cmd buffer address to be within shared bufffer.

Change-Id: I431511a92ab2cccbc2daebc0cf76cc3872689a97
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-04-09 04:37:19 -07:00
Linux Build Service Account 8d9bc57c4c Merge "qseecom: change bus scale up mode in resume function" 2014-04-08 15:38:06 -07:00
Zhen Kong 98b0e51b66 qseecom: change bus scale up mode in resume function
The maximum bus bandwidth mode supported by bus bandwidth setting
function is 3 (i.e., HIGH), then to scale up bus bandwidth based on
cumulative mode may prevent us from updating the bus bandwidth
correctly when cumulative mode is greater than 3 (which is the case
if there are concurrent applications running). Thus, we made a
change to scale up bus bandwidth mode to at most 3 in qseecom
resume function.

Change-Id: I3ec6eedace2fa2ea7de519df307c3ff9b193c910
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-04-07 16:04:54 -07:00
Zhen Kong ba69dfe7e8 qseecom: add support to clear key for per file encryption
Make a KMS change to support just clear pipe key without deleting it
from ssd storage. Key id definitions for FDE and PDE are also updated.

Change-Id: I7c4804902a7a734087374c81ff0fd95655d84429
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-03-25 13:24:56 -07:00
Zhen Kong a10dcab66e qseecom: Check for FDE/PFE feature
Add checks for PFE/FDE feature before executing anything
related to the feature.

Change-Id: I575d4d4eea29fd9ae59e47805793f2416a97f5b9
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-03-25 13:24:56 -07:00
Zhen Kong 4ffeacf17f qseecom: Add support for PFE feature
Add key management support for crypto HW used for
PFE (per file encryption) features.

Change-Id: Ic0664973d9a4099f76d7b3040f0f81df8465cf71
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-03-25 13:24:50 -07:00
Linux Build Service Account e73ad76250 Merge "misc: qfpfuse: validate ioctl input parameters" 2014-03-25 02:12:57 -07:00
Linux Build Service Account 2cc01c4dd8 Merge "misc: qfpfuse: Fix overflow condition" 2014-03-25 02:12:52 -07:00
Linux Build Service Account ae0f7ca684 Merge "qseecom: Change pr_warning message to pr_debug" 2014-03-23 11:46:43 -07:00
Linux Build Service Account 5708fffe44 Merge "qseecom: Ensure CE clk is managed properly" 2014-03-21 23:53:59 -07:00
Linux Build Service Account 444a86c0f2 Merge "qseecom: change qseecom bus scaling timer operation" 2014-03-21 21:02:40 -07:00
Linux Build Service Account a6b0255445 Merge "qseecom: Validate the pointer returned by ion_import_dma_buf" 2014-03-21 15:59:30 -07:00
Zhen Kong ca4c2d50c8 qseecom: Ensure CE clk is managed properly
clk access ref count is not updated correctly when issuing a
request that requires enabling clk. this results in leaving the
clk on during regular operation resulting in failure of the
device to go into low power mode.

Change-Id: I80232433ff09277fe83d78142dcec75e7493d96e
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-03-20 12:53:26 -07:00
Zhen Kong af95019c9e qseecom: change qseecom bus scaling timer operation
To ensure ce clock is not disabled before tz operation is completed,
we delete the old timer when tz side operation begins, and then add
a new timer after tz operation is completed.

Change-Id: I4bc8fe3d9305cc1ed5db8e6490832fcc791ef3d7
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-03-20 10:23:40 -07:00
Zhen Kong e8a0208934 Revert "qseecom: change qseecom bus scaling timer operation"
This reverts  commit 06418b7976.

Change-Id: I59a93084584e7a2608d8af097bdbb50391c5a052
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-03-20 10:20:29 -07:00
Venkatesh Yadav Abbarapu e4ca8f47f9 misc: qfpfuse: validate ioctl input parameters
validate input parameters for ioctl command request

CRs-Fixed: 550574,550575
Change-Id: I87c3818b3bacc43c679aa555d79cc6ed127c6ef8
Acked-by: John Nicholas <jnichola@qti.qualcomm.com>
Signed-off-by: Venkatesh Yadav Abbarapu <quicvenkat@codeaurora.org>
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
2014-03-18 17:37:46 +05:30
Venkatesh Yadav Abbarapu 011d62caf2 misc: qfpfuse: Fix overflow condition
Fix potential integer overflow for ioctl command to avoid incorrect
buffer allocation. Use the stack for data buffering to avoid the
small buffer allocation for improved performance. Increase the fuse
blow timeout in the driver to cover all QFPROM implementations.

CRs-Fixed: 550574,550575

Change-Id: Iee3cc1d38aa5dbf8ef693a43a0ca716fc8724c62
Acked-by: Radhakrishna Popuri <c_rpopur@qti.qualcomm.com>
Signed-off-by: Venkatesh Yadav Abbarapu <quicvenkat@codeaurora.org>
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
2014-03-18 17:34:53 +05:30
Hariprasad Dhalinarasimha 1401bc0b7e qseecom: Validate the pointer returned by ion_import_dma_buf
Do a "IS_ERR_OR_NULL" check for the return value of
ion_import_dma_buf.

Change-Id: Iaac8b59b1f076d002430e0e6aba055bd88c83ed7
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2014-03-14 00:12:42 -07:00
Linux Build Service Account 71d50622ff Merge "qseecom: Validate shared buffer length & virtual address" 2014-02-28 19:22:48 -08:00
Linux Build Service Account 3fc6b8c30b Merge "qseecom: change qseecom bus scaling timer operation" 2014-02-28 04:32:45 -08:00
AnilKumar Chimata bb51272ec4 qseecom: Fix clock get failures
Pass the device node with of_node to clk_get(), to get the clock struct.
This patch fixes the issue by passing proper device handle with of_node
to clock APIs to get the appropriate clock node.

Change-Id: I01a2caf7d86a4399b1bb4a455ef8ecbbad5ad9a2
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
2014-02-27 23:56:20 -08:00
Linux Build Service Account 058bfa6d29 Merge "qseecom: update clock ref count when bus scaling timer is running" 2014-02-26 17:27:23 -08:00
Pavankumar Kondeti 1faf31c45c USB: HSIC SMSC HUB: Add support for 3502 model
The SMSC 3502 HUB has only one USB UICC port. "VBAT only" single
supply configuration is used. A gpio is used to control the
external oscillator which supplies the ref clock to the HUB. USB
UICC card is connected to this HUB on MSM8926. Provide a sysfs
interface for userspace to enable/disable the HUB. This is
required to save the power when a non-supported card is inserted.

The HUB is disabled during boot. If the card is inserted and supports
UICC, HUB is enabled by the userspace.

Change-Id: Ic2b0c5bd2066a2ecae7f18aac2ab8d0bc2f075c0
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2014-02-25 13:46:47 +05:30
Pavankumar Kondeti 8ceaa5f935 USB: HSIC SMSC HUB: Add support for standalone HSIC configuration
When model-id is passed as 0, interpret it as standalone HSIC
configuration. Add HSIC platform device and don't look for HUB
resources. This is required to support both stand alone and HUB
configurations on different boards based on the same SoC.

Change-Id: Iec081799048dd93ece1472d95a7e1c27f91fb9b9
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2014-02-25 13:46:47 +05:30
Pavankumar Kondeti 9c7a644548 USB: HSIC SMSC HUB: Fix device tree style problems
Add the missing documentation for some device tree properties. Fix
the regulator supply naming convention.  The hub-vbus supply is
optional. Don't call regualtor_get on this supply unconditionally.
This leads to unnecessary multiple probe deferrals.

Change-Id: I866bfb9d87ad274030b7997461e89c6bc42f6d98
Signed-off-by: Pavankumar Kondeti <pkondeti@codeaurora.org>
2014-02-25 13:46:46 +05:30
Zhen Kong 06418b7976 qseecom: change qseecom bus scaling timer operation
To ensure ce clock is not disabled before tz operation is completed,
we delete the old timer when tz side operation begins, and then add
a new timer after tz operation is completed.

Change-Id: I4bc8fe3d9305cc1ed5db8e6490832fcc790ef3d7
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-02-24 18:00:01 -08:00
Zhen Kong ea5d4bb6f7 qseecom: update clock ref count when bus scaling timer is running
When there are multiple enable/dislable clock operations, ce clock
ref count is not updated correctly when the timer to disable clock
is running. Specifically, the ref count is not decreased when the
old operation is finished and then we reset clock for the new enable
clock. Thus, the ce clock is not disabled after all operation are
completed due to incorrect clk ref count. We make a change to
decrease clock reference count before reset timer, when the timer
is running, then clock is disabled when all ce clock operations
finish and the timer expires.

Change-Id: If71fd526acd9a74bf21731841fae0b98e76a89b5
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-02-24 17:59:55 -08:00
Hariprasad Dhalinarasimha 4b61e2af54 qseecom: Validate shared buffer length & virtual address
Return -EINVAL if virtual addr of shared buffer is NULL or
shared buffer length is 0

Change-Id: I44369bf12ddafa63b71ee54496eb86b2615d4322
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2014-02-24 10:58:32 -08:00
Hariprasad Dhalinarasimha f44cbd2eff qseecom: Change pr_warning message to pr_debug
Change warning message to debug message to reduce the excessive logging.
These changes are applicable only if any process is trying to interrupt
the blocking listener services.

Change-Id: Ie1c9af0daf16ef2c39e198f30b0151e2246d79e3
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2014-02-19 10:46:56 -08:00
Zhen Kong a0944b8841 qseecom: Add basic suspend resume functionality
If ce clock is not disabled in suspend state, memory may be corrupted and
device can not wake up. Thus,if clock is enabled, we disable it in qseecom
suspend function and re-enable it again in resume function.

Change-Id: I70349ad3070c340add1f3fbe392a4bec2b8af9bf
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-02-11 23:40:53 -08:00
Zhen Kong ca39e441af qseecom: change key management apis
Remove 2 seconds sleep if create_key or update_key fails, and
this delay is now handled by TZ. change errno when maximum
attempt to input password is reached.

Change-Id: I14350219f43094d280ebc1e3717418285063448d
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-02-05 10:02:03 -08:00
Chun Zhang d02c50dadc misc: isa1200: correct overdrive enablement bit shift
Overdrive enablement bit sits at 6th bit of control register 0.
Current shifting overwrites overdrive high bit.

Change-Id: I4cdd435da86a234ccf0465462be7626162cc8a9d
Signed-off-by: Chun Zhang <chunz@codeaurora.org>
2014-01-21 16:50:50 -08:00
Linux Build Service Account ef95fe0008 Merge "qseecom: Add support for bus scaling" 2014-01-21 12:29:41 -08:00
Hariprasad Dhalinarasimha 1033d5c187 qseecom: Removal of flags and options to protect listener memory
With the new ION design all memory allocated from secure heaps is
secured already at allocation time. This commit effectively rolls
back a change introduced to secure this memory at runtime.

Change-Id: I94bf0a7f6d477b04da7ad6786111f8c970516842
Acked-by: Christian Bolis <cbolis@qti.qualcomm.com>
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
2014-01-09 15:34:08 -08:00
Zhen Kong 2edf90dc3c qseecom: Add support for bus scaling
Add support for scaling bus to various level:
LOW, MEDIUM, HIGH.  Expose IOCTL to user space
clients to enable selecting a specific bus bandwidth
setting.

Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-01-09 14:10:55 -08:00
Linux Build Service Account ada988c27f Merge "qseecom: Fix issues on key management scheme" 2014-01-08 18:30:34 -08:00
Zhen Kong f4948193c4 qseecom: Add checks for user space buffer pointers
Validate pointers send from user space and pointers
embedded within the mesasge sent from user space.

Change-Id: I1be54924ef3d301908af6e8d4e6506f2aa7f6428
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2014-01-04 16:46:02 -08:00
Zhen Kong 9730ddf807 qseecom: Fix issues on key management scheme
The mechanism to update how a user is tied to an existing key is
added. And the app_access_lock mutex is removed in key management
APIs, as there is no need to lock app access while processing a
key related request.

Signed-off-by: Zhen Kong <zkong@codeaurora.org>
2013-12-20 16:15:22 -08:00
Linux Build Service Account 20fc06ab71 Merge "msm: tspp: Fix memory leak" 2013-12-16 15:05:09 -08:00