Commit graph

589484 commits

Author SHA1 Message Date
Linux Build Service Account
7d78f564eb Merge "input: misc: hbtp_input: filter out fb events" 2017-04-26 18:49:03 -07:00
Anirudh Ghayal
f6f4074ad0 ARM: dts: msm: Enable KPDPWR software debounce for PM660
Enable the SW debounce handling for KPDPWR_N rising edge.

CRs-Fixed: 2032520
Change-Id: Ic099d38abdd7693425d0e2510a0ef8fc52a69b95
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2017-04-27 06:58:23 +05:30
Anirudh Ghayal
dfdb97d8b9 input: qpnp-power-on: Add debounce for KPDPWR_N rising edge
On certain PMICs, an unexpected assertion on KPDPWR_DBC may
be seen during falling edge of KPDPWR_N when it is closer
to the rising edge of SLEEP_CLK. This triggers spurious
KPDPWR interrupts. Handle this by adding a debounce in SW
when the first KPDPWR_N falling edge is seen.

The debounce logic is enabled by the DT property
'qcom,kpdpwr-sw-debounce'.

CRs-Fixed: 2032520
Change-Id: I7655c13bda47fa6e2983650d7bec21e52aa91c2f
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
2017-04-27 06:55:50 +05:30
kunleiz
ba9b1ef0a8 ASoC: msm: qdspv2: add result check when audio process fail
A audio_process_event_req is not always to success. Therefore,
check the return value for audio_process_event_req, and
initializ usr_evt before using it.

CRs-Fixed: 2029798
Change-Id: I4adf682575f5f9233a1a1a533f9c6361af8a5bcf
Signed-off-by: kunleiz <kunleiz@codeaurora.org>
2017-04-26 17:57:45 -07:00
Bhalchandra Gajare
5779144880 ASoC: msm-lsm-client: use kzalloc instead of kmalloc
In the ioctl function, driver allocates memory to store data
internally before calling copy_to_user to copy data to user-space.
It is possible that kernel internal information can be leaked to
user space through this if the allocated memory is not completely
overwritten with valid data. Use kzalloc to fix this.

