Commit graph

578289 commits

Author SHA1 Message Date
Linux Build Service Account
2488cd08b4 Merge "arm: qcom: correct description for MSMTRITON and MSMFALCON" 2016-11-24 13:46:36 -08:00
Subhash Jadavani
00e8c4542a ARM: dts: msm: add UFS_RESET pin ctrl data for msm8998
This change adds the UFS_RESET pin ctrl data for UFS controller node.
This will enable UFS driver to issue reset to UFS device.

Change-Id: I61561fb7e395671d2bc52c6a9c0c71e0351114ea
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-11-24 07:59:56 -08:00
Subhash Jadavani
0c82737188 scsi: ufs: add UFS device reset support
Some platforms may have a SOC pin/gpio connected to UFS device's
RST_n to allow the UFS device reset. This change adds support to
trigger device reset on such platforms.

Change-Id: Ie4faa47fb76837dba909f9a3d0dfe11bc69659e1
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-11-24 07:55:03 -08:00
Subhash Jadavani
1f92a7048e pinctrl: qcom: add UFS_RESET pin data for msm8998
UFS_RESET is a single purpose output only pin which can be used
to send reset to connected UFS device. This change adds the
UFS_RESET pin data.

Change-Id: Iec5e70e3f57a8dd06c0ceda3a6e67e47e043f2d1
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2016-11-24 07:53:45 -08:00
Venkat Gopalakrishnan
c1f300eab8 scsi: ufs: perform full reset at initialization
The phy initialization sequence assumes a POR state but
the bootloaders can leave PHY at an already initialized
state, hence there could potentially be issues with the
initialization from ufs driver. Perform a full reset to
start from a power on reset state. Also a reset is
required by the UFS hardware programming guide.

Change-Id: I0118b0d3013166aeec0bb0bc0ef181e48998e758
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-11-24 07:50:23 -08:00
Venkat Gopalakrishnan
6a714c1bf8 scsi: ufs-qcom: update delay between assert/deassert in full reset
The hardware requirement for delay between assert/deassert
is at least 3-4 sleep clock (32.7KHz) cycles, which comes to
~125us (4/32768). To be on the safe side add 200us delay.

