gpu: ion: Request highmem pages for IOMMU heap

When allocating pages for IOMMU heap it is advantageous
to try to allocate pages from highmem in addition to
lowmem since clients using the IOMMU heap can use
either highmem or lowmem.

CRs-fixed: 430457
Change-Id: Ifc794fc344c67dd53d8f7cebf86536ab9d44ed6c
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
gpu: ion: Use writecombine for uncached mappings

When we map ion buffers as uncached we want to map them as
uncached but still be able to use buffering of transactions
since turning off buffering has a severe performance impact.

Change-Id: I5a09ac34bd3ce3f001d10d9efd71d140f632564d
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
ASoC: wcd9xxx: Fix the ANC CnP

Add virtual ANC widgets which are used to enable ANC
before PA is turned on, and to disable ANC before TX is
turned off.

CRs-fixed: 387904
Change-Id: I8c2fa670062f1486499c79653a2c223f7daba84f
Signed-off-by: Damir Didjusto <damird@codeaurora.org>
msm: kgsl: Add context reference counting to KGSL events

Add reference counting to all KGSL events since they are dependent
on the context.  This avoids a race condition where the context
could be destroyed while the events are being processed during cleanup.

CRs-fixed: 438134
Change-Id: Ic2cd484d441e4c392ab63b0a0131accaceafc711
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
msm_fb: display: check bus scale handler for registration

mdp bus client could be registered multiple times without the check.

Change-Id: I582741c75e815873357e62bc9bf0ff61a4cecf9f
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: Calibration config API

Add definition for struct to be used in post processing calibration API.
Needed by OEM calibration tool to provide better support of post processing
features.

Change-Id: I40760a85bb58730bfe64469ecf3e2ab3b6e7609e
Signed-off-by: Carl Vanderlip <carlv@codeaurora.org>
(cherry picked from commit e8ed5ec0bd9fd5b298464b7f08b5807afa3291a8)
Revert "msm: cache_erp: Handle recoverable L1 errors"

This reverts commit 06cc95a19302cfa2240a1d728493bd22dfe9a418.

Change-Id: I4bcc1d3b863637f98197e119d0dd0865f2e33d24
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: rotator: clear rotator bus scale handler

rotator bus client will be not registered again without handler reset.

Change-Id: Id35c4e5ad481d0a4401bdb3ee4628ffa9a891467
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
usb: ehci-msm2: Fix controller autosuspend

When the EHCI controller is removed using platform_device_del(),
the PM disable_depth counter is decremented once by the driver
core. Thus the driver's remove callback additionally calling
pm_runtime_disable() is leading to an unbalanced counter since
pm_runtime_enable() call happens only once when platform_device_add()
calls the probe callback. Fix this by removing the extraneous
pm_runtime_disable().

Change-Id: Ie76256ac50ba65022814285bf57feca109f79d6b
Signed-off-by: Jack Pham <jackp@codeaurora.org>
usb: ehci-msm2: Fix unbalanced clock warning

The EHCI controller may be in suspend state in which its clocks
are already disabled. Fix warning given by clock subsystem when
disabling the clocks a second time when the controller's platform
device is removed by first checking if the device is suspended.

Change-Id: I3c491d0db11cc172d0e6779042c04fc726936b36
Signed-off-by: Jack Pham <jackp@codeaurora.org>
msm_fb: display: get mipi frame rate from panel file

If frame rate value for mipi video panel is coded in panel file it can
be directly used to avoid calculation error.

Change-Id: I6ad86226c81da4bcf36196385f9ff4bea0bef0ca
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
block: blk-merge: don't merge the pages with non-contiguous descriptors

blk_rq_map_sg() function merges the physically contiguous pages to use same
scatter-gather node without checking if their page descriptors are
contiguous or not.

Now when dma_map_sg() is called on the scatter gather list, it would
take the base page pointer from each node (one by one) and iterates
through all of the pages in same sg node by keep incrementing the base
page pointer with the assumption that physically contiguous pages will
have their page descriptor address contiguous which may not be true
if SPARSEMEM config is enabled. So here we may end referring to invalid
page descriptor.

Following table shows the example of physically contiguous pages but
their page descriptor addresses non-contiguous.
-------------------------------------------
| Page Descriptor    |   Physical Address |
------------------------------------------
| 0xc1e43fdc         |   0xdffff000       |
| 0xc2052000         |   0xe0000000       |
-------------------------------------------

With this patch, relevant blk-merge functions will also check if the
physically contiguous pages are having page descriptors address contiguous
or not? If not then, these pages are separated to be in different
scatter-gather nodes.

(cherry picked from commit 6e25ce37a4f5750467f7c741b549687ebbc10667)

CRs-Fixed: 392141
Change-Id: I3601565e5569a69f06fb3af99061c4d4c23af241
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
msm: board-8930: add gpio-controlled backlight function

The function pointer is passed to driver to turn on/off backlight to
avoid garbage display.

(cherry picked from commit a07d78743024144158a7b2cc0c194ae75e9b6bea)

CRs-fixed: 408728
Change-Id: Ibb218246bd3414b7004289e5afd0594a186374f1
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm_fb: display: add setting gpio-controlled backlight logic

For the panels which backlight is controlled by gpio, add this logic
in driver to turn on/off backlight, instead of calling board panel
on/off functions, to avoid garbage display due to early backlight
turn-on.