CRs-fixed: 2026045
Change-Id: I754ae2157034a135aaca4a15badf10d2567b7ed6
Signed-off-by: Bhalchandra Gajare <gajare@codeaurora.org>
2017-04-26 17:29:27 -07:00
Daniel Rosenberg
b878b26010 ANDROID: sdcardfs: Call lower fs's revalidate
We should be calling the lower filesystem's revalidate
inside of sdcardfs's revalidate, as wrapfs does.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 35766959
Change-Id: I939d1c4192fafc1e21678aeab43fe3d588b8e2f4
2017-04-26 16:56:28 -07:00
Daniel Rosenberg
33fddbee41 ANDROID: sdcardfs: Avoid setting GIDs outside of valid ranges
When setting up the ownership of files on the lower filesystem,
ensure that these values are in reasonable ranges for apps. If
they aren't, default to AID_MEDIA_RW

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 37516160
Change-Id: I0bec76a61ac72aff0b993ab1ad04be8382178a00
2017-04-26 16:56:27 -07:00
Daniel Rosenberg
46d925efcc ANDROID: sdcardfs: Copy meta-data from lower inode
From wrapfs commit 3ee9b365e38c ("Wrapfs: properly copy meta-data after
AIO operations from lower inode")

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 35766959
Change-Id: I9a789222e27a17b8d85ce61c45397d1839f9a675
2017-04-26 16:56:27 -07:00
Daniel Rosenberg
b4840d3bba Revert "Revert "Android: sdcardfs: Don't do d_add for lower fs""
This reverts commit ffa75fdb9c408f49b9622b6d55752ed99ff61488.

Turns out we just needed the right hash.

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 37231161
Change-Id: I6a6de7f7df99ad42b20fa062913b219f64020c31
2017-04-26 16:56:26 -07:00
Daniel Rosenberg
0f3b6e26eb ANDROID: sdcardfs: Use filesystem specific hash
We weren't accounting for FS specific hash functions,
causing us to miss negative dentries for any FS that
had one.

Similar to a patch from esdfs
commit 75bd25a9476d ("esdfs: support lower's own hash")

Signed-off-by: Daniel Rosenberg <drosen@google.com>
Change-Id: I32d1ba304d728e0ca2648cacfb4c2e441ae63608
2017-04-26 16:56:25 -07:00
David Zeuthen
b40bc405c2 ANDROID: AVB error handler to invalidate vbmeta partition.
If androidboot.vbmeta.device is set and points to a device with vbmeta
magic, this header will be overwritten upon an irrecoverable dm-verity
error. The side-effect of this is that the slot will fail to verify on
next reboot, effectively triggering the boot loader to fallback to
another slot. This work both if the vbmeta struct is at the start of a
partition or if there's an AVB footer at the end.

This code is based on drivers/md/dm-verity-chromeos.c from ChromiumOS.

Example:

 [    0.000000] Kernel command line: rootfstype=ext4 init=/init console=ttyS0,115200 androidboot.console=ttyS0 androidboot.hardware=uefi_x86_64 enforcing=0 androidboot.selinux=permissive androidboot.debuggable=1 buildvariant=eng dm="1 vroot none ro 1,0 2080496 verity 1 PARTUUID=6779df46-78f6-4c69-bf53-59bb1fbf126b PARTUUID=6779df46-78f6-4c69-bf53-59bb1fbf126b 4096 4096 260062 260062 sha1 4f76354c86e430e27426d584a726f2fbffecae32 7e4085342d634065269631ac9a199e1a43f4632c 1 ignore_zero_blocks" root=0xfd00 androidboot.vbmeta.device=PARTUUID=b865935d-38fb-4c4e-b8b4-70dc67321552 androidboot.slot_suffix=_a androidboot.vbmeta.device_state=unlocked androidboot.vbmeta.hash_alg=sha256 androidboot.vbmeta.size=3200 androidboot.vbmeta.digest=14fe41c2b3696c31b7ad5eae7877d7d188995e1ab122c604aaaf4785850b91f7 skip_initramfs
 [...]
 [    0.612802] device-mapper: verity-avb: AVB error handler initialized with vbmeta device: PARTUUID=b865935d-38fb-4c4e-b8b4-70dc67321552
 [...]
 [    1.213804] device-mapper: init: attempting early device configuration.
 [    1.214752] device-mapper: init: adding target '0 2080496 verity 1 PARTUUID=6779df46-78f6-4c69-bf53-59bb1fbf126b PARTUUID=6779df46-78f6-4c69-bf53-59bb1fbf126b 4096 4096 260062 260062 sha1 4f76354c86e430e27426d584a726f2fbffecae32 7e4085342d634065269631ac9a199e1a43f4632c 1 ignore_zero_blocks'
 [    1.217643] device-mapper: init: dm-0 is ready
 [    1.226694] device-mapper: verity: 8:6: data block 0 is corrupted
 [    1.227666] device-mapper: verity-avb: AVB error handler called for PARTUUID=b865935d-38fb-4c4e-b8b4-70dc67321552
 [    1.234308] device-mapper: verity-avb: invalidate_vbmeta: found vbmeta partition
 [    1.235848] device-mapper: verity-avb: invalidate_vbmeta: completed.
 [...]

Bug: 31622239
Test: Manually tested (other arch).
Change-Id: Idf6be32d6a3d28e15de9302aa26ad6a516d663aa
Signed-off-by: David Zeuthen <zeuthen@google.com>
Git-commit: 8d6f006d60
Git-repo: https://android.googlesource.com/kernel/common/
[runminw@codeaurora.org: resolve trivial merge conflicts]
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2017-04-26 13:33:51 -07:00
David Zeuthen
330da40c21 ANDROID: Update init/do_mounts_dm.c to the latest ChromiumOS version.
This is needed for AVB integration work.

Bug: 31796270
Test: Manually tested (other arch).
Change-Id: I32fd37c1578c6414e3e6ff277d16ad94df7886b8
Signed-off-by: David Zeuthen <zeuthen@google.com>
Git-commit: 6a6a7657c2
Git-repo: https://android.googlesource.com/kernel/common/
Signed-off-by: Runmin Wang <runminw@codeaurora.org>
2017-04-26 13:33:24 -07:00
Jordan Crouse
d84fd15df0 msm/drm: Move msm_drm_config configuration into the GPUs
With the upcoming secure code the decision tree for configuration
(deciding where virtual addresses start/stop, etc) is going to get
a bit more complex. Head issues off at the pass by moving the
configuration into the GPU specific code.  This does result in a
bit more code duplication but it is a lot cleaner.

Change-Id: Ic0dedbad57c11a4bba01825214d0a7853ab537ba
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2017-04-26 12:08:10 -06:00
Jordan Crouse
8e00aa10d2 msm/drm: Add secure support to GPU IOMMU
Add support for creating a secure domain in the GPU IOMMU. By default
the secure domain is bound to context bank name "gfx3d_secure".

Change-Id: Ic0dedbad19f69ec4175624dc80f2114bfda2e195
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2017-04-26 12:08:09 -06:00
Jordan Crouse
0bea8c919a drm/msm: Remove iommu names during attach
None of the existing iommu implementations use the names passed in
at attach time by the API. Save a bit of .data room by removing
the static string definitions and passing NULL to the attach function.

Change-Id: Ic0dedbada9561768b8d9716ea101619e6b549ea4
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2017-04-26 12:08:09 -06:00
Jordan Crouse
f0eb0ed585 drm/msm: Add enable/disable hooks for mmu
5XX targets that are using per-process pagetables will need to
keep the IOMMU clocks on the entire time because we don't know
exactly when the GPU might touch it.  That said there are
occassional depencency issues if the clocks are enabled out
of order.  To be certain we should enable the MMU clocks last
and disable them first.  Add enable/disable hooks to the MMU
struct to do this cleanly from the GPU pm_resume / pm_suspend
paths.

Change-Id: Ic0dedbad8e2298e55c90b29eed657baa0933ddcf
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2017-04-26 12:08:08 -06:00
Jordan Crouse
4e061d8b60 drm/msm: Refactor GPU IOMMU
Very soon we will be adding support for secure domains and so a bit of
refactoring is needed the GPU IOMMU code:

 * Add support for directly probing the context bank device at create
instead of at attach. This makes it a little bit easier to directly
associate a mmu device with a specific context bank.

 * Specify the domain type at create time. Add a new domain type
MSM_DOMAIN_USER to associate the user domain with the gfx3d_user
context bank.  Also add MSM_DOMAIN_DEFAULT with no context bank
for legacy devices (read MDP4) with only one context bank
to attach to the parent device. Adding a domain type saves us from
having to create N entry points for each domain type.

Note that dynamic domains stay with their own initalization function.
This is because dynamic domains are cloned from the parent domain
so the semantics are too different to try to smash into the generic
functions.

Change-Id: Ic0dedbad41692e776cddc72cda653ae637f9ec77
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2017-04-26 12:08:07 -06:00
Jordan Crouse
1576b22ae9 drm/msm: Finish consolidating the address space code
Now that the SMMU/IOMMU differences have been resolved the only delta
between the SMMU and the IOMMU address space implementations is the
actual address space allocation which we can work around by assuming
the caller doesn't want address generation if they specify the same
start and end address (i.e. 0).

With that optimization we can get rid of the address space
sub functions and a bunch of otherwise duplicated code.

Change-Id: Ic0dedbaddef0fcd3a8f39e30f95c71245d84f111
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2017-04-26 12:08:06 -06:00
Jordan Crouse
438cdcdae0 drm/msm: Get rid of the MMU ->map_dma_buf and ->unmap_dma_buf funcs
Finish consolidating the MMU map and unmap operations into a single
function. By passing in the meta token to map/unmap the specific
SMMU operations can make a local decision as to which function to
call.

Change-Id: Ic0dedbad52aac6ed1317411b2667755794d1818f
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2017-04-26 12:08:06 -06:00
Jordan Crouse
82fbc52e90 drm/msm: Consoldate mmu ->map and mmu ->map_sg
For all intents and purposes the mmu ->map function has used a
scatter gather list for some time. Drop the pretense and just
make both the SMMU and IOMMU flavors use the sg flavor of their
respective iommu API functions. As a result we can drop the
map_sg hooks in the SMMU driver and get rid of a considerable
amount of re-invented wheels in the IOMMU driver.

Change-Id: Ic0dedbadc4724c8ae389892fb85610435c5c08cf
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2017-04-26 12:08:05 -06:00
Jordan Crouse
7af30a44e9 drm/msm: Set IOMMU flags in the IOMMU specific code
Pass the bo flags all the way down to the iommu map code and
translate into the IOMMU flags right before mapping. This crosses the
streams a bit by moving BO level knowledge all the way down into the
MMU driver but it removes IOMMU specific knowledge from the address
space level which will be important when the address space code for
the GPU and the display are merged into one.

Change-Id: Ic0dedbad256f8986658bbe50fc2e2bd4051b7a7c
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2017-04-26 12:08:04 -06:00
Dan Carpenter
b54b359084 drm/msm: return -EFAULT if copy_from_user() fails
copy_from_user_inatomic() is actually a local function that returns
-EFAULT or positive values on error.  Otherwise copy_from_user() returns
the number of bytes remaining to be copied.  We want to return -EFAULT
here.

I removed an unlikely() because we just did a copy_from_user()
so I don't think it can possibly make a difference.

Change-Id: Ic0dedbad3437020c12053b6d93276a4dd24a577a
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Git-commit: 21c42da18ef128ca8fb4cc4ead888f5c61e3916a
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
[jcrouse@codeaurora.org: fix minor merge conflict and checkpatch errors]
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2017-04-26 12:07:57 -06:00
Jordan Crouse
095e8c4885 drm/msm: Safely skip holes in the counter group lists
For backwards compatibility the counter group list has some built
in gaps that return NULL when queried.  Make sure that all the
functions that query the list are able to handle a NULL pointer.

Change-Id: Ic0dedbadd10ccf3a3b9b1f1b035a46a4f7ee8493
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2017-04-26 10:18:02 -06:00
Jordan Crouse
00ca56e448 ARM: dts: msm: Remove I/O coherence for the GPU
I/O coherence has some limitations that make it less preferable than
the usermode cache operations.  Given these limitations the user mode
driver teams have requested that I/O coherence be disabled.

Change-Id: Ic0dedbadbc10b3a6239e20df8b527a5738a1a3a4
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2017-04-26 10:18:01 -06:00
Jordan Crouse
f567fc12bf drm/msm: Add explicit sync operations
Add sync operations to give the user more control
over the behavior of cached buffers.

Change-Id: Ic0dedbad67e19a6b30b2cc5f6b2c7bbe52c2b708
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
2017-04-26 10:17:55 -06:00
Linux Build Service Account
b1980b6bfe Merge "msm: camera: isp: Enable recovery for stats in out of sync case" 2017-04-26 06:33:53 -07:00
Linux Build Service Account
5c863c42bf Merge "btfm: set watermark level to 3 for wcn3990 slimbus FM slave ports" 2017-04-26 06:33:52 -07:00
Linux Build Service Account
d6448aef73 Merge "esoc: remove reduntant return_esoc_udev() fn call" 2017-04-26 06:33:51 -07:00
Linux Build Service Account
e92c6a2322 Merge "defconfig: msm: Enable cache dump and common log in perf build" 2017-04-26 06:33:50 -07:00
Linux Build Service Account
4d68ab6fd6 Merge "power: qpnp-fg-gen3: configure ESR FCC based on Qnovo enable status" 2017-04-26 06:33:49 -07:00
Linux Build Service Account
1399da4328 Merge "msm: camera: Fix kernel overwrite GET_BUF_BY_IDX ioctl" 2017-04-26 06:33:48 -07:00
Linux Build Service Account
f8f13e5308 Merge "Revert "soc:qcom: Synchronize service notifier task's"" 2017-04-26 06:33:47 -07:00
Linux Build Service Account
fa3c35e909 Merge "ASoC: msm: qdsp6v2: Add support for speaker swap" 2017-04-26 06:33:45 -07:00
Linux Build Service Account
f4300126c7 Merge "Revert "spi: spi_qsd: Check device state during set_cs call"" 2017-04-26 06:33:44 -07:00
Utkarsh Saxena
938946fef0 msm: ipa: Add mutext protection when updating notify req cache
IOCTL interface to send QMI NOTIFY REQ messages can be called
from multiple contexts which can result into buffer overflow of
msg cache. Make a change to add mutext protection to prevent
buffer overflow.

Change-Id: Ib6d879e29971ae40398a9dc8759fb4dbbf166429
Acked-by: Chaitanya Pratapa <cpratapa@qti.qualcomm.com>
Signed-off-by: Utkarsh Saxena <usaxena@codeaurora.org>
2017-04-26 17:30:11 +05:30
Lokesh Kumar Aakulu
2fac5aa034 msm: camera: isp: Enable recovery for stats in out of sync case
When the stats go out of sync across the 2 VFEs, don't treat it
as a fatal error but allow for recovery.

Change-Id: I5ef16b3e823cec9698d3ee0627335653f13fd60d
Signed-off-by: Lokesh Kumar Aakulu <lkumar@codeaurora.org>
2017-04-26 03:48:09 -07:00
Ashay Jaiswal
d1f5c07537 power: smb-lib: Fix charger type reporting
Charger type gets updated in 'smblib_update_usb_type' function
and this should only be called after completion of APSD.
Update the calling sites of 'smblib_update_usb_type' to use
'smblib_get_apsd_result' instead of 'smblib_update_usb_type'.
This ensures charger type doesn't get updated inadvertently.

CRs-Fixed: 2038837
Change-Id: Iaa380c8f02bb71ad0f4367c16ec39d86d825dfa2
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>
2017-04-26 15:32:33 +05:30
Utkarsh Saxena
36dfd73961 msm: ipa: Fix race condition between shared memory
Protect the common shared wlan_comm_desc_list with
spin lock to avoid the race condition.

Change-Id: I02ef6c6b663340711e0e2f766424d642aaa8d7af
Acked-by: Mohammed Javid <mjavid@qti.qualcomm.com>
Signed-off-by: Utkarsh Saxena <usaxena@codeaurora.org>
2017-04-26 15:06:09 +05:30
Jiangen Jiao
84d92213bc ARM: dts: msm: Add QRD device nodes for HDK660/630 boards
Add device tree support for QRD HDK660, HDK630 boards.

Change-Id: I65e7537f2ae0e7d04ccab11342925e0457f4198b
Signed-off-by: Jiangen Jiao <jiangenj@codeaurora.org>
2017-04-26 01:55:26 -07:00
Rupesh Tatiya
6737311d22 btfm: set watermark level to 3 for wcn3990 slimbus FM slave ports
Without this, we hear silence or delay in sound during FM playback in
following use cases -
1. Switching between FM and media applications like YouTube
2. Changing volume during FM FTM

Change-Id: I51072ab70e6bc34e1ed10222ee289d987ed9ffbf
Signed-off-by: Rupesh Tatiya <rtatiya@codeaurora.org>
2017-04-26 13:19:14 +05:30
Neeraj Upadhyay
cf3e50f158 tty: serial: msm: Move request_irq to the end of startup
Move the request_irq() call to the end of the msm_startup(),
so that we don't handle interrupts while msm_startup() is
running. This avoids potential races while initialization
is in progress. For example, consider below scenario
where rx handler reads the intermediate value of dma->chan,
set in msm_request_rx_dma(), and tries to do dma mapping,
which results in data abort.

uart_port_startup()
  msm_startup()
   request_irq()
   ...
   msm_request_rx_dma()
    ...
    dma->chan = dma_request_slave_channel_reason(dev, "rx");
    <UART RX IRQ>
     msm_uart_irq()
      msm_handle_rx_dm()
       msm_start_rx_dma()
        dma->desc = dma_map_single()
         <data abort>


Change-Id: I94113fe1ebe400f9bb0113922ebc5d257124e34a
Signed-off-by: Neeraj Upadhyay <neeraju@codeaurora.org>
2017-04-26 13:18:01 +05:30
Yunyun Cao
35ae76d273 drm: msm: dsi: add dsi device to tail of display list instead
DSI display list sequence should be consistent with device tree, so use
list_add_tail instead of list_add to insert dsi devices.

Change-Id: I11d14d663c59c8ee0d1da280f42d9315e12c2a65
Signed-off-by: Yunyun Cao <yunyunc@codeaurora.org>
2017-04-25 23:47:39 -07:00
Mohammed Khajapasha
cd52d68bef esoc: remove reduntant return_esoc_udev() fn call
Remove reduntant return_esoc_udev() function call
while deleting a esoc device from an esoc clink.

Change-Id: Id2e812addb1bd8af0e23c4182427adbee9731a58
Signed-off-by: Mohammed Khajapasha <mkhaja@codeaurora.org>
2017-04-26 11:19:40 +05:30
Trishansh Bhardwaj
fa5ee0d284 msm: camera: Fix kernel overwrite GET_BUF_BY_IDX ioctl
Assign address of buf_info into ioctl_ptr.
Previously we were copying first 8 bytes of buf_info (content)
into ioctl_ptr. Which is dereferenced and written later causing
kernel overwrite vulnerability.

Change-Id: Ie5deae249da8208523027f8ec5632f960757e9bd
Signed-off-by: Trishansh Bhardwaj <tbhardwa@codeaurora.org>
2017-04-25 22:31:58 -07:00
Hareesh Gundu
c1540a6bfe msm: kgsl: Perform cache operation with kernel address
Kernel should never access untrusted pointers directly.
If the address is not mapped to kernel, map to kernel
address space and perform cache related operation.

Change-Id: I433befcde620e51b8ec17954ddb710f6084e0592
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
2017-04-26 11:00:09 +05:30
Linux Build Service Account
d8af252b93 Merge "msm: mdss: wait for pp done when switching from ON to LP1" 2017-04-25 21:48:58 -07:00
Linux Build Service Account
ce6271aa37 Merge "ath10k: enable wlan hardware checksum for wcn3990" 2017-04-25 21:48:57 -07:00
Linux Build Service Account
ded611df05 Merge "clk: qcom: Add support for throttle clocks for clients" 2017-04-25 21:48:56 -07:00
Linux Build Service Account
cf53577f5f Merge "msm: kgsl: Allow draw context to perform only replay on recovery" 2017-04-25 21:48:55 -07:00
Linux Build Service Account
22c29693e8 Merge "iommu: disable smmu stalls on faulty transactions" 2017-04-25 21:48:53 -07:00