Commit graph

571366 commits

Author SHA1 Message Date
Alan Kwong
638f6bb9e2 Revert "ARM: dts: msm: Add v4l2 rotator node to msm8996"
This reverts commit 152fc477d3 ("ARM: dts: msm: Add v4l2
 rotator node to msm8996").

Smmu attachment failure is reported on v4l2 rotator in devsp.
Revert v4l2 rotator node back to mdss rotator node in devsp
until the smmu issue is resovled.

CRs-Fixed: 1025431
Change-Id: I25a9412c32ddb5d55379b9e96c91f246f6bd4aa9
Signed-off-by: Alan Kwong <akwong@codeaurora.org>
2016-06-09 15:10:10 -07:00
Viswanadha Raju Thotakura
71a1b15ffd ARM: dts: msm: Add flash nodes to camera on msmcobalt
Add support for camera flash operation.
Add status property for csiphy, csid camera nodes.

CRs-Fixed: 1021009
Change-Id: Ifa62e4e4662d72904411ff4dda10a29a76962851
Signed-off-by: Viswanadha Raju Thotakura <viswanad@codeaurora.org>
2016-06-09 15:09:58 -07:00
Joonwoo Park
8c8a1a12e8 sched: avoid potential race between governor and thermal driver
It's possible thermal driver and governor notify that fmax is being
changed at the same time.  In such case we can potentially skip updating
of CPU's capacity.  Fix this by updating capacity always when limited
fmax is changed by same entity.

Meanwhile serialize sched_update_cpu_freq_min_max() with spinlock since
this function can be called by multiple drivers at the same time.

Change-Id: I3608cb09c30797bf858f434579fd07555546fb60
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-06-09 15:09:45 -07:00
Neeraj Upadhyay
b33996c5b4 defconfig: msm: Add MSMFALCON in defconfig
Add arch_msmfalcon and pinctrl in defconfig.

Change-Id: Ie622624676c648cb109e62d3dcf0601222b291c9
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
2016-06-09 15:09:26 -07:00
Neeraj Upadhyay
84e1573bd0 ARM: dts: msm: Add initial device tree files for MSMFALCON
Add the device tree files necessary to support the MSMFALCON
SoC and the MSMFALCON Simulator platform.

Change-Id: Iabdb1c21757ad6dead50fdc4aa3b12077f8f840f
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
2016-06-09 15:09:14 -07:00
Kiran Kelageri
52979505f2 Bluetooth: Add ioctl for pin connectivity test
Add ioctl to test slimbus HW interface to implement
pin connectivity factory test.

Change-Id: Ied4c818b0012c733e73ff894470594f9429d9882
Signed-off-by: Kiran Kelageri <kirankelageri@codeaurora.org>
2016-06-09 15:09:00 -07:00
Jeevan Shriram
2421d1ae04 Defconfig: arm64: Enable BTFM in performance defconfig
Enabled BTFM Features in performance defconfig by
default.

Change-Id: I9c007dededd88a7e8bc8c3226507a46046e96bc4
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
2016-06-09 15:08:29 -07:00
Subbaraman Narayanamurthy
f83ca28c28 defconfig: msm-perf: enable QPNP_POWER_ON driver
Enable QPNP_POWER_ON driver for msm-perf_defconfig so that the
input keys can be functional.

CRs-Fixed: 1011669
Change-Id: I9ae7a806a5b659a2c15fa86b37cd1075913095d5
Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
2016-06-09 15:08:15 -07:00
Joonwoo Park
96818d6f1d sched: fix potential deflated frequency estimation during IRQ handling
Time between mark_start of idle task and IRQ handler entry time is CPU
cycle counter stall period.  Therefore it's inappropriate to include such
duration as part of sample period when we do frequency estimation.

Fix such suboptimality by replenishing idle task's CPU cycle counter
upon IRQ entry and using irqtime as time delta.

Change-Id: I274d5047a50565cfaaa2fb821ece21c8cf4c991d
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-06-09 15:08:01 -07:00
Joonwoo Park
6e8c9ac98d sched: fix CPU frequency estimation while idle
CPU cycle counter won't increase when CPU or cluster is idle depending
on hardware.  Thus using cycle counter in that period of time can
result in incorrect CPU frequency estimation.  Use previously calculated
CPU frequency when CPU was idle.

Change-Id: I732b50c974a73c08038995900e008b4e16e9437b
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-06-09 15:07:48 -07:00
Joonwoo Park
54c0b0001b sched: preserve CPU cycle counter in rq
Preserve cycle counter in rq in preparation for wait time accounting
while CPU idle fix.

Change-Id: I469263c90e12f39bb36bde5ed26298b7c1c77597
Signed-off-by: Joonwoo Park <joonwoop@codeaurora.org>
2016-06-09 15:07:35 -07:00
Chris Lew
28e33ce739 diag: Update logs, events and messages codes
This change updates the macro definitions to
increase the range on the logs, events and messages.

Change-Id: I8410462b17c5741fb03239377fed18c5f6034b90
CRs-Fixed: 994733
Signed-off-by: Chris Lew <clew@codeaurora.org>
2016-06-08 15:20:45 -07:00
Jack Pham
b5e86ec97a usb: pd: Handle disconnection immediately if SDP
Due to a known PMIC HW bug, hard reset or PR swap may result in
the charger notifying a CC disconnect event in sink mode, in which
case the handler ignores it given these conditions. However, this
closely resembles the case of a non-PD capable source getting
physically disconnected as well. Consisdering the most probable
case of this happening is disconnecting from an SDP while hard
reset was just issued (and will fail), this workaround is currently
racy if repeated plugin/plugout is performed as the timeout to
detect failed hard reset takes a few seconds.

For now, until a HW fix is available, optimize this legacy case
by allowing the disconnect to go through if the detected charger
type is SDP. Also fix the SINK_WAIT_CAP_TIME timeout as it was
incorrectly multiplied by 3 during testing and was not removed.
This will significantly reduce the amount of time for max failed
hard reset attempts for non-PD && non-SDP cases and should decrease
the window for racing with an actual disconnect.

Change-Id: Ic57a369ed1e194ab512b4b86ce4d216df46b5f46
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-06-08 15:20:27 -07:00
Arun Kumar Neelakantam
84f558918f soc: qcom: msm_glink_pkt: Register and wait for link up notification
The user space clients sometimes open the device before the underlying
transport available which results in open error and cause multiple re-tries
from the clients. This leads to excessive logging of open error messages.

Register for link state notification and block the client open until link
available or user define timer expires.

CRs-Fixed: 1018542
Change-Id: I4e56982700f3444f96e1100c0ce272d36d3423a5
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2016-06-08 15:20:17 -07:00
Dhoat Harpal
05360211f8 soc: qcom: glink: Fix parallel migration issue
During parallel migration race conditions are seen in remote open
and local open ack function.

Edge based lock is introduced to avoid any race condition during
simultaneous migration. Edge lock is shared across multiple
transport of same edge and is stored in a global list.

CRs-Fixed: 1010920
Change-Id: I2b988d2a6112add06fa433c4b1deeec0b6e6bb58
Signed-off-by: Dhoat Harpal <hdhoat@codeaurora.org>
2016-06-08 15:20:06 -07:00
Maya Erez
a55a0d7fc7 wil6210: align wil log functions to wil_dbg_ratelimited implementation
Change the implementation of wil log functions for consistency
with __wil_dbg_ratelimited.

Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: 8fe2a5f9f9b5a2f26d9d31d350b2323aee13067a
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
CRs-Fixed: 1015627
[merez@coreaurora.org: fixed merge conflicts]
Change-Id: Ie7e073d672a561b768cb62f1e39af24c1d7c3322
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-06-08 15:19:52 -07:00
Mohan Pallaka
9137d71437 defconfig: msmcortex: enable gpio keys module
Enable gpio keys module to support keys

Change-Id: I85c0401c6c47d4988d39ef637c1517916e41e3cb
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2016-06-08 15:19:15 -07:00
Mohan Pallaka
236b83d1ea ARM: dts: msm: add gpio keys support for msmcobalt
Add support for gpio keys on msmcobalt CDP and MTP.
CDP and MTP use pmcobalt gpios 6, 7 and 8 for volume up,
camera snapshot and camera focus respectively. CDP
additionally supports home key through pmcobalt gpio 5.

Change-Id: I31f3ed15e8cf02046cfcc8d9c062522065bb022c
Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
2016-06-08 15:19:03 -07:00
Chinmay Sawarkar
b2b8dc615f ARM: dts: msm: Fix bus governor for Venus VMEM on msmcobalt
Use the correct bus governor for Venus VMEM.

Change-Id: I9abc6352732c189e90cefaa3eb4161ea6d103529
Signed-off-by: Chinmay Sawarkar <chinmays@codeaurora.org>
2016-06-08 15:18:48 -07:00
Archana Sathyakumar
78b75df117 ARM: dts: msm: Update MPM interrupt mappings for cobalt
Update MPM interrupt mapping to bypass some of the interrupts as per the
HW specification.

Change-Id: Ib6f218989616b038adb7a001cbc6302924041aa1
Signed-off-by: Archana Sathyakumar <asathyak@codeaurora.org>
2016-06-08 15:18:33 -07:00
Maya Erez
8be22a3241 wil6210: add pm_notify handling
Adding pm_notify to allow the following:
1. Check if suspend is allowed in an earlier stage to prevent
starting the suspend procedure in case it is not allowed
2. Notify the platform driver on the suspend request

Change-Id: Iddacd9b54304b47263647942e1e6784eefb9a6d2
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: e34dc6475a7b25d1aec5de8652a321672904c686
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
CRs-Fixed: 1015627
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-06-08 15:18:28 -07:00
Maya Erez
215177e606 wil6210: fix dma mapping error cleanup in __wil_tx_vring_tso
In case we fail to map one of the TSO SKB fragments, we need to
clear all the mapped descriptors, from swhead to swhead+descs_used-1.

Change the desc index calculation to
i = (swhead + descs_used - 1) % vring->size;
to prevent unmpping of (swhead + descs_used) descriptor that wasn't
mapped.

Change-Id: I81b99522ada809fa375c6b6887f8ea0e6482fba3
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: a1526f7eafa434f756579e2bc784b7605f96bf3e
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
CRs-Fixed: 1015627
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-06-08 15:18:09 -07:00
Maya Erez
b6b5f4b2a2 wil6210: protect wil_vring_fini_tx in parallel to tx completions
napi_synchronize is called before releasing the vring, with the
assumption that setting txdata->enabled to 0 will prevent handling
of this vring in the next scheduled napi.
To guarantee this assumption, a memory barrier is added after disabling
the txdata.
In addition, as the ctx is zeroed in wil_tx_complete after this
descriptor is handled (protected by wmb), ctx needs to be checked
before releasing this descriptor in wil_vring_free.

Change-Id: I7af20f1db39b7e4c5ac2956fc655f120eb61e002
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: 34b8886e502a62d1355ccc0420044aa2749a24cd
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
CRs-Fixed: 1015627
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-06-08 15:17:51 -07:00
Maya Erez
c89efd08b6 wil6210: guarantee safe access to rx descriptors shared memory
add memory barrier after allocating new rx descriptors, before
updating the hwtail.
This will guarantee that all writes to descriptors (shared memory)
are done before committing them to HW.

Change-Id: If7c91c31b490b0762d23df21db7c30652b0817d4
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: ab6d7cc3eab4093caf91ba8b27590c4080d7d01c
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
CRs-Fixed: 1015627
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-06-08 15:17:29 -07:00
Maya Erez
848faf10c4 wil6210: fix race conditions between TX send and completion
There are 2 possible race conditions, both are solved by addition of
memory barrier:
1. wil_tx_complete reads the swhead to determine if the vring is
empty. In case the swhead was updated before the descriptor update
was performed in __wil_tx_vring/__wil_tx_vring_tso, the completion
loop will not end and as the DU bit may still be set from a previous
run, this skb can be handled as completed before it was sent, which
will lead to double free of the same SKB.
2. __wil_tx_vring/__wil_tx_vring_tso calculate the number of available
descriptors according to the swtail. In case the swtail is updated
before memset of ctx to zero is completed, we can handle this
descriptor while later on ctx is zeroed.

Change-Id: Ia6584de897c366032251033aa8e03c54e9d899bb
Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Git-commit: eb26cff148f5449972121e46e403f549d71f6f49
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.git
CRs-Fixed: 1015627
Signed-off-by: Maya Erez <merez@codeaurora.org>
2016-06-08 15:17:05 -07:00
Hemant Kumar
d68052df98 USB: f_mtp: Set maximum burst value to two for superspeed mode
Currently burst value is set to zero for superspeed in mtp driver.
MTP throughput can be improved by setting max burst value to non
zero value in superspeed mode. Hence set max burst value to two
for both IN and OUT bulk endpoints in superspeed mode.

Change-Id: Ib78b8fec5d1ab934f4d4ec80b7e008149707ce0f
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
Signed-off-by: Hemant Kumar <hemantk@codeaurora.org>
2016-06-08 15:16:50 -07:00
Jack Pham
a6009395a3 usb: pd: Add IPC logging to policy engine
Convert print messages to IPC logging facilities.  This
will allow for easier debugging from crash dumps as
well as from debugfs.  The print calls are converted to
macros which also print to the console for flexibility.

Change-Id: I6238b0434936fcff562d7a049e5e9d13794f9cdc
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-06-08 15:16:09 -07:00
Venkat Gopalakrishnan
813edfeb4d scsi: ufs-qcom : Add quirk for broken auto hibern8
Some platforms might not support auto hibern8 even though the
controller exposes this capability. Add a quirk to disable
auto hibern8 for such platforms.

Change-Id: I4a027f89deddff4735df45da9cffbfb1849af5f4
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-06-08 15:15:39 -07:00
Manoj Prabhu B
c4fcd60d69 diag: Fix for corrupted dci log mask
This patch fixes the possible corruption of the
dci client entries log mask during deinit of dci
entries.

CRs-Fixed: 1021816
Change-Id: I7741eca6ac07cd4393fc373e796570066da7cce6
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2016-06-08 15:15:14 -07:00
Skylar Chang
7554589ef6 msm: ipa3: lower turbo voting threshold
Make turbo voting threshold lower to 1000Mbps to account for CPE
use case.

Change-Id: I5d02d3df7b69e30243a0b44ddf36a894ad739d59
CRs-Fixed: 872263
Signed-off-by: Skylar Chang <chiaweic@codeaurora.org>
2016-06-08 15:14:56 -07:00
Venkat Gopalakrishnan
7cfa6fa532 ARM: dts: msm: enable ufs hw ctl clocks for msmcobalt
QCOM UFS host controller v3.0.0 supports hw gating of clocks, use
the hw ctl clock variants of ufs clocks to enable that support.

Change-Id: I9597507419e59884c44429c8c34f7469fa5192cb
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-06-08 15:14:30 -07:00
Venkat Gopalakrishnan
f3c12e1a86 ARM: dts: msm: Update min freq for UFS src clks on msmcobalt
QCOM UFS host controller v3.0.0 supports running at much lower
frequencies that allow SVS2. Update the UFS clock supported
table with new min frequencies.

Change-Id: I11d941f239ccd1978089194fa269e143fc640d36
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-06-08 15:14:14 -07:00
Venkat Gopalakrishnan
8e338f8fdf scsi: ufs-qcom: add svs2 support
QCOM UFS host controller v3.0.0 supports SVS2 voltage scaling mode
that allows lowest power consumption in HS G1. The link must be put
in hibern8 state before configuring the PHY to enter SVS2 mode.
The voltage can be reduced after this to SVS2 level.
Make the necessary change to support this on the qcom ufs variant.

Change-Id: Iba2ebe38c4ec1422931f2a696d9e5ca01b11a987
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-06-08 15:13:58 -07:00
Venkat Gopalakrishnan
e1fcf7ef3d scsi: ufs: add new get_scale_down_gear vops
Each ufs controller variant can work with various gear speeds that
can be supported at a low voltage corner. Add an ops function to
query the gear supported to scale down.

Also make the hibern8 entry/exit function non static as the variant
drivers might need to call hibern8 entry/exit when scaling down to
a lower gear.

Change-Id: I50008a892c8c21a4a3361998d76a2f8cbc2995bb
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-06-08 15:13:42 -07:00
Venkat Gopalakrishnan
6b266ad4c8 phy: qcom-ufs: add svs2 support
phy-qcom-ufs-qmp-v3 supports SVS2 voltage scaling mode that
allows lowest power consumption in HS G1. The PHY must be put
in hibern8 state before configuring the PHY to enter SVS2 mode.
The voltage can be reduced after this to SVS2 level.
This change exposes an API that allows the UFS driver to
configure the PHY to enter SVS2 mode.

Change-Id: I2ef01d98603840289c436e14bf3df54a2ab9198b
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-06-08 15:13:17 -07:00
Venkat Gopalakrishnan
cad3a64d0c scsi: ufs-qcom: add auto hibern8 support
QCOM UFS controller version 3.0.0 supports the auto hibern8
feature as defined by the UFS HCI v2.0 specification.
Make necessary changes to enable this during host controller
initialization.

Change-Id: I5a048629dade92fe79631ba30d3b3e280a77d4e6
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-06-08 15:12:49 -07:00
Venkat Gopalakrishnan
dbd6e84bff scsi: ufs: add ufshcd_dme_rmw wrapper
Add a wrapper to get/modify/set DME attribute.

Change-Id: Ife2ae05950e6c437bef779955432d91d5117d49b
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-06-08 15:12:33 -07:00
Venkat Gopalakrishnan
f0a5174e94 scsi: ufs: add auto hibern8 support
UFS HCI v2.0 specification adds support for auto hibern8.
Add support to enable this in the ufs host controller driver.

Change-Id: I57e5be8eae4b2cf70a2a9d9c81c9a54a24e03e71
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-06-08 15:12:20 -07:00
Abhijeet Dharmapurikar
fc630843db pmic-voter: disassociate device from votables
Currently the pmic votables need a device to be created.
Votables should be able to work on device less code. Remove
the need for device and instead use a void pointer to be passed
back to the callback.

CRs-Fixed: 1018090
Change-Id: If5dafbcc0d88596332b794ad5b6fdc1f9ff98a45
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-06-08 15:12:09 -07:00
Abhijeet Dharmapurikar
fc63395132 pmic-voter: remove default value
The default value was introduced to prevent crashes on the clients
where it couldn't handle situations when there were no voters.
The default value led to many complicated scenarios in the votable
implementation.

Remove the concept of default value and return error when
there are no votes. Update all the clients to handle error values
from votables. Also invoke the callback to inform about no active
voters.

CRs-Fixed: 1018090
Change-Id: I81f5974f81a697f3698bc58df1d3ed59fa2579a7
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-06-08 15:11:53 -07:00
Abhijeet Dharmapurikar
74d9ef758e pmic-voter: improve pmic-voter api implementation
Currently the pmic-voter api assumes that the clients are represented
as unique integers. Using strings instead of integers adds flexibility.
- It enables the votable to be shared across multiple drivers without
  having a common client enum
- Debug prints become more useful

While at it
- remove the use of num_clients in the apis. All of them default to
  NUM_CLIENTS.
- Create a list of all the votables, this allows for searching for a
  specific votable.
- Error if a votable is already created with the same name earlier.
- Add debug prints about current clients and effective results
- Remove passing in last_client and last_client_id in the callback. These
  parameters go unused in all the usecases.
- Since clients are assigned sequentially and that they cannot
  unregister from a votable (clients can only disable their votes, but
  they cannot remove themselves), a null string in the client string
  array means there are no more clients. Use this to speed up result
  calculation by stopping at the id with a null string.
- Refactor the vote() implementation. Currently the SET_ANY case flows
  differently than MIN or MAX, make them uniform.
- Create an api to call the callback without casting new votes.

CRs-Fixed: 1018090
Change-Id: I8e2bc3366ec12e8485e4be86ee56ba5e4d113c3c
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
2016-06-08 15:11:17 -07:00
Deepak Katragadda
31bcecd1a2 clk: msm: clock: Add support for programming the GCC_GPU_IREF_EN register
Add a new gcc_gpu_iref_clk that the graphics driver can control
as needed. The default state of the clock is ON; so having this
control will mean saving current.

CRs-Fixed: 1024948
Change-Id: I562bb546f49b1605f20fb7d705f40584d190230b
Signed-off-by: Deepak Katragadda <dkatraga@codeaurora.org>
2016-06-07 16:06:33 -07:00
Ram Chandrasekar
1cdd0691fe ARM: dts: msm: Update the LMH interrupt information for msmcobalt
Update the LMH interrupt information for msmcobalt. This interrupt will
be generated when LMH hardware does mitigation.

Change-Id: If6fdebb36d7108b2ac9b5f3c8a787d305505545c
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
2016-06-07 16:06:21 -07:00
Ram Chandrasekar
432cb528fd drivers: thermal: Add ftrace events for LMH DCVSh mitigation
LMH DCVSh driver receives interrupt from hardware whenever there is a
new mitigation frequency decision is made in hardware.

Add ftrace event to print the hardware mitigation frequency value from
driver.

Change-Id: Ib357ee3c3a461613bfd1268ec8f98973c2982c10
Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
2016-06-07 16:06:08 -07:00
Ping Li
8f2bc2304c ARM: dts: msm: Correct the offset for AD blocks on msmcobalt
msmcobalt only has two AD hardware block, this change corrects
the offsets in the dts file.

CRs-Fixed: 1023377
Change-Id: Ifa797703da0ac846167651c7ed03a6710ba41867
Signed-off-by: Ping Li <pingli@codeaurora.org>
2016-06-07 16:05:57 -07:00
Yeleswarapu Nagaradhesh
676d1c9b0d ASoC: msm: enable HDMI audio for 8996
Enable HDMI RX for 8996, otherwise soundcard
will not get registered for the flavors which
supports HDMI.

CRs-Fixed: 1023892
Change-Id: I0d2442c7b3d156ad919626a6015f0fbbf2116c3f
Signed-off-by: Yeleswarapu Nagaradhesh <nagaradh@codeaurora.org>
2016-06-07 16:05:45 -07:00
Abhijit Kulkarni
292607a9e5 msm: mdss: fix solidfill config for multi-rect pipes
In multi-rect configuration both the pipes should fetch or should
be in solidfill configuration. The change ensures that when switching
between multi-rect to normal configuration with solid fill
enable/disable the multi-rect mode properly.

CRs-Fixed:1025380
Change-Id: I02fc72583fcd9bc27156ce717b52ef17e16313d5
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
2016-06-07 16:05:33 -07:00
Tanvi Aggarwal
f3f6f5f3df msm: camera: Setting actuator to initial position
Updating the hw_params before setting initial position
for VCM type actuator.

CRs-Fixed: 987939
Change-Id: I1b1f1801eb0578644b2e954a3a3ade17b3f2a1fd
Signed-off-by: Tanvi Aggarwal <tanvia@codeaurora.org>
2016-06-07 16:05:23 -07:00
Vlastimil Babka
9ea305710e mm/page_alloc: prevent merging between isolated and other pageblocks
Hanjun Guo has reported that a CMA stress test causes broken accounting of
CMA and free pages:

> Before the test, I got:
> -bash-4.3# cat /proc/meminfo | grep Cma
> CmaTotal:         204800 kB
> CmaFree:          195044 kB
>
>
> After running the test:
> -bash-4.3# cat /proc/meminfo | grep Cma
> CmaTotal:         204800 kB
> CmaFree:         6602584 kB
>
> So the freed CMA memory is more than total..
>
> Also the the MemFree is more than mem total:
>
> -bash-4.3# cat /proc/meminfo
> MemTotal:       16342016 kB
> MemFree:        22367268 kB
> MemAvailable:   22370528 kB

Laura Abbott has confirmed the issue and suspected the freepage accounting
rewrite around 3.18/4.0 by Joonsoo Kim. Joonsoo had a theory that this is
caused by unexpected merging between MIGRATE_ISOLATE and MIGRATE_CMA
pageblocks:

> CMA isolates MAX_ORDER aligned blocks, but, during the process,
> partialy isolated block exists. If MAX_ORDER is 11 and
> pageblock_order is 9, two pageblocks make up MAX_ORDER
> aligned block and I can think following scenario because pageblock
> (un)isolation would be done one by one.
>
> (each character means one pageblock. 'C', 'I' means MIGRATE_CMA,
> MIGRATE_ISOLATE, respectively.
>
> CC -> IC -> II (Isolation)
> II -> CI -> CC (Un-isolation)
>
> If some pages are freed at this intermediate state such as IC or CI,
> that page could be merged to the other page that is resident on
> different type of pageblock and it will cause wrong freepage count.

This was supposed to be prevented by CMA operating on MAX_ORDER blocks, but
since it doesn't hold the zone->lock between pageblocks, a race window does
exist.

It's also likely that unexpected merging can occur between MIGRATE_ISOLATE
and non-CMA pageblocks. This should be prevented in __free_one_page() since
commit 3c605096d3 ("mm/page_alloc: restrict max order of merging on isolated
pageblock"). However, we only check the migratetype of the pageblock where
buddy merging has been initiated, not the migratetype of the buddy pageblock
(or group of pageblocks) which can be MIGRATE_ISOLATE.

Joonsoo has suggested checking for buddy migratetype as part of
page_is_buddy(), but that would add extra checks in allocator hotpath and
bloat-o-meter has shown significant code bloat (the function is inline).

This patch reduces the bloat at some expense of more complicated code. The
buddy-merging while-loop in __free_one_page() is initially bounded to
pageblock_border and without any migratetype checks. The checks are placed
outside, bumping the max_order if merging is allowed, and returning to the
while-loop with a statement which can't be possibly considered harmful.

This fixes the accounting bug and also removes the arguably weird state in the
original commit 3c605096d3 where buddies could be left unmerged.

Fixes: 3c605096d3 ("mm/page_alloc: restrict max order of merging on isolated pageblock")
Link: https://lkml.org/lkml/2016/3/2/280
Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
Reported-by: Hanjun Guo <guohanjun@huawei.com>
Tested-by: Hanjun Guo <guohanjun@huawei.com>
Acked-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Debugged-by: Laura Abbott <labbott@redhat.com>
Debugged-by: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: "Kirill A. Shutemov" <kirill@shutemov.name>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
Cc: Zhang Yanfei <zhangyanfei@cn.fujitsu.com>
Cc: Michal Nazarewicz <mina86@mina86.com>
Cc: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Cc: <stable@vger.kernel.org>	[3.18+]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Change-Id: I768a9c4886aa3fe2e827aba682f67bac2dba6f71
Git-commit: d9dddbf556674bf125ecd925b24e43a5cf2a568a
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
[vinemenon@codeaurora.org: fix trivial merge conflicts]
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Shiraz Hashim <shashim@codeaurora.org>
2016-06-07 16:05:12 -07:00
David Dai
ffdec38088 ARM: dts: msm: Enable QoS settings for fabs for msmcobalt
Remove qos-bypass flags in fab definitions to enable QoS configuration
to allow proper priority of master ports on buses across SoC,
add relevant clock handles to allow access to config registers.

CRs-Fixed: 1006333
Change-Id: If72eed62e28ccaafa2e0fb6186ec88571b4e657a
Signed-off-by: David Dai <daidavid1@codeaurora.org>
2016-06-07 16:04:58 -07:00