Change-Id: Ib9d27fe7bbf6107b1249b3719f63efdbff4b3795
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-11-24 07:49:32 -08:00
Linux Build Service Account
a9a8ec4cae Merge "msm: vidc: parse 10-bit bus entries for msmfalcon" 2016-11-24 06:13:39 -08:00
Linux Build Service Account
baccd73792 Merge "ARM: dts: msm: Add venus device nodes for starlord" 2016-11-24 06:13:38 -08:00
Linux Build Service Account
c17ad2a8a7 Merge "msm: vidc: Update mbs per second calculation" 2016-11-24 06:13:36 -08:00
Linux Build Service Account
4edc6e2899 Merge "msm: vidc: fix mutex lock issue" 2016-11-24 06:13:35 -08:00
Linux Build Service Account
8c41e4e6b1 Merge "msm: vidc: fix the interrupt miss issue from video hardware" 2016-11-24 06:13:34 -08:00
Linux Build Service Account
383d1c1542 Merge "msm: kgsl: Add support for A512 GPU" 2016-11-24 06:13:33 -08:00
Linux Build Service Account
8a70f4e5d7 Merge "ASoC: msm: Update supported sample rates for USB Backend" 2016-11-24 06:13:32 -08:00
Linux Build Service Account
d2f94a9a44 Merge "netfilter: nfnetlink: correctly validate length of batch messages" 2016-11-24 06:13:31 -08:00
Linux Build Service Account
e49d49a3ec Merge "USB: gagget: f_fs: Return error if TX req is queued during device offline" 2016-11-24 06:13:30 -08:00
Linux Build Service Account
e9ccaa5b66 Merge "clk: qcom: Add support for rf clk1 for msmfalcon" 2016-11-24 06:13:29 -08:00
Linux Build Service Account
11c49a900c Merge "ARM: dts: msm: Update clock gfx node for MSMfalcon/Triton" 2016-11-24 06:13:27 -08:00
Linux Build Service Account
57f5019a62 Merge "clk: qcom: Add support for MMCC clock for MSMFalcon" 2016-11-24 06:13:26 -08:00
Linux Build Service Account
0e7a3bb0e4 Merge "cgroup: prefer %pK to %p" 2016-11-24 06:13:25 -08:00
Linux Build Service Account
a2f553518d Merge "HID: core: prevent out-of-bound readings" 2016-11-24 06:13:24 -08:00
Linux Build Service Account
f3e00aadcd Merge "[media] xc2028: avoid use after free" 2016-11-24 06:13:22 -08:00
Linux Build Service Account
065421c6fa Merge "tcp: fix use after free in tcp_xmit_retransmit_queue()" 2016-11-24 06:13:22 -08:00
Linux Build Service Account
091685a6a4 Merge "block: fix use-after-free in sys_ioprio_get()" 2016-11-24 06:13:20 -08:00
Linux Build Service Account
aff86d3b4f Merge "cfg80211: validate beacon int as part of iface combinations" 2016-11-24 06:13:18 -08:00
Linux Build Service Account
2fb4ab87aa Merge "cfg80211: fix beacon interval in interface combination iteration" 2016-11-24 06:13:18 -08:00
Linux Build Service Account
7193fef2dc Merge "cfg80211: identically validate beacon interval for AP/MESH/IBSS" 2016-11-24 06:13:17 -08:00
Linux Build Service Account
c82d43b7d9 Merge "msm: sde: Correct max downscale factor for SDE rotator" 2016-11-24 06:13:16 -08:00
Maulik Shah
89fb17040f soc: qcom: rpm: Change driver memory allocation to use GFP_NOIO
When a filesystem driver calls into makes a RPM request, RPM driver
makes a kzalloc request with GFP_NOFS flag. This results in a
deadlock if a driver waiting on IO completion sends a RPM message.

Change memory allocation in the RPM driver to use GFP_NOIO.

Change-Id: Ie986b6eb21845b679f068372e46dfb402f234dcf
Signed-off-by: Maulik Shah <mkshah@codeaurora.org>
2016-11-24 04:17:13 -08:00
Laxminath Kasam
ccfb87028b ARM: dts: msm: Specify the configuration for audio on msmfalcon interposer
In msmfalcon interposer for CDP and MTP, add
audio related dtsi files to support external
codecs tasha and tavil.

CRs-Fixed: 1083537
Change-Id: I867e28101cfa37f9764d547f3b43871a430de6d7
Signed-off-by: Laxminath Kasam <lkasam@codeaurora.org>
2016-11-24 17:21:27 +05:30
Sudeep Yedalapure
6c6a15fc06 adreno_tz: Fix divide by zero problem in gpu_load_show()
If the acc_total value is zero then kernel would crash on
div-by-zero. Add better input validation in gpu_load_show()
to avoid divide by zero problem.

CRs-Fixed: 1092584
Change-Id: I7affbd797bf4b0025f718c757043b36f392dae5b
Signed-off-by: Sudeep Yedalapure <sudeepy@codeaurora.org>
2016-11-24 12:45:39 +05:30
Kiran Gunda
5282e3353f ARM: dts: msm: add support of pm3falcon PMIC for msmfalcon
PM3FALCON inherits all it's peripheral nodes from PM2FALCON.
Disable WLED which is not supported on pm3falcon.

CRs-Fixed: 1093681
Change-Id: I1eb0583010712286659ec9b726f4ae7a9a2a84e6
Signed-off-by: Kiran Gunda <kgunda@codeaurora.org>
2016-11-24 10:30:01 +05:30
Veera Sundaram Sankaran
a2c354b2b6 msm: mdss: fix intf_num in irq enable/disable for CWB
There is a mismatch in the interface num being passed for
enabling/disabling the CWB_OVERFLOW IRQ during concurrent
writeback(CWB). Fix it to use the same intf_num for both
cases.

