Revert "msm: Revert modem drivers to Google MR2"

This reverts commit 67816d8230564d9e9a161836544db8e6162fff63.
Revert "ipc_logging: Validate the next page pointer"

This reverts commit 5298df6acd48a85a8f22135e999abc5312f8cc4b.
Revert "msm: ipc_logging: fix non-destructive read logic"

This reverts commit a973c14d5212fa971624a141fefe757f69115a7a.
Revert "msm: ipc_logging: reset completion instead of reinitializing"

This reverts commit 7f4bd2bf10a1c8bf6d81e74c44b4b49f09fadbe5.
Revert "msm: ipc_logging: enhance log-extraction support"

This reverts commit fd27d91849fda79e9c32985400e412708ac855ee.
Revert "msm: ipc_logging: add locking hierarchy"

This reverts commit f2c2f91875fad1cade9ec72eb3eea1dfaa6b9d00.
Revert "msm: ipc_logging: add client version support"

This reverts commit de216c1f4b918e90ee4cc2235d1c2db0f2b130df.
Revert "msm: ipc_logging: remove internal details from header"

This reverts commit a2462f3b51b772d71453babe32bcc43e6e1561d0.
Revert "msm_serial_hs: Handle client requests without port open"

This reverts commit 1b52100ae5f2bc03c38af27dd5c09462cc2a064f.
msm_serial_hs: Revert to LGEs hammerhead-3.4-kitkat-mr2 driver

Revert to google's mr_2 serial driver that fixes all teh things.
This may be revisited or not.

Change-Id: I0f3e9577d25b97bg76a53e1bef249bac665cc59f
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>
msm: Revert modem drivers to Google MR2

Change-Id: I7d8cab91d8965ddb1fa1af0a8548bc51d37c6aa0
msm_serial_hs: Handle client requests without port open

Adding defensive checks in the APIs to handle the
client driver requests calling without port open.

Change-Id: I0d618abbc7a38151651550a07aa909689ce92054
Signed-off-by: Dilip Kota <c_dkota@codeaurora.org>