msm: camera: Update IO memory access ordering

Changed the regular readl, writel to xxx__relaxed. Updated the
code for using memory barriers at relevant places.

Change-Id: I4f7b1b1f416c002459c34c006a13fa519d17e7a7
Signed-off-by: Sunid Wilson <sunid@codeaurora.org>
msm: camera: Fix the broken MCE functionality

Corrected the offset values for MCE registers

Change-Id: I41c5baaf90b294506234c1e69b919c5283abef59
CRs-Fixed: 278920
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
msm: camera: Fix snapshot failure issue for multi-frame capture

Update the code to send reg update for all snapshot
frames. This updates the capture count properly and sends
the SNAPSHOT_DONE msg to camera driver.

Change-Id: I16ad0c829709042ec4a0b5da57c27d3146b241a3
Signed-off-by: Sunid Wilson <sunid@codeaurora.org>
msm: camera: VFE free buffer queue implementation for multishot

Implemented free buffer queue for each output. This will
allow to store multiple buffers in kernel.

Change-Id: I2650821dccde4fadd32c26f9ac468febee073032
Signed-off-by: Sunid Wilson <sunid@codeaurora.org>
msm: camera: Fix for pmem lookup error due to buffer mismatch

Read the ping pong status of the hardware in ISR rather
then while executing the tasklet.

CRs-Fixed: 282473
CRs-Fixed: 277971

Signed-off-by: Nagesh Subba Reddy <nageshsreddy@codeaurora.org>
(cherry picked from commit 3883f584e3a2f383d12abb185fc092a86fb23008)

Change-Id: Iee3b252613da67d14e58a391736c625592666c07
Signed-off-by: Shruthi Krishna <skrish@codeaurora.org>
kgsl: More updates from ics_chocolate...
msm_fb: display: fix incorrect MDP formats components unpack pattern

Many of MDP input formats don't have correct unpack pattern, so image
displayed on screen is not in the actual format set.

CRs-fixed: 339114,337040
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
(cherry picked from commit c5638f898324df37e40e402d208b0e97337d536b)

Change-Id: I66a404db039502d0511cd3d7dc34e81c0eca1d61
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm_fb: display: Add YV12 support in the MDP

Added changes to support YV12 input format in the MDP.

Change-Id: Id8344af1a1607cbf4a6c01ad35441bbdd4fcbd49
Signed-off-by: Pradeep Jilagam <pjilagam@codeaurora.org>
msm_rotator: Bulk update for compatibility with current CM code
2.9
msm_rotator: add rotator ref count to cleanup code

Perform cleanup of rotator sessions only if reference count reaches 0,
this avoids closing rotator sessions from sibling threads.

Change-Id: I83add90cc04faa90c372dde09a096c7a07be528a
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
(cherry picked from commit cea80ac8448ded8bbba56f1eb219857526270874)

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: rotator: update user session parameters for all rotator start calls

Session parameters hold the dst format of rotator output, this is
currently passed to userspace only on new session, if session is reused
with different format session not updated and can cause incorrect
display output configuration.

CRs-Fixed: 349903
Change-Id: I5dd3f277b0d5fac145c805f4898c799ef4fb1b94
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
(cherry picked from commit c56399542e5a015f2f10cdc443365167a5f17f2a)
Little performance improvement for slub memory allocator
jbd2: clear BH_Delay & BH_Unwritten in journal_unmap_buffer

commit 15291164b22a357cb211b618adfef4fa82fc0de3 upstream.

journal_unmap_buffer()'s zap_buffer: code clears a lot of buffer head
state ala discard_buffer(), but does not touch _Delay or _Unwritten as
discard_buffer() does.

This can be problematic in some areas of the ext4 code which assume
that if they have found a buffer marked unwritten or delay, then it's
a live one.  Perhaps those spots should check whether it is mapped
as well, but if jbd2 is going to tear down a buffer, let's really
tear it down completely.

Without this I get some fsx failures on sub-page-block filesystems
up until v3.2, at which point 4e96b2dbbf1d7e81f22047a50f862555a6cb87cb
and 189e868fa8fdca702eb9db9d8afc46b5cb9144c9 make the failures go
away, because buried within that large change is some more flag
clearing.  I still think it's worth doing in jbd2, since
->invalidatepage leads here directly, and it's the right place
to clear away these flags.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit e4f7c341d6c6a78830dc918b23157ccfc399d397)
ext4: ignore EXT4_INODE_JOURNAL_DATA flag with delalloc

commit 3d2b158262826e8b75bbbfb7b97010838dd92ac7 upstream.

Ext4 does not support data journalling with delayed allocation enabled.
We even do not allow to mount the file system with delayed allocation
and data journalling enabled, however it can be set via FS_IOC_SETFLAGS
so we can hit the inode with EXT4_INODE_JOURNAL_DATA set even on file
system mounted with delayed allocation (default) and that's where
problem arises. The easies way to reproduce this problem is with the
following set of commands:

 mkfs.ext4 /dev/sdd
 mount /dev/sdd /mnt/test1
 dd if=/dev/zero of=/mnt/test1/file bs=1M count=4
 chattr +j /mnt/test1/file
 dd if=/dev/zero of=/mnt/test1/file bs=1M count=4 conv=notrunc
 chattr -j /mnt/test1/file

Additionally it can be reproduced quite reliably with xfstests 272 and
269. In fact the above reproducer is a part of test 272.

To fix this we should ignore the EXT4_INODE_JOURNAL_DATA inode flag if
the file system is mounted with delayed allocation. This can be easily
done by fixing ext4_should_*_data() functions do ignore data journal
flag when delalloc is set (suggested by Ted). We also have to set the
appropriate address space operations for the inode (again, ignoring data
journal flag if delalloc enabled).

Additionally this commit introduces ext4_inode_journal_mode() function
because ext4_should_*_data() has already had a lot of common code and
this change is putting it all into one function so it is easier to
read.

Successfully tested with xfstests in following configurations:

delalloc + data=ordered
delalloc + data=writeback
data=journal
nodelalloc + data=ordered
nodelalloc + data=writeback
nodelalloc + data=journal

Signed-off-by: Lukas Czerner <lczerner@redhat.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit df3c660b5745e71665270141ced3fff82a4b0aa6)

Conflicts:

	fs/ext4/ext4_jbd2.h
ext4: check for zero length extent

commit 31d4f3a2f3c73f279ff96a7135d7202ef6833f12 upstream.

Explicitly test for an extent whose length is zero, and flag that as a
corrupted extent.

This avoids a kernel BUG_ON assertion failure.

Tested: Without this patch, the file system image found in
tests/f_ext_zero_len/image.gz in the latest e2fsprogs sources causes a
kernel panic.  With this patch, an ext4 file system error is noted
instead, and the file system is marked as being corrupted.

https://bugzilla.kernel.org/show_bug.cgi?id=42859

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

(cherry picked from commit 471320c7569290aeed04f9c730d92b67b9acb53d)
Remove BUGVERBOSE - francofrancisco
Reach deeper C idle states faster. From imoseyon.
Revert "in the beginning"

This reverts commit 02e4037b4613e579d35ba2ee544a42eeda2f178e.