Change-Id: Ic4b7599ac7a06583d745630ee10d3c77d40ac526
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
2016-11-23 15:38:50 -08:00
Jack Pham
8bd4723a22 usb: pd: pdphy: Update Tx Trim setting
HW recommendation is to set the TX_TRIM_3 value to 0x2 for
a steeper slope. This improves eye diagram testing result.
This register is secure access so write to the SEC_ACCESS
prior to setting this.

Change-Id: I80b0a02feb0e4d1fb382407087fa30f390641ccb
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-23 15:03:14 -08:00
Jack Pham
dd1a207e6e usb: pd: Fix VDM and misc timing issues
Decrease the wait time from 5ms to 2ms when preparing a VDM
response to ensure that it gets sent out timely within
tSenderResponse (15ms). To avoid possible collision with an
incoming packet, check that there has not been any queued Rx
message just prior to sending a VDM. Also check the result of the
transmit and simply try again later if -EBUSY is returned.

While at it, fix a couple other miscellaneous timing issues.
Setting PD_ACTIVE=1 has considerable delay due to the charger's
voting mechanism, so move setting it to after starting the
SenderResponse timer when sending the Source Capabilities, and
similarly after sending a Request as a sink, in order to make
sure response timing is met. For source hard reset, increase the
tSrcRecover delay slightly from the spec minimum to account for
additional VBUS rise/fall delays before sending PS_RDY. Finally,
add a delay for VCONN_SWAP before sending PS_RDY for similar reason.

Change-Id: I5760fadb66cad6faf02e95a1e1bb975289ef8e9f
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-23 15:03:14 -08:00
Jack Pham
1526cac8ab usb: pd: pdphy: Acknowledge Rx sooner
To avoid missing an incoming packet that was quickly sent while
still processing the previous packet, clear the acknowledge bit
as soon as the message is consumed from the Rx FIFO. This gives
the hardware a chance to send a GoodCRC without causing the
sender to retry.

Change-Id: I8a9ef42685576ab68aa65efab1bebc40d801990d
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-23 15:03:14 -08:00
Jack Pham
d854b01d55 usb: pd: Avoid spurious state machine work on CC change
If an unexpected or delayed Type-C mode change notification
arrives from the charger driver, it could falsely kick the
state machine and could cause it to prematurely hard reset
since it preempted an expected message. This is particularly
true for the PR Swap operation in which the timing of PS_RDY
and resulting power negotiation is disrupted by the CC change
notification which is catching up. The previous way of handling
this by using the pd->in_pr_swap flag to mask the typec_mode
changes is quite fragile due to the uncertainty of when said
flag should be cleared.

Hence, demote the use of the in_pr_swap flag for only ignoring
the expected disconnect the happens in between the role change.
Then, for typec_mode changes, determine if current_pr is changed
or not to decide whether to kick the state machine. Finally,
since disconnect now is signaled by pd->current_pr==PR_NONE,
we'll need to keep track of whether VBUS had been enabled with
a separate flag rather than relying on pd->current_pr==PR_SRC.

Change-Id: I66be40091b75726d25c7be4478f1248a6af9ca3c
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-23 15:03:14 -08:00
Jack Pham
019cc2089b usb: pd: Reset msgid counters properly
Make sure to reset both Tx and Rx msgid counters when the
protocol layer needs to be reset. This occurs after hard/soft
reset as well as when starting up a new sink or source session.
Put this in a common function pd_reset_protocol().

Change-Id: I643a60a28e6498ca16b6f46293b8aa05eff40266
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-23 15:03:14 -08:00
Jack Pham
8f5b031e11 usb: pd: Fix sink hard reset timing
The current hard reset handling (most recently fixed with
commit 172cec3a2c ("usb: pd: Improve sink hard reset handling"))
is based on a maximum timeout for the longest possible (according
to spec) duration that VBUS may turn off and back on again, just
under 2s, before re-starting the sink and waiting for capabilities
again. However, this method is prone to timing errors, particularly
tTypeCSinkWaitCap, which should be based on when VBUS turns on.

