In case of time penalty coming from TZ side when the wrong password
is entered too many times, there should be sleep between the scm calls
to give other HLOS tasks opportunity to run. Otherwise starvation may
occur.
Change-Id: I345a9b6c82fb5e591d8bdcf48afed48ccaafddc3
Signed-off-by: Andrey Markovytch <andreym@codeaurora.org>
Fix overwrite of updt_params allocated in heap, and stack overread
where param pointer is passed from user space.
CRs-Fixed: 989628
Change-Id: Ida8bdb7da2fcb97023dce3b6eafe4b899a51cb66
Signed-off-by: Weiyin Jiang <wjiang@codeaurora.org>
Add flag commonlib64-loaded-by-uefi to indicate commonlib64
is loaded by uefi already.
Change-Id: I9dd3f6bf92e178f1207424b09f39f2e08164df17
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Read commands are currently assigning 64bit physical address
to 32bit token. There is a possibility that this physical address
may have same lower 32bit values which could cause errors. Fix
by assigning session id as the token value.
Change-Id: Ie704e34338201ecec191b2031d20552691aed3ea
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
Use tokens to track all active no wait commands.
In ASM driver, certain commands are waited on to get response
from ADSP. There is a possibility that certain no-wait
commands can be improperly recognized and woken up leading
to time outs.
Change-Id: I2030a354493845b63cf92d35ca4eaadef38cfb79
Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
If a scm_call request to shutdown a TA fails, the TA is not shut down
and still in use, and the resources aren't necessarily leaked. Since
shared memory are still locked in this situation, ion shared memory
cannot be released, otherwise XPU violation occurs. Only need to
release shared memory if TA is unloaded success or that TA cannot
be found
Change-Id: I971485fb541193f77960cc7ca14b5b09de938a43
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
The uapi directory shouldn't contain compat definitions,
so move this file out of there.
Change-Id: Ieef35ec02157c253a137c1b1bce3c6518c7f1b31
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
For kernel clients, some of the flags are maintained which is not required
as those are specific to userspace clients. So remove the code which is
not required.
Change-Id: If7fb51cc17e9a8c0f3c2632e9c42d84489bda4f6
Signed-off-by: Mallikarjuna Reddy Amireddy <mamire@codeaurora.org>
Add the qcom,pwm-sel and qcom,enable-gp-driver properties to
the MISC device driver to enable configuring the PWM source.
Currently this will be supported only for pmdcalifornium.
CRs-Fixed: 972331
Change-Id: I320edac22b20d748a531a41eaff06162092cfd3d
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
Let the QPNP_MISC config depend on the SPMI or the
MSM_SPMI configs instead of SPMI only.
CRs-Fixed: 972331
Change-Id: I9a0d53c6cf0aeeaf258cfca5706c68a6a8b7e37a
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
This patch adds a snapshot of the QPNP misc driver as of msm-3.14
commit:
e016c39467094409c9c872b02ec619164913054a (Merge "msm: thermal:
Fix compilation issue when THERMAL_MONITOR is disabled")
CRs-Fixed: 972331
Change-Id: I48dc9857379c388ddff86b20320cdfa23bb22af8
Signed-off-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
To avoid memory leakage, make change to release ION memory if qseecom
failed to unload TZ app, which is allocated when starting app.
CRs-Fixed: 977073
Change-Id: Ic4c9a7d7a118ff5026ce6ce7769a4c053906ed2d
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
This patch adds support for SSM driver which is
a framework to which a client can register itself specifying
different attributes and defining various permission levels associated
with different combination of attribute values and mode of the system.
CRs-Fixed: 970190
Change-Id: Ia030ebad56a22ba9103af17f6557c7906b762b76
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
App region notification has to be sent only once, if appsbl
has already sent then kernel should not send.
Change-Id: Ie1c7bb78be30c723fef6d9b89d488fdac36bc07f
Signed-off-by: Mallikarjuna Reddy Amireddy <mamire@codeaurora.org>
The hdcp 2.2 module may or may not be loaded based on source
and sink capabilities. Some of the common functionalities with
hdcp 1.4 may be accessed by different modules depending on which
hdcp version is being used. Check for validity of internal data
structures and variables to guard hdcp functionalities against
illicit calls.
Change-Id: I1383ae77f0b904589bcab571c902b5e3eeef6efa
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Enable CE clocks before calling SCM. This is required to
check if MDTP is activated during recovery and to update the DIP
as required in case it is.
Change-Id: I01907d7cebae007c7f6a33d4bf29b3e4fc6e493c
Signed-off-by: Reut Zysman <rzysman@codeaurora.org>
Signed-off-by: Amit Blay <ablay@codeaurora.org>
Make changes to use strcmp to compare app name, and
avoid the memcpy comparision error if the first
several chars of an app name is exactly equal to
another app name. Besides, on some targets, keymaster
app may be first loaded as "keymaste" by qseecomd,
and then used as "keymaster". To avoid checking app
name error, register "keymaster" into app_list and
thread private data.
Change-Id: I468b4e5cb1d5d77ac5d687d0bddc8614b972785f
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Give upper layers enough time to turn on screen before
falling back into SUSPEND.
Change-Id: I162f25dffdbbeb783d0bca673d6e6db8de412aac
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
A new smc cmd is added to check RPMB key provision status
Change-Id: I50411bf9ae7f31589be34d7b5aaf48f2c12f0018
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Send stream management message to sink after topology update. Poll
for new message or authentication required status after successful
receiver or repeater authentication. Also, DDC hardware polls sink
for a given time. Let the polling complete and do not treat intermediate
DDC errors as failures because DDC transaction can pass in next
iteration. Once polling ends, check for errors and timeouts and reset
polling data. Treat these errors as failure only after polling ends.
Change-Id: I286fb00cf935bff493e108c05df625d5ca3ade26
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Implement qseecomm API to send command to TZ to enable/disable
encryption based on hdcp status. Enable encryption when hdcp
part 1 is successful and disable it when cable is disconnected
or authentication fails.
Change-Id: Ia5e1a5927dad36abc3093b16638879be823c84df
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Provide user an option to let the HDCP2.2 authentication
run on main thread. Avoid processing on module threads
thus avoiding any scheduling delays. The user may choose
to switch to this mode based on its requirements.
Change-Id: I76ec4a18f0fc52e99bbe76b6707511d3af6151f3
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
qseecom_send_modfd_cmd_64 converts non-contiguous ION memory fd to
scatter-gather physical address list, and supports up to 512 SG list
entries. Now, 512 is not enough if client wants to send large data
in a fragmented system. In this change, if SG list entry number is
larger than 512, we will allocate a new contiguous kernel buffer,
then save all SG entries into this new buffer.
Change-Id: Id90eefb98b63bf16db755dae8e1482e448090f47
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
In audio ion driver, append msm_audio_ to API
populate_upper_32bits to maintain consistency
across other API names in this driver.
Change-Id: I72aace56bf8e80c6dd83f768876253d2c7f334bb
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
Fix some variable initializations which would otherwise cause
forbidden warnings.
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Apart from authentications start, if any other work is already
queued, do not return any error in that case as the work is
going to run eventually. This doesn't apply for authentication
start as last session should have been closed before new one
is started.
Change-Id: If5f61f05758135d303974f8bd824ffcc9387259d
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Implement timers as per HDCP 2.2 standard for every message exchanged
with sink. The standard provides round trip timeout values for each
transaction. Use these timeout values and consider it as authentication
failure if timer expires.
Change-Id: I1fb647b70b8c3aafaeb6e91fd3f636d387247133
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Validate current hdcp lib state before starting new hdcp session.
Double buffer the sink message and protect its access with mutex
to handle fast re-authentication requests.
Change-Id: I039b1a0c818a2e66eef583afb15420ce8587a75c
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Do not load hdcp1.x app at runtime and keep the app status for
future use. Whenever cable is connected and hdcp 1.x needs to
be started, just set keys using app. This avoids any possible
app load - unload issues in some corner cases.
Change-Id: Ic7f55ab74d6cb6b9ff654eb32c0bed8a44f70007
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Check if a new device is connected to the HDMI network. Repeater
provides new list of receiver IDs when any new device is connected.
Poll to check the same and update topology as per hdcp 2.2 standard.
Change-Id: Icb92dc95a84b0c33e67e7ecd5381a3f966b0f557
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Add support for propagating content stream related information downstream.
Send/receive repeater authentication stream manage/ready messages as per
hdcp2.2 standard.
Change-Id: I8d37f9f6d4cb131b29128222bb43c9c290c78437
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Implement upstream topology information of connected repeater
devices to source device as per HDCP2.2 standard.
Change-Id: I375cc2624d5221972a6e4ece2f13dd05e83f7573
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Check for all possible DDC errors and clear the corresponding
acknowledge bit. Properly enable or disable the DDC interrupts
based on the requirements. Optimize DDC data structure by
removing unnecessary variables and keeping different DDC related
data under common structure. Move all DDC implementations to one
place.
Change-Id: If63479d5bc263db63e62d1846ab13a2659a83a68
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Do not lock in wakeup functions as it may block current thread.
Wakeup can trigger a callback looking to acquire same lock.
Also rename the wakeup command names to properly identify client
and lib commands.
Change-Id: I28411714d2d7f0104364726fc5ce0593e5ccff91
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Isolate the execution environments for HDMI HDCP2.2 driver and HDCP
library by creating separate threads and executing each work on
dedicated kworker. Do not call each other's functions directly.
Wakeup the other thread when needed and let the independent module
execute their corresponding work and acknowledge by waking up other
thread back.
Change-Id: I67bca61b92c831451ce3482a759a214b1e5d6578
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Check if the hdcp2p2 app is present every time the hdmi cable
is connected. If the app is not present, then we consider
hdcp-2.2 as not supported on the target. This scenario occurs
on devices that are not hdcp-2.2 provisioned, and with this
change hdmi core continues in non-encrypted mode.
Change-Id: I72ebcc1e6844f46dbbc974efb6ba926948e1bbde
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
Define APIs to start or stop authentication from client.
Handle internal states within HDCP library and do not
call HDCP library internal functions directly from client.
Remove unnecessary threads and locks and execute on same
thread as standard requires this to be processed sequentially.
Change-Id: I4cd924fb836e0e01ff1d6eba58d817fe0ca383e1
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
[cip@codeaurora.org: Snapshot hdcp.c/hdcp_qseecom.h,
add hdcp Kconfig/Makefile changes]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
Add snapshot for audio drivers for MSM targets. The code is
migrated from msm-3.18 kernel at the below commit/AU level -
AU_LINUX_ANDROID_LA.HB.1.3.1.06.00.00.187.056
(e70ad0cd5efdd9dc91a77dcdac31d6132e1315c1)
(Promotion of kernel.lnx.3.18-151201.)
Signed-off-by: Sudheer Papothi <spapothi@codeaurora.org>
Few Android drivers e.g. uid_cputime and PPPoLAC/oPNS,
keyreset/combo, cpufreq_interactive etc.. fail to build
as kernel modules. Instead of fixing the build lets
make these drivers non-modular (switch config to "bool"
from "tristate" in Kconfig) since Android doesn't
support building kernel modules anyway.
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
AOSP's cpufreq_stats patch to report power/current
per cpufreq is broken at the moment so skip power
reporting for now.
Change-Id: I07779511f51ff3a9303dc98a3b71ac0a5882a4e9
Signed-off-by: Amit Pundir <amit.pundir@linaro.org>
Checking if the uid_entry->uid matches the uid intended to be removed will
prevent deleting unwanted uid_entry.
Type cast the key for the hashtable to the same size, as when they were
inserted. This will make sure that we can find the uid_entry we want.
Bug: 25195548
Change-Id: I567942123cfb20e4b61ad624da19ec4cc84642c1
Signed-off: Ruchi kandoi <kandoiruchi@google.com>
Converting cputime_t to usec caused overflow when the value is greater
than 1 hour. Use msec and convert to unsigned long long to support bigger
range.
Bug: 22461683
Change-Id: I853fe3e8e7dbf0d3e2cc5c6f9688a5a6e1f1fb3e
Signed-off-by: Jin Qian <jinqian@google.com>
This avoids the race where a particular process is terminating and we
read the show_uid_stats. At this time since the task_struct still exists
and we will account for the terminating process as one of the active
task, where as the stats would have been added in the task exit
callback.
Bug: 22064385
Change-Id: Id2ae04b33fcd230eda9683a41b6019d4dd8f5d85
Signed-off-by: Jin Qian <jinqian@google.com>
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>
/proc/uid_cputime/show_uid_stats shows a third field power for each of
the uids. It represents the power in the units (uAusec)
Change-Id: I52fdc5e59647e9dc97561a26d56f462a2689ba9c
Signed-off-by: Ruchi Kandoi <kandoiruchi@google.com>