msm: mdss: reset pixel extension flag if validation fails

While validating the pixel extension values, reset the pixel
extension flag in case of failure. If this flag is not reset,
driver will programm the wrong configuration into hardware
registers in the commit ioctl.

Change-Id: I6fb90ca331f39e704a8aa915a04b6be776bcff55
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
crypto: msm: check potential integer overflow

According to the specification of AEAD, AEAD request crypt length is
not a fixed maximum and associated length is also same. This could
lead to potential integer overflow, thus allocating less memory. So
we need to check potential integer overflow on AEAD request length.

CRs-Fixed: 726872
Change-Id: Ie7708000bfd8c57e2fba8e02230a7ce9cdc9634c
Signed-off-by: William Clark <wclark@codeaurora.org>
Merge "msm: mdss: reset pixel extension flag if validation fails"
Merge "crypto: msm: check potential integer overflow"
msm: ipc_logging: remove internal details from header

Some internal details no longer need to be shared between modules, so
they can be moved to the main implementation file to avoid unnecessary
coupling in the future.

Change-Id: Ie8774f0c95f5ec6a56a95c57fea79032194eb05e
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
msm: ipc_logging: add client version support

If clients use custom serialization functions, then they may need to
define a version for deserialization support for log extraction.

Add client version support.

Change-Id: Id135f06d4142de39275b5d0caab88708d5496b5e
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
msm: ipc_logging: add locking hierarchy

Add locking hierarchy to allow identification of deadlocks by code
inspection.

Change-Id: I41cd479d72be7b2c729fbf09b5b89180c0a11191
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
msm: ipc_logging: enhance log-extraction support

One of the main goals of the IPC Logging is to allow extracting logs
from memory dumps.  The current implementation has the following
limitations:

  1) if logs are being dumped through debugfs at the time of the crash,
     it is not possible to extract logs that were already dumped

  2) it is not always possible to tell the difference between empty,
     partially full, and full log pages resulting in extraction
     complications

  3) if the system memory is not cleared between reboots, then the same
     log ID and log page may be extracted leading to duplicate log
     pages

Add additional debugfs read index, timestamps for log pages, and change
the read/write indices to easily differentiate between empty, partially
full, and full log pages.

CRs-Fixed: 670345
Change-Id: I695f6e0605f3755b868ede59851f5ca919f8fb0d
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
msm: ipc_logging: reset completion instead of reinitializing

init_completion() is being used to reinitialize the read completion
which will cause problems if complete_all() is ever used.

Use INIT_COMPLETION instead of init_completion() to reinitialize
the completion.

Change-Id: I33a78559d9debb6c90a039bd9f22f391c6c15f27
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
msm: ipc_logging: fix non-destructive read logic

When dumping logs through debugfs, a non-destructive read is performed
and after all data has been printed, the call waits on a completion for
new log data.  When that event is completed, the entire contents of the
logs are incorrectly printed.

Fix the read logic to correctly update the non-destructive read pointer
such that only the new data is printed to the logs.

CRs-Fixed: 681317
Change-Id: Ia12787b576b18b9f5174cefe91eb283979c286f7
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
ipc_logging: Validate the next page pointer

Validate the pointer returned from get_next_page function.

Change-Id: I32d7c0771d116186fffb206335993f6114e303f8
Signed-off-by: Zaheerulla Meer <zmeer@codeaurora.org>
Signed-off-by: Eric Holmberg <eholmber@codeaurora.org>
Merge "msm: ipc_logging: remove internal details from header"
Merge "msm: ipc_logging: add client version support"
Merge "msm: ipc_logging: add locking hierarchy"
Merge "msm: ipc_logging: enhance log-extraction support"
Merge "msm: ipc_logging: reset completion instead of reinitializing"
Merge "msm: ipc_logging: fix non-destructive read logic"
Merge "ipc_logging: Validate the next page pointer"
Merge 357fe4ce1cbe5ed5214afa0ce429e43d92e6b6e6 on remote branch

Change-Id: If84f2e7ad64b92beef2ba9cb8b666e96c454021b
mmc: sdhci-msm: fix issue with tuning command.

As of now we ignore CRC/INDEX command failures to tuning command
and still wait for data from card but in case the card did not
receive the command, it won't send the data. This is causing
software request timeout for tuning commands. Hence, software
must not ignore such cmd errors for tuning commands but end the
request immediately after resetting the controller for both CMD
and DATA. Also, wait for 146 MCLK cycles for card to send out the
data and thus to move to transfer state. Its corresponding phase must
also be considered as bad phase.

CRs-fixed: 625855
Change-Id: Ic8462dd9c67e4f18a3ce73d972591772be8c6d10
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>