Fix this by making use of the VBUS presence notification from the
charger (PROP_PRESENT). Keep track of this in the psy_changed()
callback and use the falling notification to determine when to
transition out of PE_SNK_TRANSITION_TO_DEFAULT into PE_SNK_STARTUP.
Bring back PE_SNK_DISCOVERY which is now used as a waiting state
until the VBUS rising notification comes and transition to
PE_SNK_WAIT_FOR_CAPABILITIES. And move setting of PROP_VOLTAGE_MAX
to PE_SNK_STARTUP after VBUS has turned off to avoid tripping
the charger's overvoltage detection.

Also since aforementioned commit, the CC HW is now able to handle
VBUS going away and not treating it as a false disconnect, so we
can remove the workaround as a disconnect can now be treated as
a disconnect.

Change-Id: I885f3f4c219e102758fd09c8aae9257d093ebb72
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-23 15:03:14 -08:00
Paul Moore
7b0a354c5e audit: fix a double fetch in audit_log_single_execve_arg()
There is a double fetch problem in audit_log_single_execve_arg()
where we first check the execve(2) argumnets for any "bad" characters
which would require hex encoding and then re-fetch the arguments for
logging in the audit record[1].  Of course this leaves a window of
opportunity for an unsavory application to munge with the data.

This patch reworks things by only fetching the argument data once[2]
into a buffer where it is scanned and logged into the audit
records(s).  In addition to fixing the double fetch, this patch
improves on the original code in a few other ways: better handling
of large arguments which require encoding, stricter record length
checking, and some performance improvements (completely unverified,
but we got rid of some strlen() calls, that's got to be a good
thing).

As part of the development of this patch, I've also created a basic
regression test for the audit-testsuite, the test can be tracked on
GitHub at the following link:

 * https://github.com/linux-audit/audit-testsuite/issues/25

[1] If you pay careful attention, there is actually a triple fetch
problem due to a strnlen_user() call at the top of the function.

[2] This is a tiny white lie, we do make a call to strnlen_user()
prior to fetching the argument data.  I don't like it, but due to the
way the audit record is structured we really have no choice unless we
copy the entire argument at once (which would require a rather
wasteful allocation).  The good news is that with this patch the
kernel no longer relies on this strnlen_user() value for anything
beyond recording it in the log, we also update it with a trustworthy
value whenever possible.

Reported-by: Pengfei Wang <wpengfeinudt@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Paul Moore <paul@paul-moore.com>
Change-Id: Ie9848961d236739df5014474f2c2a781af9fb811
Git-repo: http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git
Git-commit: 43761473c254b45883a64441dd0bc85a42f3645c
Signed-off-by: Dennis Cagle <d-cagle@codeaurora.org>
2016-11-23 11:33:07 -08:00
Kyle Yan
51ab99448d Merge rel/msm-4.4 on remote branch
Change-Id: Id919aee14aa3898b8168015a3ae310437d604812
Signed-off-by: Kyle Yan <kyan@codeaurora.org>
2016-11-23 11:04:58 -08:00
Jack Pham
e040285056 usb: pd: Support Android dual_role_usb sysfs class
Export an instance of the dual_role_usb class using the
provided helpers. This is an alternate set of sysfs nodes
that the Android framework uses to allow for user
interactive control of role switching.

Writing to the various properties achieves the following:
  - mode: toggles between UFP/Sink and DFP/Source via soft
        disconnect/reconnect without invoking PD.
  - power_role: toggles between Source and Sink modes via
        the PR_Swap operation
  - data_role: toggles between UFP (device) and DFP (host) via
        the DR_Swap operation

Android currently expects a single instance named "otg_default".