(cherry picked from commit 3eebb2e33570e32d11a757e493e12a8e79e08d6f)

CRs-fixed: 408728
Change-Id: I6f1b9bd78d96dbf1492e854edd59b05f8dec205f
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: bam_dmux: revert the skb state when memory allocation fails

bam_dmux_write() function modifies the state of a skb via skb_push(), but
if a later allocation fails, the state of the skb is not reverted to the
pre skb_push() state.

The error returned to the caller as a result of the allocation failure gets
propagated to the TCP/IP framework, which re-schedules a retry of the skb
at a later time.  if enough retries occur due to allocation failures,
causes the assertion in skb_push() to fail.

If a later allocation fails, revert the skb buffer state to pre skb_push()
by calling skb_pull().

(cherry picked from commit 381cd549fd0176c649d1579f56b7504aa94df9be)

CRs-Fixed: 441277
Change-Id: If33e13f00ced164d174ce2c7d9d29762abafa720
Signed-off-by: Arun Kumar Neelakantam <aneela@codeaurora.org>
Revert "power: pm8921-charger: change BOOT_DONE configuration"

This reverts commit b157ff75f967cc72c51f6eae3feaa6ba7a432c87.

Enabling BOOT_TIMER may cause an inadvertent shutdown in the subsequent
boot cycle for certain valid scenarios. Do not enable this bit.

(cherry picked from commit 953e63d6cda58957d5e34ff6c43c651f13bb04bb)

CRs-Fixed: 434578
Change-Id: I0d657c2e0d47af32cc35cd66b902be72952e5438
Signed-off-by: Anirudh Ghayal <aghayal@codeaurora.org>
msm_fb:display: correct bus bw for downscale case

The check condition for updating bus bandwidth if downscaling is
needed was always FALSE.

Change-Id: Iec0a4d13c7737d86976d76e0dfd3ec45062799fd
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
msm: board-8930: Keep the GPU power rail on when display is on

Do not allow the GPU to go into SLUMBER while the display is still
on. This fixes issues seen on 8930 when this feature is enabled.

Change-Id: I8c76d1297c2215987bdd493cb9f04d45d9ec87dc
Signed-off-by: Lynus Vaz <lvaz@codeaurora.org>
msm: kgsl: Avoid NULL pointer in adreno setstate functions

Make sure the specified context_id returns a valid context
in adreno_gpummu_setstate and adreno_iommu_setstate and
silently return if it doesn't.

CRs-Fixed: 439367
Change-Id: Ic0dedbad1a91b53f19782b50380bd36842614351
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: power: Revert LGE power patches

Revert the following customer changes in order to clean up this
branch.

This reverts commit 33ddf5a9eaa031c00b00846458f2ba534e6807b8.
This reverts commit f17df2402b795faf2c03de6d8a5b12378674f3be.
This reverts commit 0a488464c03806e1f775c35d7b2c83650eaab4ef.
This reverts commit 23d2a7cd02b081e1cf2578c02b7ecd3a65319d4e.
This reverts commit 90e32fa7cb701d922825e40b82b566e4af843ea2.
This reverts commit 7346d0fbd3c338d55330766e0f1867f19b364fed.
This reverts commit eb59bf66db9f2ca6e79552f4f72aa56f8c6abd27.
This reverts commit 9c56de000bb2390191fa2ddaea738e6d3e8f5d4f.
This reverts commit 7a72ca62c3f64c7b914edd8d9dbb75933b3c845e.
This reverts commit 76048dac5085eca4459ee5ea5dd4876a1f518cfa.
This reverts commit bfafe7ec7cdeef5b44b32f9aa6ee03beba2020e0.
This reverts commit e346f7a7b8ead1bbb106f4eb1e766c49407bffde.
This reverts commit 1265899c012a463cb0521ed73f2abe057692a9db
This reverts commit 1ff608a341b87defa586ca4a24d0bd89abfdfbb3
This reverts commit 5f030effc8c1af159ad13e77d4c169f037d6c9e4.
This reverts commit 19c87ddde66fd6aad61a60e466a75af235fca7f9.
This reverts commit 905eac978c30c96c5d12a81c1f6968d8c57a645f.
This reverts commit 1bd7c8643cdd8fdc7cf649ec465cc454315a6753.
This reverts commit 69f1730e0d249bad3b4f0fc0f94d917c16c3df19.
This reverts commit 2073afb7ee8b3f80f1f3184bd7ac99ead581adee
This reverts commit 8126554cf049d13f4dd2d815d86ea289efdc6f3a.
This reverts commit 45ccbb53cfc227fd3811e71b0bd813432c96ee9e
This reverts commit 325995993eb806285a35381e803ed5432fe5a93a.
This reverts commit 84cf5a3959bcf412c4b48f8a29b8255c18602d1b.
This reverts commit 839d5a50c761787ded6b8558fa37696be81196fe.
This reverts commit d4b1fb57463d04aeca5ae9bfd2181faa016f97c2.
This reverts commit 2ab04b0deb912a5a52899a50ced73e36974a6a00.
This reverts commit 3a3de0ee621625c8767e0d3c7106c52fcf834499.
This reverts commit f278add027723a90b11c9a97f6d1b09c1aaec795.
This reverts commit 1a749b700752efcc8d832f7b83554df2771dce53.

Change-Id: I21863586360b6bc57dd6d631c34725bea963cffa
Signed-off-by: Xiaozhe Shi <xiaozhes@codeaurora.org>