Change qseecom_qteec_invoke_modfd_cmd() to support content protection
zone (CPZ) for GP, where a client need to register secure shared memory
from a pre-allocated secure heap ION data fd.
Change-Id: Ic5cc911e2fa8d9993ab6c753120d2e31ee98277a
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Even when we send buffer address with more than 32-bit
to DSP, APR callback handle will return a token with only
32-bit. Hence use a 32-bit variable to store the buffer
address locally, so that comparison between these does
not fail.
Change-Id: I1ce574d57bb7ee2716d112711f6a160bdb6c3e22
Signed-off-by: Banajit Goswami <bgoswami@codeaurora.org>
Truncating the buffer address would cause unmap failure
and hence next session playback would fail eventually.
Do not truncate the buffer address which is needed for
the memory unmap.
CRs-Fixed: 814704, 814699
Change-Id: I3382062de6e515b66750c45a6daf78362cbd772f
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
-- load cmnlib or cmnlib64 based on app architecture;
-- kernel client need to identify app arch before loading app;
-- check if physical address used to send cmd for 32bit app is
under 4GB, as TZ doesn't support 32bit app access mem beyond 4Gb;
-- for 64bit TZ app, the scatter gather list buffer phy addr used
by qseecom_send_modfd_cmd is changed to 64bit; otherwise, it is
still 32bit.
Change-Id: I39fcc09d921fbfb342a67f6544d9599814b2a3ba
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Add a new driver and configure ASM to support end to end
playback of APE clips.
Change-Id: Ic5e937879579785dd1efa9ca8a14201b2b4b2e77
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
The file operations audio_alac_debug_fops are not defined if
CONFIG_DEBUG_FS is not defined which causes compilation errors.
Avoid them by stubbing out the calls properly.
Change-Id: Ide07afb6134548e2be36bc2f9029efa5d38702c2
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
Configure ASM by adding a new driver to support end to end
playback of ALAC clips.
CRs-Fixed: 808940
Change-Id: Icae98e8b8bd79048165493dc413f335c42420acd
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
Add interface to support configuring pbe effects
in DSP for offload playback.
PBE provides BassBoost support on small devices
like handset speaker.
Handset speakers are too small to produce proper
Bass, hence PBE is introduced, which adds effect
similar to BassBoost but suitable for small devices.
Change-Id: Ic66f3073cb259c8ef593a1ad6aa06d14efbfb058
Signed-off-by: wjiang <wjiang@codeaurora.org>
Signed-off-by: Dhananjay Kumar <dhakumar@codeaurora.org>
Sensor HAL takes long time to scan /dev/input to get information
from input subsystem. Change the sensors sysfs hierachy to avoid
the scanning to reduce sensor HAL initialization time.
Change-Id: I6c89067eb8c3dfe5d97be6162639f0974a8a943f
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
vdd power supply is being probed with out verifying the availability
of device node. Moving the code to ensure that device node is verified
before probing power supply.
Change-Id: I7ad578d457ab390e4ae4421fd5715a60f1160d5a
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
New ICE HW requires setting of regulator. Updating qseecom to
support new ICE HW.
Change-Id: I5e3e9533c7adcfbc146b0f31279e8bbf29cb8092
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
Make changes to support 64bit TZ, if TZ version is TZ.4.0 and up,
the physical address sent to TZ is changed to 64bit; otherwise,
it is still 32bit
Change-Id: I6bc0ecca6558459dd8bf9e4c622355a9da7fefa0
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Do not send app regin notification if qseecom in appsbl has
already done it.
Change-Id: I81ae9a991a5d8ec582d9320e18be1b6f8e8ee7fd
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Change memcpy to strlcpy to only copy the string for app_name.
Change-Id: I46cf34c2d2fdbf24e9e65008555f762761c81dd7
Signed-off-by: William Clark <wclark@codeaurora.org>
Add support for receiving IOCTL from userspace for DIP
ciphering, and calling SCM with this request.
Change-Id: I90427c48df8aa733a1b2a684520b01e85b94b6c0
Signed-off-by: Amit Blay <ablay@codeaurora.org>
Application name passed from the user space might be NULL or
corrupted, which if accessed later on might end up in NULL
pointer dereference.
Change-Id: Ib35e438bc4877f5bc0e8898a315a9e9bf36d649e
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
On the targets where both qseecom and crypto drivers are sharing the
same cE clocks, when qclk->clk_access_cnt was 1, qseecom suspend
callback would disable clock and remove the timer. But bw_inactive_req_ws
worker was still running and would disable it again. As crypto driver
is using the same CE clock, this will erroneously turn off CE clock and
cause external abort. Thus, make changes to cancel bw_inactive_req_ws
worker in qseecom suspend, also let the worker callback only disable clock
when the timer is running.
CRs-Fixed: 802234
Change-Id: I02ae833e07f8128317b5582eb9bafef6204a21ff
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Fix a logic error for apds9930 when proximity do
calibration.
Change-Id: I40a0336a5109ae5b5aa104d729867c3383ae8902
Signed-off-by: Daqing Chen <chendaqing@codeaurora.org>
Optimize apds9930 proximity calibration delay time and ensure
that sensor enabled and can not be reentranted when calibration.
CRs-Fixed: 791042
Change-Id: I4c083745180bdbe0e50fc9485d8aab1c3cb5c7bf
Signed-off-by: Daqing Chen <chendaqing@codeaurora.org>
Max delay is the delay between two sensor events
corresponding to the lowest frequency that this
sensor supports. When lower frequencies are requested
through batch()/setDelay() the events will be generated
at this frequency instead. It can be used by the
framework or applications to estimate when the batch
FIFO may be full.
Change-Id: Ic8b4bd78061801a48b2774c648758c87b2e20bfc
Signed-off-by: Daqing Chen <chendaqing@codeaurora.org>
Sensor reporting mode flags have to be set correctly in Android L
release. Correct ALPS sensors flags to adapt to new sensor HAL.
Change-Id: I99618794659cee69a88ef0344c7b9cbd74271c9b
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
While wiping the keys from multiple crypto, it is wiping keys from
same crypto due to wrong loop variable. Fixed the issue by using
correct variable.
Change-Id: I8e7f9d3a773ff1809fe9b71d8e7bee75e789deca
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
Reporting accurate timestamp provides better reference to
sensor application. As input system will ignore sensor event
if its value doesn't change, report accurate timestamp along
with sensor event to allow input system report each sensor
event.
CRs-fixed: 778265
Change-Id: I99aaf1f1a6c275d58c71974d1f75668b3b8c86d0
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Default system workqueue may be bounded on specific cpu, that cpu
will always be wakeup to handle the workqueue, this will consume
extra power in some case. This change fix issue by create dedicate
sensor workqueue which not bounded to any cpu.
Change-Id: I38f64def943625cc525b56e863a4ef5384bc10ac
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Maximum of aac min_bitrate should be 24000. Correct incorrect condition.
Change-Id: I20629885eb5600b385e7b34df4e62a0f562b9d82
Signed-off-by: Fred Oh <fred@codeaurora.org>
Set sensor flags as a wakeup sensor.
This information is used by the client to use apds9930 as a wakeup
source.
Change-Id: I02b78c3f33b67ee661d8c6e86835ef4fe8b366e6
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
We've made changes on app session managements to save app name in
qseecom when loading app by userspace client. This change is to save
app name when loading app by kernel client, then qseecom can compare
the app name correctly when sending commands to TZ.
CRs-Fixed: 748491
Change-Id: I341a1a89f0e8a45056be7a5ce0a6a540842bc5dd
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
When apds9930 light sensor in high light intense, the sensor
enter reduce status and sensor data is not stable in reduce
status. So delete the sensor reduce set to fix this issue.
Change-Id: Ief1677cf3e1065c61805020574bd98651ed4c53d
Signed-off-by: Daqing Chen <chendaqing@codeaurora.org>
Change sg_entry phys address to 32bit, so that QSEECom will send
32bit phy address to TZ as 8994 TZ APP will be remained as 32bit.
Change-Id: I9e486c7ee36869ab818389d4b656c86cc6aeb899
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Input_free_device() should only be used if input_register_device()
was not called yet or if it failed, some sensor drivers does not
use this correctly, this may cause null pointer exception when
unbinding driver or binding fails.
Change-Id: I04d455dd9cd59ab76be7d621815ad70668c0bac1
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Updated GP related code:
-Decouple GP related functionality from QSEE
-Add support for processing command in open session call
-Fix Invoke Command API to support contiguous memory only
-Add support for request cancellation command
Change-Id: I827e8fcdb09493266a21d3c4ae9456c2aa8457b3
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Storage hardware can have embedded inline crypto engine(ICE). Current
key management system supports key storage mechanism for GPCE. ICE HW
requires a little differnt key management. Modifying exisiting KMS to
support ICE HW.
Change-Id: Ibcdbbffad71927c91ceb5d24939e0a80630ce466
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
The kmemleak tool detects a false memory leak, beacuse a
memory allocation result is assigned to a non-aligned
pointer. When kmemleak scans the memory for references
to this allocated block, it does not find any.
The fix adds a kmemleak call to explicity ignore this
allocation.
Change-Id: I0ebba2ff0a37485d649b195672f39e3138c36ec2
Signed-off-by: Lior Barenboim <liorb@codeaurora.org>
Add a new stream format for ultrasound proximity, which matches
the stream format in the aDSP.
Change-Id: Idd488b90ee082fcc58ff9d1dddf5087cba9af034
Signed-off-by: Lior Barenboim <liorb@codeaurora.org>
Add support to enable DTS HPX and SA+ modules exclusively when
both the modules are part of a single ASM topology in NT mode.
Change-Id: I2a90e9e1cd6e2f4d915d0c55a5a67a7abc19f503
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
Audio post processing features such as HeadphoneX are supported
only in DSP. To apply post processing for the playback which is
not routed through DSP, effects are applied through hardware
accelerated mode where PCM samples are sent to DSP for effects
processing in write path and captured by userspace through read
path.
Change-Id: I50272b04586770136bc48ba231eef1eac81387c5
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
Signed-off-by: Alexy Joseph <alexyj@codeaurora.org>
Add checks for clock_no_support flag check before
initializing/enabling/disabling CLK_CE_DRV related clk.
Change-Id: I099cc4e3d4716b42a2a9fbaa12b44a9de6f45f63
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Minimum poll delay for apds9930 sensor should be more than the
recommended integration time of 27.3 ms, which corresponds to the
ATIME value of 0xf6. Updated minimum poll delay to 30ms.
Change-Id: I706a3a1e35da29d8bf5eeb1e42c68a06d69b0ed4
Signed-off-by: Prakash Gupta <guptap@codeaurora.org>
commit cfda2794b5afe7ce64ee9605c64bef0e56a48125 upstream.
function 'strncpy' will fill whole buffer 'id.name' of fixed size (32)
with string value and will not leave place for NULL-terminator.
Possible buffer boundaries violation in following string operations.
Replace strncpy with strlcpy.
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Improve user input validation across send cmd APIs. Add new
API __validate_send_cmd_inputs() to validate all user provided
inputs.
Change-Id: Ibbb0c0e7e5483f653bd59b927562b63c1e43c365
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Modify the apds9930 light sensor algorithms to make sure the
lux value output smoothly. So this fix is just to improve light
sensor's stability.
Change-Id: I0a7a821db68f57781fed64cf1e25b47efb35eba3
Signed-off-by: Daqing Chen <chendaqing@codeaurora.org>
Qseecom driver does not have boundary checks for offset within the
message. So this patch add checks to validate the offsets sent by
client to modify data within the command request message and it
should not exceed the memory allocated for that message.
Change-Id: I29bfbdc154eebb4f3f4bfbb31789562e37fa5886
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Signed-off-by: Mallikarjuna Reddy Amireddy <mamire@codeaurora.org>
In current qseecom_suspend function, qseecom will scale down bus
bandwidth if both of accumultive mode and current mode are not
INACTIVE. But if device goes into suspend before bus scaling timeout
happens, the accumulative mode may be zero but current mode is
still not INACTIVE. This may prevent the device going to suspend,
thus, make a change to just check current bus scaling mode in
qseecom_suspend.
CRs-Fixed: 740287
Change-Id: I60e90000aa9efe428b144fb766e19e81312af66f
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Although this is not an error case but it often drag
unnecessary attentions.
Change-Id: I99d0b5baa32e8b612e1b77f02ca645921c829176
Signed-off-by: Vidyakumar Athota <vathota@codeaurora.org>
To avoid the service failure on a target where bus scaling flag is not
enabled in target device tree file by mistake, make a change to enable/
disable crypto clocks when the client calls to scale up bus bandwidth
and send command even if bus scaling feature is not enabled.
CRs-Fixed: 726840
Change-Id: Ib33a535051b68561bde5ab6a23ad0f02dc27ab13
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Crypto operating frequency varies from target to target. So platform
specific data needs to provide the value.
Change-Id: Iccb1f627d45bfd5a2d2996b34a38eda389252aeb
Signed-off-by: Mallikarjuna Reddy Amireddy <mamire@codeaurora.org>
Make a change to free the ion memory allocated for keymaster client
even if keymaster app doesn't need to be unloaded from TZ, so as to
avoid memory leak.
CRs-Fixed: 724638
Change-Id: I3ddb68c8a3f96b0a44afc3efc63e93f0a8be51bb
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
In the Liquid8994 we don't need the USB HUB reset and Ethernet reset
from software.
Change-Id: I577ef9d2772b46e125c6d9059834b3b2af493429
Signed-off-by: Tanya Finkel <tfinkel@codeaurora.org>
Make change to check if ce clock is enabled before sending command
to TZ, then to prevent data aborting if clock is not enabled for
TZ crypto operation.
CRs-Fixed: 726840
Change-Id: I55b5b10ad80e741c39f8cf411f67e6b83887f3bb
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
On the target supporting ARMv8 smc interface, the scm call will return
failure if scm parsing failed or the syscall response result is negative.
Then when qseecom calls __qseecom_generate_and_save_key on a device that
the key is already created, scm call will return failure directly as the
syscall response result value in this case is negative. Thus, generate key
failed and set key will not be called. So, we make changes to check syscall
response results for key management APIs even when scm call return failure.
CRs-Fixed: 723967
Change-Id: Ibade34dfc8ad90b25f2712ed0cc3faae91daab51
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Implementing the ARMv8 version of qseecom_save_partition_hash
by calling scm_call2 with the proper paramaters
Until this change, only the ARMv7 version was implemented
(by calling scm_call) and ARMv8 version was missing
Without this change, ioctl QSEECOM_IOCTL_SAVE_PARTITION_HASH_REQ
fails on ARMv8 platforms and only works on ARMv7
CRs-Fixed: 714330
Change-Id: I855ca847d62a0ffd8dc59207b7ea3a0ac6f79d99
Signed-off-by: Jon Ronen-Drori <jonr@codeaurora.org>
Add apds9930 calibrate feature to calibrate sensor raw data.
In oder to compensate the cross_talk for the sensor.
Change-Id: I2c1d2d236b7148a13c6e777594ce50dae515c9bd
Signed-off-by: Daqing Chen <chendaqing@codeaurora.org>
Many defaults print-out ocurrs due to misplacing case and missing break.
With this fix unknown errors are suppressed in case of OMX Non-tunnel mode
playback and recording.
Change-Id: I8c61b3004db934cbe32f6f14716134989c83d4f8
Signed-off-by: Fred Oh <fred@codeaurora.org>
data pointer validation is done after dereferencing it which might
throw an exception. This patch moves the data pointer validation
checks to starting of the function.
Change-Id: I12d201e53ad1d3098bf45c427553b048ca4d8ac0
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
A kmalloced object in the file opening path is not kfreed in the
closing path.
In the struct file_operations, the open operation is assigned to
single_open while release is assigned to seq_release. single_open
internally allocates memory dynamically for an object of type
seq_operations which is subsequently not freed in the release call
to seq_release.
Fix this by calling single_release which correctly frees this
memory allocated in the open call.
CRs-Fixed: 719283
Change-Id: I3ea677be301244638e3843834c46988ad999ed88
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
commit 8e8248b1369c97c7bb6f8bcaee1f05deeabab8ef upstream.
NFC will leak buffer if send failed.
Use single exit point that does the freeing
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 73ab4232388b7a08f17c8d08141ff2099fa0b161 upstream.
If connect request is queued (e.g. device in pg) set client state
to initializing, thus avoid preliminary exit in wait if current
state is disconnected.
This is regression from:
commit e4d8270e604c3202131bac607969605ac397b893
Author: Alexander Usyskin <alexander.usyskin@intel.com>
mei: set connecting state just upon connection request is sent to the fw
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit 22b987a325701223f9a37db700c6eb20b9924c6f upstream.
Link must be reset in case the fw doesn't
respond to client disconnect request.
We did charge the timer only in irq path
from mei_cl_irq_close and not in mei_cl_disconnect
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The blow timer register will be set by the sbl or tz.
Change-Id: I6eac4854cf4dbd861b01b3da6f6c5f5dc7660fa4
Acked-by: Kaushik Sikdar <ksikdar@qti.qualcomm.com>
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Add new command to support QFPROM writes. This operation
can no longer be performed from the Linux kernel.
Change-Id: Ifeb599b7019f8568ebbcfd7222f5c5ce11e9143b
Acked-by: Kaushik Sikdar <ksikdar@qti.qualcomm.com>
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
The ioctl to write to fuse is no longer supported in the driver.
Change-Id: I1ed841de13f9ab45383e0d0914dbb39c67df8006
Acked-by: Jie Luo <jluo@qti.qualcomm.com>
Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
Make several changes to improve secure app session management.
First, app tied to the handle being closed (when qseecom_release
is invoked), is unloaded.
Second, we add support to handle multiple app load & unload. Media
server is associated with multiple apps on TZ-side. Unloading a single
app for clean up is not enough. QSEECOM needs to handle the app load
& unload of multiple apps associated with the client. During app_load
& app_unload along with app_id, app_name should also be checked.
Besides, keymaster will not be unloaded and app search execution during
app unloading is optimized.
Third, keymaster app has two names with different length: "keymaster" and
"keymaste". To compare the app names correctly, the shorter name length
is choosen for memcmp in __qseecom_send_cmd.
Change-Id: Ifd8f4508cd930630e8730f6699d66bf8668bbef6
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
The scm library has added support for a new secure world
interface that is more aligned to the ARMv8 SMC calling
convention. Make changes to support new ARMv8 SMC interface
while maintaining backward compatibility.
Change-Id: I41d03cf0e6ef3ce183ad6bdf22b7881b4dc583ee
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Add support for multiple crypto instances, the key will be set/wiped
on all supported hlos crypto engines on the appropriate pipes.
Change-Id: I8787f126c10cf5067a7577dc47e9281209c7a55f
Signed-off-by: William Clark <wclark@codeaurora.org>
* commit 'v3.10.49': (529 commits)
Linux 3.10.49
ACPI / battery: Retry to get battery information if failed during probing
x86, ioremap: Speed up check for RAM pages
Score: Modify the Makefile of Score, remove -mlong-calls for compiling
Score: The commit is for compiling successfully.
Score: Implement the function csum_ipv6_magic
score: normalize global variables exported by vmlinux.lds
rtmutex: Plug slow unlock race
rtmutex: Handle deadlock detection smarter
rtmutex: Detect changes in the pi lock chain
rtmutex: Fix deadlock detector for real
ring-buffer: Check if buffer exists before polling
drm/radeon: stop poisoning the GART TLB
drm/radeon: fix typo in golden register setup on evergreen
ext4: disable synchronous transaction batching if max_batch_time==0
ext4: clarify error count warning messages
ext4: fix unjournalled bg descriptor while initializing inode bitmap
dm io: fix a race condition in the wake up code for sync_io
Drivers: hv: vmbus: Fix a bug in the channel callback dispatch code
clk: spear3xx: Use proper control register offset
...
In addition to bringing in upstream commits, this merge also makes minor
changes to mainitain compatibility with upstream:
The definition of list_next_entry in qcrypto.c and ipa_dp.c has been
removed, as upstream has moved the definition to list.h. The implementation
of list_next_entry was identical between the two.
irq.c, for both arm and arm64 architecture, has had its calls to
__irq_set_affinity_locked updated to reflect changes to the API upstream.
Finally, as we have removed the sleep_length member variable of the
tick_sched struct, all changes made by upstream commit ec804bd do not
apply to our tree and have been removed from this merge. Only
kernel/time/tick-sched.c is impacted.
Change-Id: I63b7e0c1354812921c94804e1f3b33d1ad6ee3f1
Signed-off-by: Ian Maund <imaund@codeaurora.org>
Add ultrasound compilation flag and small fix to
struct used in compat mode
Change-Id: I0f0f4f841f034159d81e7498db22fff76f975d49
Acked-by: Hadar Sivan <hsivan@qti.qualcomm.com>
Signed-off-by: Lior Barenboim <liorb@codeaurora.org>
wipe_key_flag was missing in the definition of compat_qseecom_wipe_key_req,
then wipe key operation failed due to compat ioctl operation mismatch on
32bit userspace and 64 bit kernel system. We then make a change to add the
field of wipe_key_flag for compat_qseecom operation.
Change-Id: I9c49f046355dc548a327e6b3e61ee2d42674c700
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Whenever an async read command is issued to dsp when
the driver is not enabled, there is a crash in userspace.
The read command is disallowed in the driver and an error
is propagated to userspace which results in the crash.
The driver is re-enabled in a subsequent asynchronous write
command anyway, so the async read command can be allowed.
Ensure that read is allowed by removing a superfluous check.
CRs-Fixed: 675131
Signed-off-by: Satya Krishna Pindiproli <satyak@codeaurora.org>
Change-Id: I5d0598e37d08ac1090f98c24be49fd99c132e22f
Pointers should be checked for sanity before accessing them.
Change ensures that the sanity of the pointer is checked before
accessing it.
CRs-fixed: 682512
Change-Id: I6b7e97ecfa8cc960db1bdf1c557b3b76dca8a658
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
The proximity data needs to be calibrated according to the raw data.
Fix the proximity raw data not correct issue for better debugging.
Change-Id: Ieae0b547d6d086774ec35604350c53716199f792
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
The apds993x driver handle the power status change while system
suspend/resume happens and device status changes. There's a scenario
that the device is already power off and the driver still request
to transfer data through i2c bus. This may cause some i2c errors
and revoke i2c issues. Change the logic to avoid such scenario to
avoid this issue.
Change-Id: I421a64b705adc867a248bce1506ade923b03358e
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
The LiQUID dock driver might probe and attempt to add/remove
the USB host controller device before it has even probed.
Though not fatal, this could lead to the hub ports not being
functional when booting up initially docked. Instead, make
sure USB host controller is ready first by deferring probe
until its driver is present.
Change-Id: Icc51a9459be6f3202dcf90df632465f7d7a61914
Signed-off-by: Jack Pham <jackp@codeaurora.org>
The MSM8994 LiQUID docking station does not have a
pin for a dock_enable GPIO, as the USB and Ethernet
ports are always powered via the DC source. Make
this GPIO optional.
As the power to the hub and Ethernet ports may now
be always-on, also make sure to assert the reset lines
prior to adding the USB host controller. This way the
deassertion of the resets will happen after the USB
stack is fully initialized to kick off enumeration.
Change-Id: I864ebcfa94d58e741e7378db0c24fdc6220dc18f
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Check nb parameter of register_liquid_dock_notify() in
order to avoid a potential NULL pointer reference if passed
to blocking_notifier_chain_register().
Change-Id: I8d2971d32a1562559e7b27b021efd688beec5494
Signed-off-by: Jack Pham <jackp@codeaurora.org>
commit b04ada92ffaabb868497a1fce8e4f6bf74e5488f upstream.
We cleared H_RST for H_CSR on spurious interrupt generated when ME_RDY
while cleared and not while ME_RDY is set. The spurious interrupt
is not delivered on all platforms in this case the
driver may fail to initialize.
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
commit c40765d919d25d2d44d99c4ce39e48808f137e1e upstream.
According the spec the host should read H_CSR again
after asserting reset H_RST to ensure that reset was
read by the firmware
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The LiQUID dock support driver is not specific to the
APQ8084 SoC. Rename it to reflect its generality since
it can be used for other MSM/APQ LiQUID platforms.
Change-Id: I4a969077c543cd84e98dd198d3d7670b6071605a
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Make a change to sanitize userspace input data in compat_qseecom.c
and make sure it doesn't point to an arbitrary address.
Change-Id: I4cc32d9f0aa0d4807aa3546ff9ffd3ccc6dee2c9
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
* commit 'v3.10.40': (203 commits)
Linux 3.10.40
ARC: !PREEMPT: Ensure Return to kernel mode is IRQ safe
drm: cirrus: add power management support
Input: synaptics - add min/max quirk for ThinkPad Edge E431
Input: synaptics - add min/max quirk for ThinkPad T431s, L440, L540, S1 Yoga and X1
lockd: ensure we tear down any live sockets when socket creation fails during lockd_up
dm thin: fix dangling bio in process_deferred_bios error path
dm transaction manager: fix corruption due to non-atomic transaction commit
Skip intel_crt_init for Dell XPS 8700
mtd: sm_ftl: heap corruption in sm_create_sysfs_attributes()
mtd: nuc900_nand: NULL dereference in nuc900_nand_enable()
mtd: atmel_nand: Disable subpage NAND write when using Atmel PMECC
tgafb: fix data copying
gpio: mxs: Allow for recursive enable_irq_wake() call
rtlwifi: rtl8188ee: initialize packet_beacon
rtlwifi: rtl8192se: Fix regression due to commit 1bf4bbb
rtlwifi: rtl8192se: Fix too long disable of IRQs
rtlwifi: rtl8192cu: Fix too long disable of IRQs
rtlwifi: rtl8188ee: Fix too long disable of IRQs
rtlwifi: rtl8723ae: Fix too long disable of IRQs
...
Change-Id: If5388cf980cb123e35e1b29275ba288c89c5aa18
Signed-off-by: Ian Maund <imaund@codeaurora.org>
commit 07cd7be3d92eeeae1f92a017f2cfe4fdd9256526 upstream.
It my take time till ME_RDY will be cleared after the reset,
so we cannot check the bit before we got the interrupt
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Currently qseecom will return the app_id (>0) instead of 0 if the
app id already exists when loading app. Then the userspace client
will release qseecom handle if an non-zero return value is obtained.
Make a change to let qseecom return 0 when app id exist so as to
avoid the incorrect qseecom release.
Change-Id: I03b0b0ae95b2e043fda972aa3b613e7df585154a
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
A previous change removed the null termimator on apds993X_match_table.
This may cause a potential crash. Add it back to fix the issue.
CRs-fixed: 678338
Change-Id: If091b89f2031fc4a35f954639ad799103026abd9
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Apds993x driver drive both ambient light sensor and proximity
sensor, ambient light sensor should vote its regulators off when
processor enter suspend state, but proximity sensor is a wakeup
sensor it should stays on as long as it been enabled.
CRs-fixed: 670708
Change-Id: Ic00d17fc2b73b110851c3e894b5680ab46689369
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Spinlock crash issue is fixed with this patch. This patch
is to initialize the locks before it is used.
Change-Id: Ib8200b5f2d89bd3e06db4a47e3682fe290fa6b3c
Signed-off-by: Anish Kumar <kanish@codeaurora.org>
A new command is needed to support enc / dec in IKE
Change-Id: I55aa5f7ae8d92393dc5090a351b95d2c48bd7a79
Acked-by: Nikita Agarwal <nikita@qti.qualcomm.com>
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
msm_ion_client_create doesn't actually do anything with its heap_mask
parameter. Remove it. Also remove the extra argument from an audio
function that wraps msm_ion_client_create.
The following semantic patch was used to generate this patch:
@@
expression E1, E2;
@@
msm_ion_client_create(
- E1,
E2)
@@
expression E1, E2;
@@
msm_audio_ion_client_create(
- E1,
E2)
Change-Id: I403a125a1715b29a3db1f27c993abe0bc6d3fb11
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
RPM handles the crypto clocks, going forward this could
be handled by some other sub-systems as well, so change the name to
be generic. Also, update the same param in the documentation file.
Change-Id: I62f6bdecc2d6f5987aedacce6eaa66e741c6d855
Signed-off-by: Hariprasad Dhalinarasimha <hnamgund@codeaurora.org>
Add sensor lux calibration to make sure that it can go to the max
lux value 60000, so the display can adjust color precisely.
CRs-Fixed: 656598
Change-Id: If2270f9d1f23c00f28a6c7519f8a193d9475105c
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Add checks in qseecom driver to validate the ION handle before
passing to ION driver.
Change-Id: I5e242d621f423e65b73f614df5ba94cfe8253369
Signed-off-by: AnilKumar Chimata <anilc@codeaurora.org>
APDS993x sensor driver enable its regulators twice and does not
vote them off correctly.
CRs-fixed: 664168
Change-Id: I5061c4d7d8ca57e4b27f1f6eb7f8becbd7648bfb
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Add an API to allow for interested clients to register
a notifier_block that gets called back when the tablet
is inserted and removed from the dock.
Change-Id: I30ccb78c10fda9db03b86c6882553063aedd68d4
Signed-off-by: Jack Pham <jackp@codeaurora.org>
As sensor will power down during suspend, those GPIOs used by
sensors also need pull down to minimize leakage.
CRs-fixed: 655099
Change-Id: If9463e0cc89675204b9b4bee5eca2dd5a44515a5
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Property names should not include underscores, correct this for
APDS993x sensor driver.
CRs-fixed: 631108
Change-Id: I8f927ab7c32be027df72523f890ec87d19f98fdd
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
commit 5e6533a6f52f1a8283b2f818f5828be99a417dd6 upstream.
NM and SPS FW types that may run on ME device on server platforms
do not have valid MEI/HECI interface and driver should not
be bound to it as this might lead to system hung.
In practice not all BIOSes effectively hide such devices from the
OS and in some cases it is not possible.
We determine FW type by examining Host FW status registers in order to
unbind the driver.
In this patch we are adding check for ME on Cougar Point, Lynx Point
Devices
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Tested-by: Nikola Ciprich <nikola.ciprich@linuxbox.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Sensor of apds9930 work with sensor class, so add sensor class poll_delay
interface.
CRs-Fixed: 652033
Change-Id: I15746c4f4b1206032995001256a860a2530e03a7
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Change warning message about qseecom_release to debug message to
reduce the excessive logging.
Change-Id: I9688808fc292088f0cc6ae950994f61d7922e8c8
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Add ADPS9900/ADPS9901 device ID to sensor ADPS993x light and
proximity sensor driver, this allow existing sensor driver to
support these two model.
CRs-fixed: 631108
Change-Id: I469133a201c2c6cbead782ebd7d8c7e58ba323af
Signed-off-by: Bingzhe Cai <bingzhec@codeaurora.org>
Add new IOCTLs to get and set ultrasound stream parameters in DSP
using shared memory.
Change-Id: I627e9e40e29c6233dab4295e2c355a718e30bd01
Acked-by: Hadar Sivan <hsivan@qti.qualcomm.com>
Signed-off-by: Lior Barenboim <liorb@codeaurora.org>
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>
Modify the proximity sensor distance far value from 5 to 1,
as the value is calculated at HAL.
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Change-Id: I96e95222634a4016bd1cc506bf7a3f3ab718e6ac
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>
There's an observed issue that the proximity value is near after
enable proximity sensor. Thus modify the logic to reflect the
actual distance.
CRs-fixed: 649445
Change-Id: I0747fa70b36ccedce0fd5748b3b0825e52f5e039
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Add support for compat ioctls in audio native drivers.
Change-Id: I1e84777ee8775b91f2daddc99da327bb3b08cb15
Signed-off-by: Aravind Kumar <akumark@codeaurora.org>
There's an observed issue that accessing i2c bus can cause kernel
crash when the sensor is powered off. Thus add some logic to avoid
accessing i2c bus before power off the sensor.
Change-Id: I604574ac3f4a9560daaec1b88ef7198d58b6f3db
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Incorrect parameter is overwritten when reading information
related to what pipe is used for PFE feature.
Change-Id: I6747fa0b8b99d937475d3d12e2f9ed9a723f91bb
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
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>
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>
Add handling of RESET_EVENTS message from APR, which indicates
aDSP sub-system restart has begun.
Add a new internal state, USF_ADSP_RESTART_STATE, for this
scenario.
Change-Id: Ic1a78f28e63ca1f8b985373cf2bd7a089ae63978
Signed-off-by: Lior Barenboim <liorb@codeaurora.org>
The irq is not freed when the apds9930 sensor chip is not successfully
probed. The freed memory access in the interrupt handler cause a
crash. Thus fix this issue by calling free_irq when probe fails.
Change-Id: Ia584199d35ec09c04fb5632183443ecf1c747f74
Signed-off-by: Oliver Wang <mengmeng@codeaurora.org>
Move header file from architecture folder to include/soc/qcom folder.
Change-Id: Idbf727b9ff5a0e48577c355558787db1ba07c297
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
The following commits have been reverted from this merge, as they are
known to introduce new bugs and are currently incompatible with our
audio implementation. Investigation of these commits is ongoing, and
they are expected to be brought in at a later time:
86e6de7 ALSA: compress: fix drain calls blocking other compress functions (v6)
16442d4 ALSA: compress: fix drain calls blocking other compress functions
This merge commit also includes a change in block, necessary for
compilation. Upstream has modified elevator_init_fn to prevent race
conditions, requring updates to row_init_queue and test_init_queue.
* commit 'v3.10.28': (1964 commits)
Linux 3.10.28
ARM: 7938/1: OMAP4/highbank: Flush L2 cache before disabling
drm/i915: Don't grab crtc mutexes in intel_modeset_gem_init()
serial: amba-pl011: use port lock to guard control register access
mm: Make {,set}page_address() static inline if WANT_PAGE_VIRTUAL
md/raid5: Fix possible confusion when multiple write errors occur.
md/raid10: fix two bugs in handling of known-bad-blocks.
md/raid10: fix bug when raid10 recovery fails to recover a block.
md: fix problem when adding device to read-only array with bitmap.
drm/i915: fix DDI PLLs HW state readout code
nilfs2: fix segctor bug that causes file system corruption
thp: fix copy_page_rep GPF by testing is_huge_zero_pmd once only
ftrace/x86: Load ftrace_ops in parameter not the variable holding it
SELinux: Fix possible NULL pointer dereference in selinux_inode_permission()
writeback: Fix data corruption on NFS
hwmon: (coretemp) Fix truncated name of alarm attributes
vfs: In d_path don't call d_dname on a mount point
staging: comedi: adl_pci9111: fix incorrect irq passed to request_irq()
staging: comedi: addi_apci_1032: fix subdevice type/flags bug
mm/memory-failure.c: recheck PageHuge() after hugetlb page migrate successfully
GFS2: Increase i_writecount during gfs2_setattr_chown
perf/x86/amd/ibs: Fix waking up from S3 for AMD family 10h
perf scripting perl: Fix build error on Fedora 12
ARM: 7815/1: kexec: offline non panic CPUs on Kdump panic
Linux 3.10.27
sched: Guarantee new group-entities always have weight
sched: Fix hrtimer_cancel()/rq->lock deadlock
sched: Fix cfs_bandwidth misuse of hrtimer_expires_remaining
sched: Fix race on toggling cfs_bandwidth_used
x86, fpu, amd: Clear exceptions in AMD FXSAVE workaround
netfilter: nf_nat: fix access to uninitialized buffer in IRC NAT helper
SCSI: sd: Reduce buffer size for vpd request
intel_pstate: Add X86_FEATURE_APERFMPERF to cpu match parameters.
mac80211: move "bufferable MMPDU" check to fix AP mode scan
ACPI / Battery: Add a _BIX quirk for NEC LZ750/LS
ACPI / TPM: fix memory leak when walking ACPI namespace
mfd: rtsx_pcr: Disable interrupts before cancelling delayed works
clk: exynos5250: fix sysmmu_mfc{l,r} gate clocks
clk: samsung: exynos5250: Add CLK_IGNORE_UNUSED flag for the sysreg clock
clk: samsung: exynos4: Correct SRC_MFC register
clk: clk-divider: fix divisor > 255 bug
ahci: add PCI ID for Marvell 88SE9170 SATA controller
parisc: Ensure full cache coherency for kmap/kunmap
drm/nouveau/bios: make jump conditional
ARM: shmobile: mackerel: Fix coherent DMA mask
ARM: shmobile: armadillo: Fix coherent DMA mask
ARM: shmobile: kzm9g: Fix coherent DMA mask
ARM: dts: exynos5250: Fix MDMA0 clock number
ARM: fix "bad mode in ... handler" message for undefined instructions
ARM: fix footbridge clockevent device
net: Loosen constraints for recalculating checksum in skb_segment()
bridge: use spin_lock_bh() in br_multicast_set_hash_max
netpoll: Fix missing TXQ unlock and and OOPS.
net: llc: fix use after free in llc_ui_recvmsg
virtio-net: fix refill races during restore
virtio_net: don't leak memory or block when too many frags
virtio-net: make all RX paths handle errors consistently
virtio_net: fix error handling for mergeable buffers
vlan: Fix header ops passthru when doing TX VLAN offload.
net: rose: restore old recvmsg behavior
rds: prevent dereference of a NULL device
ipv6: always set the new created dst's from in ip6_rt_copy
net: fec: fix potential use after free
hamradio/yam: fix info leak in ioctl
drivers/net/hamradio: Integer overflow in hdlcdrv_ioctl()
net: inet_diag: zero out uninitialized idiag_{src,dst} fields
ip_gre: fix msg_name parsing for recvfrom/recvmsg
net: unix: allow bind to fail on mutex lock
ipv6: fix illegal mac_header comparison on 32bit
netvsc: don't flush peers notifying work during setting mtu
tg3: Initialize REG_BASE_ADDR at PCI config offset 120 to 0
net: unix: allow set_peek_off to fail
net: drop_monitor: fix the value of maxattr
ipv6: don't count addrconf generated routes against gc limit
packet: fix send path when running with proto == 0
virtio: delete napi structures from netdev before releasing memory
macvtap: signal truncated packets
tun: update file current position
macvtap: update file current position
macvtap: Do not double-count received packets
rds: prevent BUG_ON triggered on congestion update to loopback
net: do not pretend FRAGLIST support
IPv6: Fixed support for blackhole and prohibit routes
HID: Revert "Revert "HID: Fix logitech-dj: missing Unifying device issue""
gpio-rcar: R-Car GPIO IRQ share interrupt
clocksource: em_sti: Set cpu_possible_mask to fix SMP broadcast
irqchip: renesas-irqc: Fix irqc_probe error handling
Linux 3.10.26
sh: add EXPORT_SYMBOL(min_low_pfn) and EXPORT_SYMBOL(max_low_pfn) to sh_ksyms_32.c
ext4: fix bigalloc regression
arm64: Use Normal NonCacheable memory for writecombine
arm64: Do not flush the D-cache for anonymous pages
arm64: Avoid cache flushing in flush_dcache_page()
ARM: KVM: arch_timers: zero CNTVOFF upon return to host
ARM: hyp: initialize CNTVOFF to zero
clocksource: arch_timer: use virtual counters
arm64: Remove unused cpu_name ascii in arch/arm64/mm/proc.S
arm64: dts: Reserve the memory used for secondary CPU release address
arm64: check for number of arguments in syscall_get/set_arguments()
arm64: fix possible invalid FPSIMD initialization state
...
Change-Id: Ia0e5d71b536ab49ec3a1179d59238c05bdd03106
Signed-off-by: Ian Maund <imaund@codeaurora.org>
Add checks for PFE/FDE feature before executing anything
related to the features.
Change-Id: I575d4d4eea29fd9ae59e47805793f2416a97f5b9
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
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>
Make a KMS change to support just clear pipe key without deleting it
from ssd storage. Key id definition for FDE and PDE are also updated.
Change-Id: I7c4804902a7a734087374c81ff0fd95655d84429
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
ioremap and readl/writel deal with void __iomem pointers, not
uint32_t.
Change-Id: I7fc5a071f9d9022e8d56c2bcf7cda3fc50b999e6
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Add key management support for crypto HW used for
PFE (per file encryption) feature.
Change-Id: Ic0664973d9a4099f76d7b3040f0f81df8465cf71
Signed-off-by: Mona Hossain <mhossain@codeaurora.org>
Moves bus scaling code to architecture independant directory
for platform drivers.
Change-Id: Ie0d5b104882d1534fae262af85e99cc09a56ab04
Signed-off-by: Dan Sneddon <dsneddon@codeaurora.org>