The cluster id flag is passed in from the userspace through ioctl
interface. Ensure correctness of cluster id to avoid out of bounds array
accesses.
CRS-fixed: 977508
Change-Id: I778b962d347b90488b983a15087b13e90ad06688
Signed-off-by: Mahesh Sivasubramanian <msivasub@codeaurora.org>
Use proper size for dma memory free call API while saving lmh sensors
list in lmh hardware driver otherwise it leads to memory leak or
unexpected crash if scm_call error path is executed.
CRs-Fixed: 982320
Change-Id: I31ac79585c8899b44ece745676d9af79fe8bca78
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Current wakelock ref_count is shared with all
the clients. There is a possibility that each
client could increase wakelock ref_count by
accident. Change the wakelock ref_count to bitmap
so each client can only update its own bit once.
Change-Id: I87f47cf54dc34a76dc2c4a537108f9be7b6bdba8
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
This patch checks for Null Pointer dereference before destroying the
diag mempools.
CRs-Fixed: 980428
Change-Id: I0e8fc8aa82ad26263bd9d47cbdd22de212efe489
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
Check the power supply variable if it is NULL or not, in flash led
driver while enabling the flash led.
This change is added to avoid crash in flash led driver.
CRs-Fixed: 944997
Change-Id: Ide1a9151d2a7c9a6686268a53ec9e38a4b087808
Signed-off-by: Shantanu Jain <shjain@codeaurora.org>
Interchange decoder max load frequency with encoder max load
frequency on msm8956/76 to have max frequency at the beginning
of the clock frequency table to select max venus clock rate
when session load is beyond the max load value.
Change-Id: I6c0cc941b49b5b3b364ff2255b0ddeac96501911
Signed-off-by: Maheshwar Ajja <majja@codeaurora.org>
Userspace supplies the actual number of used VFEs in session to ISPIF.
Validate the userspace input value and if found to be invalid, return
error.
CRs-Fixed: 898074
Change-Id: I3288ddb6404e817a705a92281b4c54666f372c56
Signed-off-by: Venu Yeshala <vyeshala@codeaurora.org>
For the targets not using boost and boost pin is kept
floating there will be high change that VDD_A53 will be
grounded and MSM will not be responsive
After discussing with PMIC systems team SBL team came up
with the work around to configure the boost register to some
pre defined values so that the issue is not reproduced.
As part of the codec init sequence the codec driver will
reset the analog part of the codec and as part of this sequence
the cofiguration done by the SBL will be defaulted.
This change will restore the 0x1C6 register if it has been configured
by SBL
Change-Id: I1a58b665b01e70bbb21b06665a8fb422d77a5ee7
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
The current ordering of statements in the rdev_deinit_debugfs()
function causes freed memory to be dereferenced. This occurs
because the regulator_put(rdev->debug_consumer) call results in
debugfs_remove_recursive() being called on
rdev->debug_consumer->debugfs after it was previously removed
by the debugfs_remove_recursive() call to the parent dentry
rdev->debugfs.
Correct this by setting rdev->debug_consumer->debugfs to NULL
after calling debugfs_remove_recursive() for the parent directory
rdev->debugfs. This ensures that the regulator_put() call does
not try to remove the already removed subdirectory and also that
the debugfs callbacks which make use of rdev->debug_consumer are
removed before rdev->debug_consumer is freed in the regulator_put()
call.
Change-Id: Icb7da7949e401f64cf9e71c732cb40e43ddbdc01
Signed-off-by: David Collins <collinsd@codeaurora.org>
Ensure that regulator_put() is called on the core debugfs
consumer pointer for a given regulator when the debugfs interface
is no longer needed. This includes inside of the
regulator_unregister() function as well as in the error return
path of rdev_init_debugfs().
Change-Id: I10563ae1716f31bdc5840d22633fdbfe278330f1
Signed-off-by: David Collins <collinsd@codeaurora.org>
IPC Router binds any port as a control port and moves it from the client
port list to control port list. Misbehaving clients can exploit this
incorrect behavior.
IPC Router to check if the port is a client port before binding it as a
control port.
CRs-Fixed: 974577
Change-Id: I9f189b76967d5f85750218a7cb6537d187a69663
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
Check if a ZLT descriptor is the last pending descriptor in
the desc FIFO when determine if the desc FIFO of that pipe is
empty.
Change-Id: Ib8174953d6ad7d886f47f21e243e985b79ef41fb
Signed-off-by: Yan He <yanhe@codeaurora.org>
QSEE OS level scm_call operations will fail if there is any blocked
TZ app due to waiting on a listener. Driver needs to first check if
no app is blocked before sending QSEE OS level scm call, if there
are any then wait until all apps are unblocked.
Change-Id: Ie7fb4a9fb78adedcb223308cd11335bf6a48296e
Signed-off-by: Zhen Kong <zkong@codeaurora.org>
Gain for TX decimator block needs to be set after the
corresponding decimator is enabled. Otherwise, gain will
not take affect. Apply the gain by reading from regmap cache
to the codec decimator hardware after decimator is enabled.
CRs-fixed: 982473
Change-Id: Ib2d189b56e58b038a343fc974e6e3b8ef29f982d
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
While the feature TTWU_QUEUE has the advantage of reducing cache
bouncing of runqueue locks, it has the side effect that runqueue
statistics are not updated until the remote CPU has a chance to
enqueue the task. Since there is no upper bound on the amount of
time it can take the remote CPU to enqueue the task, several
sequential wakeups can result in suboptimal task placement based
on the stale statistics. Turn off the feature as the cost of
sub-optimal placement is much higher than the cost of cache bouncing
spinlocks for msm based systems.
Change-Id: I0b85c0225237b2bc44f54934769f5e3750c0f3d6
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
Signed-off-by: Pavankumar Kondeti <pkondeti@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>
The service info structure is allocated with uninitialized memory for the
max number of services and returns the complete structure to the usersapce
resulting in the information leak if lookup operation finds less number of
services than the requested number.
Check the minimum of requested and available services and copy the minimum
information to the user-space.
CRs-Fixed: 965934
Change-Id: Ic97f875855fdc6440c1db1d8d0338ee8b03a9d0a
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
In case of any codec access failure, return -EPROBE_DEFER
so that slimbus driver can probe the codec again
to toggle codec reset and retry codec access.
CRs-fixed: 969497
Change-Id: I570e7357a6d7810c495f56bbb626b8e823892837
Signed-off-by: Phani Kumar Uppalapati <phaniu@codeaurora.org>
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Add codec reset gpio device tree node for msm8956/msm8976/msm8952
target specifying active and sleep pinctrl states.
CRs-Fixed: 968161
Change-Id: I040e8f54c6c86ab66d7fc824d5aab006f8d5f08f
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Update the target quotients for GFX Low_SVS_L1 mode as per
characterization results.
Also, update offset values used to decode the open-loop voltages
for Low_SVS_L1 and Min_SVS modes of GFX voltage rail.
CRs-Fixed: 935784
Change-Id: I0c0f6a1fba0f35a52cc35415bfa4fd067654dbf9
Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
DM layer allocates pool size of 256 for request based module while
dm-req-crypt internally allocates pool for minimum 16 requests.
Increasing pool size of dm-req-crypt to be consistent with DM layer.
Also, changing GFP mask for allocation from pool, depending upon
whether call is made from atomic context or not.
Change-Id: I9dfeb46520e0d1b1fc6f850a007fce35bdc60d35
Signed-off-by: Dinesh K Garg <dineshg@codeaurora.org>
There is a requirement for configuring certain spare register
bits of PON peripheral. Since there is a chance for multiple
clients to configure these bits, a regulator device can handle
such configuration easily. Add support for it.
Regulator configuration requires an address inside PON peripheral
and a bit position which needs to be controlled to be specified
in the device tree subnode.
CRs-Fixed: 840571
Change-Id: I62d0c3f49e777103e102229353faaf2e8ee1fad6
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Add TTW configuration for PMI8950. Also, add a DT property
(qcom,labibb-ttw-force-lab-on) to keep LAB always-on in TTW mode.
Presently, this property is only required for PMI8950.
CRs-Fixed: 958285 962662
Change-Id: Iec79a6f752067d96fc62a8e9d629c39f4db5ab9f
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
Currently when entering touch-to-wakeup (TTW) mode, IBB module
is disabled as part of the regulator_disable sequence before
applying the settings needed for SWIRE control in TTW mode.
This causes adversary effects such as droop in the VDISN
voltage rail.
To avoid this, as per the hardware documentation, do not disable
IBB module through IBB_ENABLE_CTL when LABIBB regulators are
disabled and entering TTW mode. Instead, just enter TTW mode and
mark the regulators disabled. Normal mode settings will be
applied when the regulators are enabled again as before.
While at it, add a centralized function qpnp_ibb_mode() to write
to IBB_ENABLE_CTL register.
CRs-Fixed: 952847
Change-Id: I74c6ba411091d146ab5719c2d72d6385fa90af21
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
As per the requirement, LAB soft start time should be configured
to 200us when touch-to-wakeup (TTW) mode is activated. Save and
restore the LAB_SOFT_START_CTL register setting before entering
TTW mode and after exiting TTW mode, similar to IBB register
settings done before.
CRs-Fixed: 928619
Change-Id: Ib285cbb11a788a23726b2cbbb2954d2ac62db171
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
Codec reset gpio configuration needs to be updated
before slimbus master component is initialized otherwise
codec cannot be enumerated on the bus. Add a new platform
device driver to update the codec reset gpio configuration
to valid state (output, drive-strength) before slimbus
is initialized.
CRs-Fixed: 968161
Change-Id: I7227212e6b846d58196718255aa4b0923352d120
Signed-off-by: Santosh Mardi <gsantosh@codeaurora.org>
Ensure the task descriptor list memory is flushed before ringing
the doorbell by adding a memory barrier. Also commit the doorbell
write immediately to help improve performance.
Change-Id: I321d5bed95b802d4bcc00836ce9cdede316b29f5
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
If a bulk message times out due to interrupt starvation, a late
coming interrupt may access structures that are not valid.
Improve timeout error handling by resetting variables, and changing
relevant logging.
Change-Id: Ie0ee2fd9c2ce1628c69e1975fe713a2a26d9e716
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>