Commit graph

577902 commits

Author SHA1 Message Date
Subash Abhinov Kasiviswanathan
ba31ac1066 nf: IDLETIMER: Fix use after free condition during work
schedule_work(&timer->work) appears to be called after
cancel_work_sync(&info->timer->work) is completed.
Work can be scheduled from the PM_POST_SUSPEND notification event
even after cancel_work_sync is called.

Call stack

-004|notify_netlink_uevent(
    |    [X19] timer = 0xFFFFFFC0A5DFC780 -> (
    |      ...
    |      [NSD:0xFFFFFFC0A5DFC800] kobj = 0x6B6B6B6B6B6B6B6B,
    |      [NSD:0xFFFFFFC0A5DFC868] timeout = 0x6B6B6B6B,
    |      [NSD:0xFFFFFFC0A5DFC86C] refcnt = 0x6B6B6B6B,
    |      [NSD:0xFFFFFFC0A5DFC870] work_pending = 0x6B,
    |      [NSD:0xFFFFFFC0A5DFC871] send_nl_msg = 0x6B,
    |      [NSD:0xFFFFFFC0A5DFC872] active = 0x6B,
    |      [NSD:0xFFFFFFC0A5DFC874] uid = 0x6B6B6B6B,
    |      [NSD:0xFFFFFFC0A5DFC878] suspend_time_valid = 0x6B))
