Revert "msm: Revert modem drivers to Google MR2"

This reverts commit 16cc76fd586e98dedf2bb1cd3676e03e4cf59e00.
Revert "ipc_logging: Validate the next page pointer"

This reverts commit 506202fb9d1bdc78bf1f56f88ca3533e73c381b8.
Revert "msm: ipc_logging: fix non-destructive read logic"

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

This reverts commit 76821983c98e5777556090d2d2a31feabe9f8de2.
Revert "msm: ipc_logging: enhance log-extraction support"

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

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

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

This reverts commit db70ac22311635d97339f83d2aef43d31cc2c75a.
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