Change-Id: I7060b6f379bc8bed24b59d9df4ca2fb331437363
Signed-off-by: Jack Pham <jackp@codeaurora.org>
2016-11-23 10:42:06 -08:00
Venkat Gopalakrishnan
d17e964249 Revert "scsi: ufs: disable ah8 during suspend and enable it on resume"
This reverts commit 33ee9fb701 ("scsi: ufs: disable ah8 during
suspend and enable it on resume"). There is a race condition
between disabling AH8 and HW initiated AH8 enter/exit causing
DME errors on next command transfer. Revert this change until
the issue is fixed.

Change-Id: Iece1266b345a09cae3f8de6b4780340515c19c4a
Signed-off-by: Venkat Gopalakrishnan <venkatg@codeaurora.org>
2016-11-23 10:27:17 -08:00
Manaf Meethalavalappu Pallikunhi
ad267f4ba1 ARM: dts: msm: Add thermal mitigation properties to msmfalcon
Add thermal properties to enable kernel thermal monitoring and
mitigations like hotplug, thermal reset, vdd restriction, etc.
for msmfalcon. Add mitigation profiles for each physical CPU which
has information like sensor to monitor and various mitigation types
to enable for msmfalcon.

Change-Id: I36ca125143cf9929fb0bd781990bdd8ab1dbeebf
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2016-11-23 04:17:30 -08:00
Manaf Meethalavalappu Pallikunhi
d1dfa5145a ARM: dts: msm: Add thermal sensor info for msmfalcon
Add thermal sensor related information, which provides information
such as alias, type and scaling factor to Kernel Thermal Monitor(KTM).
The KTM exposes these sensor information via sysfs to thermal-engine.

Change-Id: Ie564c181db61f6229479a49917cdb9e6c1887fc5
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
2016-11-23 04:17:16 -08:00
Min Chong
93ae6efaf8 input: synaptics_dsx: add checks of user input data
Add checks of the user input count to avoid possible heap overflow

Signed-off-by: Min Chong <mchong@google.com>
Bug: 30937462
Git-repo: https://android.googlesource.com/kernel/msm.git
Git-commit: a6accafb252a76256f11c83e28c556c8ca4b8e1f
Change-Id: I6fc8323cbcf395a2c24e49e65cc7012709d031a2
Signed-off-by: Dennis Cagle <d-cagle@codeaurora.org>
2016-11-23 03:27:01 -08:00
Shay Nachmani
51b8d2c499 msm: ion: Modified Secure Display buffer permissions
Made Secure Display buffer permissions RO instead of RW.

Change-Id: I617a3bb5cbb80ac3967ab14f37452c461bb4df77
Signed-off-by: Shay Nachmani <shayn@codeaurora.org>
2016-11-23 12:04:29 +02:00
Amit Nischal
2014ecf7b2 clk: qcom: Add support to convert the clock rate to KHz
Before sending the RPM clock rate request, rate should
be in KHz so fixing the same by converting the rate
to KHz and also fix some clock ids.

Change-Id: I3fb59f96b419bdb91f9a04cc47ab1c23d15dc74b
Signed-off-by: Amit Nischal <anischal@codeaurora.org>
2016-11-23 14:15:40 +05:30
Neeraj Upadhyay
7bc1693641 soc: qcom: fix uninitialized references in gladiator_erp_v2
Fix uninitialized references in gladiator_erp_v2, reported
by static analysis tool. While at it, log all error registers
for Gladiator error.

Change-Id: If2b81e8b8fd446a07bc92ff23f74cdaa9ed11ff5
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
2016-11-23 10:27:35 +05:30
Manoj Prabhu B
a9a910d7d0 diag: Fix possible access to freed variable
Mdlog structure member - hdlc timer is being accessed after
mdlog session is terminated.
This patch prevents the access to freed variable
by providing session_lock protection.

Change-Id: I1701e57fb4bbb751b76a4f24dc936ac22524e26c
Signed-off-by: Manoj Prabhu B <bmanoj@codeaurora.org>
2016-11-22 20:22:39 -08:00
Oleg Perelet
5efab93887 Revert "msm: kgsl: Enable limits management on A540v2"
This reverts commit 691ddba4ee ("msm: kgsl: Enable limits
management on A540v2"). The GPU does not hit the voltage
limits at 670mhz so there isn't any need to enable
limit management.

CRs-Fixed: 1056661
Change-Id: If225dc4ec2c2e3eb8996f49f4fdf6acd31a50680
Signed-off-by: Oleg Perelet <operelet@codeaurora.org>
2016-11-22 13:18:54 -08:00