msm: ipc: Define locking hierarchy and use read/write semaphores

Define the hierarchy of different locks used in IPC Router. This will
help in avoiding the classic AB-BA locking scenario inside IPC Router.

Update some of the locks from mutexes to read/write semaphores. This
will help in improving parallelism. This will also improve the robustness
of the IPC Router when some of the remote subsystem stop responding
silently.

As part of the locking revamp, optimize the code path which handles
subsystem restart and cleanup some of the unused macros.

Change-Id: I2a1d81bcb90cbaf4dd5d7030efbf94f2f0758d55
Signed-off-by: Karthikeyan Ramasubramanian <kramasub@codeaurora.org>
4 files changed