-005|idletimer_tg_work(
-006|__read_once_size(inline)
-006|static_key_count(inline)
-006|static_key_false(inline)
-006|trace_workqueue_execute_end(inline)
-006|process_one_work(
-007|worker_thread(
-008|kthread(
-009|ret_from_fork(asm)
---|end of frame

Force any pending idletimer_tg_work() to complete before freeing
the associated work struct and after unregistering to the pm_notifier
callback.

CRs-Fixed: 1088590
Change-Id: I4c5f0a1c142f7d698c092cf7bcafdb0f9fbaa9c1
Signed-off-by: Subash Abhinov Kasiviswanathan <subashab@codeaurora.org>
2016-11-14 12:08:11 -07:00
Sreelakshmi Gownipalli
2d6dc48e83 diag: Call diagmem_exit only if the mempool is initialized
Call diagmem_exit in diag_mhi_exit only if the memory pool is
initialized earlier. If diag bridge initialization fails
allow diag apps to still communicate to other processors
without unloading the diag driver.

Change-Id: I0eb8b9a357f172984612175d1b03dd872df91b6f
Signed-off-by: Sreelakshmi Gownipalli <sgownipa@codeaurora.org>
2016-11-14 10:47:51 -08:00
Harry Yang
8947aae10b qcom-charger: WA for cc2 removal with medium and high rd
In PMICv2, typec removal is known when CC detachment is detected,
but this does not work due to a HW bug, when orientation is CC2
with medium or high rd.

Currently in HW, after cable is removed, rd reading switches to
std from medium or high. The software workaround is to catch this
very change in cc state update, and then force a cc detach irq.

CRs-Fixed: 1079913
Change-Id: I284ca8f2221f596432d67117d89e7d501d2bd9a8
Signed-off-by: Harry Yang <harryy@codeaurora.org>
2016-11-14 10:47:30 -08:00
Harry Yang
dd9faf5083 qcom-charger: WA for typec cc2 sink removal with rdstd
In PMICv2, typec removal relies on CC detachment detection,
but CC removal event does not fire when orientation is CC2
with rdstd, due to a HW bug.

The software workaround is to force typec sink cycles and
poll CC states, until cc status reading confirms detachment,
and PD is notified of typec removal.

CRs-Fixed: 1079913
Change-Id: Ie9ed65d421df57c9bfa4db8e44d358da3b0cdc36
Signed-off-by: Harry Yang <harryy@codeaurora.org>
2016-11-14 10:44:35 -08:00
Nicholas Troast
2db5e43410 qpnp-fg-gen3: add support to show time to full and empty
Estimate the amount of time it will take to charge or discharge the
battery. These values are exposed through power supply properties
time_to_full_avg and time_to_empty_avg.

Change-Id: I53c24deb1cfbd7fea1b2a598ed58c6352c5ff9a2
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2016-11-14 10:34:39 -08:00
Nicholas Troast
3b66278123 smb-lib: remove cached vbus present status
USBIN_INT_RT_STS_REG can be read to determine whether vbus is present
therefore caching the result is unnecessary. Remove it.

Change-Id: Idace48373333dc3ab36aa10e0d90098a68af315d
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2016-11-14 10:28:39 -08:00
Oleg Perelet
eeb34111fa msm: kgsl: preserve ISENSE registers across GPU power collapse
After wakeup from power collapse restore ISENSE registers from
internal buffer.

CRs-Fixed: 1075694
Change-Id: I9cf2f94892bdeb83fab0068902419b1603520364
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
2016-11-14 10:09:42 -08:00
Ingrid Gallardo
a855c5232c msm: mdss: fix logic to enable secure display/camera
Current logic that optimizes the skip of the enable
and disable of the secure display/camera has a
problem which results in skipping the secure
configuration always. Fix the logic to make sure
we only skip the configuration in two cases:
1. If both features secure camera and display are
disabled and state remains same for current frame.
2. If one of the features is already enabled and
the state remains the same for current frame.

Change-Id: I614aeadf022e01f17660791c0037ceb9f73456a3
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-11-14 09:41:28 -08:00
Nicholas Troast
6f15f9c366 smb-lib: use plugin real time status for USB present prop
The USB and DC power supplies should reflect the real time plugin status
in POWER_SUPPLY_PROP_PRESENT.

Change-Id: I08987a383edff181e8e4867d8d795dae58ecf084
Signed-off-by: Nicholas Troast <ntroast@codeaurora.org>
2016-11-14 09:13:01 -08:00
sathish
293989e540 msm: kgsl: Fix pt NULL pointer dereference
Add a NULL check for pt pointer variable in
a4xx_submit_preempt_token(), to avoid NULL
pointer dereference.

CRs-Fixed: 1083045
Change-Id: I6f8abe55f3d99d2ff46e4bb2a8cd11a067be7508
Signed-off-by: Dumpeti Sathish Kumar <sathyanov14@codeaurora.org>
2016-11-14 03:01:06 -08:00
Zhenhua Huang
6fd2e6f839 ARM: dts: msm: add PMFALCON/PM2FALCON devices for msmcobalt interposer QRD
Add PMIC devices and remove reference of PMCOBALT/PMICOBALT from all
client device nodes. This is for QRD only as it is a different design from
MTP and CDP. In the parallel, delete reference from storage.

Change-Id: I5842c32fbfcd62692a3585f23bfcb0d9c4b5f6c5
Signed-off-by: Zhenhua Huang <zhenhuah@codeaurora.org>
2016-11-14 15:50:42 +08:00
Amit Nischal
a8cd6932aa clk: qcom: Remove initial configuration from PLL enable function
In alpha PLL enable function, PLLs do not require to do
initial configuration as it can be already configured
by pre HLOS. clk_alpha_pll_configure() should be called
explicitly where HLOS configures the PLLs. So remove the
call to clk_alpha_pll_configure() in PLL enable function.

Change-Id: Id3542f6649209929d83e5a2d6230f1d3d7dfa776
Signed-off-by: Amit Nischal <anischal@codeaurora.org>
2016-11-14 12:29:57 +05:30
Raju P.L.S.S.S.N
369f045fa2 ARM: dts: msm: Add rpm-smd node for msmtriton
Add rpm-smd node for communication with RPM subsystem over glink.

Change-Id: I28be6557fa97d65ec9add1d31c854576e21b47e1
Signed-off-by: Raju P.L.S.S.S.N <rplsssn@codeaurora.org>
2016-11-14 11:14:28 +05:30
Taniya Das
28fc7928ba ARM: dts: msm: Support only dummy clocks for falcon/triton rumi
As RUMI platform does not require real clocks, add back dummy clocks for
this platform.

Change-Id: I774ffb1e55971ec8097994d1cfe664db5902a8ce
Signed-off-by: Taniya Das <tdas@codeaurora.org>
2016-11-13 21:20:55 -08:00
Linux Build Service Account
24d0c1f91e Merge "msm: mdss: dp: handle fast attention events" 2016-11-13 13:51:09 -08:00
Linux Build Service Account
23bb5f214e Merge "msm: sde: add buf_finish callback to clear last fd" 2016-11-13 13:51:08 -08:00
Linux Build Service Account
d1224e557b Merge "clk: msm: mdss: fix potential use of un-initialized variable" 2016-11-13 13:51:07 -08:00
Rajesh Kemisetti
a852ef6625 ARM: dts: msm: Change GPU clock plan for msmcobalt interposer
Change GPU clock plan based on requirements for msmcobalt
interposer platform versions.

Change-Id: I817859817eeb76c565d1604fcb1cc11b0df2dd30
Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
2016-11-14 01:09:26 +05:30
Linux Build Service Account
ce1a7c8d7d Merge "ARM: dts: msm: Add battery profile for FG in QRD interposer msmcobalt" 2016-11-13 04:22:15 -08:00
Linux Build Service Account
b22eba07a1 Merge "ARM: dts: msm: update VDD_GFX CPR settings for msmcobalt v2" 2016-11-12 21:39:15 -08:00
Linux Build Service Account
ace335774a Merge "defconfig: enable QCOM_IRQ_HELPER for 32bit msmcobalt and msmfalcon" 2016-11-12 05:13:47 -08:00
Satish Babu Patakokila
bef46b317c ASoC: compress: Fix compress capture stream handling
Compress framework considers the stream as PLAYBACK
always irrespective of the direction.
Derive substream based on the tx/rx direction from
compressed stream.

CRs-fixed: 1072067
Change-Id: I62c51c23a47f26b221dccef6f83c03aef9f095a7
Signed-off-by: Satish Babu Patakokila <sbpata@codeaurora.org>
2016-11-11 21:28:08 -08:00
Linux Build Service Account
eac6f4e45b Merge "defconfig: Enable android-verity and FEC in msmcortex" 2016-11-11 20:05:51 -08:00
Linux Build Service Account
8e2e1b3d6a Merge "msm_11ad: disbale L1 for 11ad device" 2016-11-11 20:05:50 -08:00
Linux Build Service Account
2d320e52f7 Merge "usb: gadget: Do not disconnect unregistered dev" 2016-11-11 20:05:49 -08:00
Linux Build Service Account
20f034903f Merge "usb: core: Add support to skip extended bus resume delay" 2016-11-11 20:05:48 -08:00
Linux Build Service Account
35b3425fcb Merge "qpnp-fg-gen3: Fix empty SOC handling" 2016-11-11 20:05:47 -08:00
Linux Build Service Account
b1f3ef5bc7 Merge "soc: qcom: Replace ARRAY_SIZE macro with strlen" 2016-11-11 20:05:46 -08:00
Linux Build Service Account
327b9b6314 Merge "Documentation: sched: Update frequency guidance explanations" 2016-11-11 20:05:45 -08:00
Linux Build Service Account
b240a83d88 Merge "qcom-charger: smblib: add support for pd current setting" 2016-11-11 20:05:44 -08:00
Vikram Mulukutla
3f11a4bc4f sched: core: Skip migrating tasks that aren't enqueued on dead_rq
During migrate_tasks, we have to drop the dead_rq lock in
order to preserve locking order when acquiring task->pi_lock.
This may allow the task to migrate off of dead_rq. Therefore,
don't attempt to migrate such a task again from dead_rq.

Change-Id: Id31b58e231d3dcd7d32e0dc7f264595d60a7c408
Signed-off-by: Vikram Mulukutla <markivx@codeaurora.org>
2016-11-11 16:09:55 -08:00
Ingrid Gallardo
dba97196b9 msm: mdss: Avoid accessing pipe out of the boundaries
When display driver looks for a pipe, it checks for
the number of rectangles that the pipe allows.
This number only needs to be obtained from the base
pipe and there is no need to check for this number
on each of the rectangles of the base pipe.
Current code, gets this number for the base pipe
and for each of its rectangles while iterating the
list of pointers; main problem is that in the
loop through the rectangles, the pointer to the
'pipe' has been already increased at the end of the
'for' loop; which causes that the check to see if
the iterations need to continue is done against the
next element of the list; this is mainly a problem
for the last element of the list, since the pointer
would be something beyond the boundaries of the list.

Change-Id: Ie4ac72e460643606f718d5809e65cda70932fb84
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
2016-11-11 15:46:14 -08:00
Veera Sundaram Sankaran
5d30a3d0dc msm: mdss: avoid removing wrong multirect on validate failures
During atomic commit - validate failures, the newly allocated
pipes and pipes taken from the destroy list are cleaned up.
Currently pipe ndx is checked which can lead to cleaning up
the already in use multirect instead of the rect allocated
in the current validate. Add checks to include checking based
on multirect to avoid such cases.

Change-Id: I7f8fb6630314cdc523490e28d90dd3776bdfeada
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2016-11-11 15:24:30 -08:00
Siddartha Mohanadoss
f0bcb723f9 iio: rradc: Update RRADC USBIN scaling
To improve accuracy update RRADC USBIN current
scaling factor for V/A from 0.5 to 0.53.

Change-Id: Ia13bd8702f337f71dae5d612f6efe55ee8c2a317
Signed-off-by: Siddartha Mohanadoss <smohanad@codeaurora.org>
2016-11-11 14:25:56 -08:00
Deepak Katragadda
52168e4c32 clk: msm: Add the CLKFLAG_NO_RATE_CACHE flag for MM clocks on MSM COBALT
The clock driver by default returns immediately if a set_rate()
request is made for a clock with a frequency that matches the
SW frequency state. This is an optimization to avoid performing
unnecessary clock configuration updates.
Due to a HW limitation of the multimedia block on MSM COBALT,
the clock sources or RCGs can end up running at XO frequency
after a multimedia power collapse. In order to avoid this,
have the multimedia clients call set_rate() prior to enabling
their clocks. In addition, add the CLKFLAG_NO_RATE_CACHE flag
to the multimedia clocks to remove the above mentioned set_rate()
optimization and re-configure the clock source for every rate
request, regardless of what rate the RCG is already configured to.

CRs-Fixed: 1088709
Change-Id: I21e1c029e6b245cfa26a187b35bb1f6845302484
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
2016-11-11 14:19:37 -08:00
Tony Truong
d0430dc0f2 Revert "ARM: dts: msm: disable L1 and L1ss for PCIe on msmcobalt"
This reverts commit c93b93ee87 ("ARM: dts: msm: disable L1 and
L1ss for PCIe on msmcobalt").

Re-enable a necessary power saving feature for PCIe and its
client.

Change-Id: I231f518b701a988ab4a4f475e7e3c6f17d58187b
Signed-off-by: Tony Truong <truong@codeaurora.org>
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-11-11 23:38:39 +02:00
Maya Erez
6de37372b4 msm_11ad: disbale L1 for 11ad device
Enabling L1 / L1SS for 11ad device causes PCIe
link down or PCIe NOC read/write timeouts.
To prevent that, disable L1 for 11ad devices after
PCIe enumeration and resume.

Change-Id: I5061c95855d462879c2f5237ded80131de4d215d
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-11-11 23:38:22 +02:00
Dhaval Patel
5d2b103d52 msm: mdss: fix race condition in dsi clk off request
DSI clocks are requested from mdp and dsi for
different use cases. The master clocks(DSI0 clocks)
are refcounted to avoid toggling during slave
clock ON/OFF sequence. Same applies to split controller
clocks if broadcast mode is enabled. Now, mdp client
can remove the dsi client's vote in below case:

- MDP requested clocks in ECG state
   - clk_ctrl has removed both votes from ctrl-0
     using dsi client handler.
- DSI turns ON clock for ctrl-1
   - clk_ctrl turns on clk for ctrl-0 using dsi
     client handler.
   - clk_ctrl increase the ctrl-1 refcount to 1
   - clk_ctrl turns on clk for ctrl-1
- MDP request to turn OFF the clk for ctrl-1
   - clk_ctrl turns on clk for ctrl-0 using dsi
     client handler
   - clk_ctrl increase the ctrl-1 refcount to 2
   - clk_ctrl turns off clk for ctrl-1
   - clk_ctrl turns off clk(twice) for ctrl-0
     using dsi client handler.

This race condition leads to dsi0 clocks off event when
interface is using clocks. This change start tracking
extra vote based on calling client id.

Change-Id: I4812330453dedacd16dad1d920a2bacc3f67042b
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-11-11 12:07:14 -08:00
Subbaraman Narayanamurthy
561bfca197 leds: qpnp-flash-v2: Add support for programming led clamp currents
Allow the mitigation clamp current values for the leds to be
configured through the device tree.

CRs-Fixed: 1060212
Change-Id: I23bf67fba7cef2735db436899a9d5b3306e5a77f
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2016-11-11 11:59:15 -08:00
Subbaraman Narayanamurthy
05939b3db2 leds: qpnp-flash-v2: modify regulator control for switch devices
Currently multiple regulator devices can be specified for LED
switch device though a switch device may just require one supply.
Also, before the switch device is enabled, voltage request is
sent to set the maximum voltage. This is not needed with the
regulators like BoB being used as supply for the switch device.
Just enabling the regulator is enough during switch operation.
Modify the way the regulator is obtained and controlled for
switch operation.

Since BoB regulator is configured by the bootloader properly
for flash operation, remove them from the supply list of LED
switch devices on pmicobalt and pm2falcon.

While at it, fix the way device tree properties are read from
flash/torch, switch devices.

CRs-Fixed: 1083246
Change-Id: I8eb5f305f89bc18ad4b735bd89cbf259f0e1ea11
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2016-11-11 11:59:15 -08:00
Subbaraman Narayanamurthy
e03e61b954 leds: qpnp-flash-v2: Add sysfs support to query max_current
Add support to query max_current for each switch node through
sysfs. This will be useful to know the maximum current that
the flash switch device can draw at that time.

Change-Id: Ie83e71eafff5c49c81f56f92aa719662814997ed
Signed-off-by: Devesh Jhunjhunwala <deveshj@codeaurora.org>
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2016-11-11 11:57:56 -08:00
Dhaval Patel
e2ef952c4e mdss: mdp: avoid panic if recovery handler is uninitialized
Recovery handler is uninitialized during ctl stop process.
A fifo error occur during stop process leads to panic
which is false alarm. These errors do need panic because
controller is going to stop/start and invokes the
panel power off/power on. This patch removes the panic
from the cases where recovery handler is uninitialized.

Change-Id: I422d53d008223a9b0520f499e629f681bb6afa05
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-11-11 11:46:23 -08:00
Dhaval Patel
6f874e20a4 msm: mdss: add null check before dereferencing src_fmt
Add null check before dereferencing the src_fmt
during layer validation.

Change-Id: I6482dc3d21fdc3e570fd53022e2fb9427668d939
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2016-11-11 11:46:00 -08:00
Shiv Maliyappanahalli
2b39a667dc drivers: soc: increase glink tx buffer count
The number of total glink tx buffers are running out
while exercising audio concurrency usecases. Increase
the max tx count to accommodate additional buffer needs.

Signed-off-by: Shiv Maliyappanahalli <smaliyap@codeaurora.org>
Change-Id: Iab64336f8efde2778c16156c6bfcf566c4c892d3
2016-11-11 11:43:35 -08:00
Syed Rameez Mustafa
48cda09051 Documentation: sched: Update frequency guidance explanations
Following the introduction of the top-tasks approach towards frequency
guidance, the documentation on frequency guidance needs to be updated.
Update the same with new and accurate information.

Change-Id: If7deee97c09666b7d9513f79c0e278c430acfdfd
Signed-off-by: Syed Rameez Mustafa <rameezmustafa@codeaurora.org>
2016-11-11 11:37:53 -08:00
Liam Mark
b40f602bfa iommu/arm-smmu: support mapping before enabling S1 translations
For performance reasons there are clients who would like to move
from stage 1 bypass to stage 1 enabled without having to stop their
device.

Currently clients need to stop their device because they have to
create the required stage 1 mappings before re-enabling the device.
Add the new DOMAIN_ATTR_EARLY_MAP domain attribute to allow clients
to create stage 1 mappings after attaching but before enabling
stage 1 translations.

If the clients set the DOMAIN_ATTR_EARLY_MAP domain attribute to 1
before attaching then then once they attach the SMMU driver won't
enable stage 1 translations. This gives the client the opportunity to
create the required early mappings (for example using iommu_map).
When the client has finished creating the necessary early mappings
the client can then set the DOMAIN_ATTR_EARLY_MAP domain attribute
to 0, this will in turn enable stage 1 translations.

Change-Id: I9e95c5d2130f1d371e201eac69dec140cc773b1f
Signed-off-by: Liam Mark <lmark@codeaurora.org>
2016-11-11 09:46:54 -08:00
Yuanyuan Liu
5090370f03 icnss: Collect ramdump from MSA memory space
Collect ramdump from MSA memory space when Modem SSR happens.
WLAN FW runs on modem and stores some data on APPS MSA memory
space. In order to collect full data of FW during Modem SSR,
ICNSS platform listens for Modem SSR notification and collects
MSA ramdump.

CRs-Fixed: 1088608
Change-Id: I9c014261f5e25b3ec4585747d324ea2cb6ab18fb
Signed-off-by: Yuanyuan Liu <yuanliu@codeaurora.org>
2016-11-11 09:13:27 -08:00
Dilip Kota
39c04f12d9 ARM: dts: msm: Add slimbus instance entries for msmfalcon
Add Audio and QCA slimbus instance entries.
Entries are disabled by default. Need to enable
along with slave instances.

Change-Id: I372e9e38a567e0cf83a226f29510fdf570decd43
Signed-off-by: Dilip Kota <dkota@codeaurora.org>
2016-11-11 17:54:12 +05:30
Tony Truong
da2d8a086e msm: pcie: support QGIC MSI for multiple clients
Add support to provide QGIC MSI for each client
that requests for it when they share the same
root complex.

Change-Id: Ia7e33fae35b3c5083ff5834344c21d6c8288b53d
Signed-off-by: Tony Truong <truong@codeaurora.org>
2016-11-11 01:59:16 -08:00
Manoj Prabhu B
0e1d1f5c94 ARM: dts: msm: Enable memory allocation for diag on triton
The new diag client requires additional memory from hlos.
This patch caters to diag memory requirement.

CRs-Fixed: 1079523
Change-Id: Ief14bb96bfdc1998b7b9423755daae8d93964672
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2016-11-11 14:26:22 +05:30