drivers: mailbox: qti_tcs: Simplify locking and IRQ handling

RPMH response handling has become too complex and exposes a lot of race
condition with the current implementation. Simplify the request handling
by:

- One lock per TCS type - active, sleep, wake, control. No tcs_m_lock
(per TCS instance lock).

- Response object needs a state to indicate that we got a IRQ response
for the request its tracking, but we we are not yet ready to release the
tasklet that the response object holds.

- We used to attach the response object to the TCS. That's too complex
to manage correctly. Instead just scan through the response pool to get
the response object in the IRQ handler.

- Bug fix in tcs_notify_timeout, we were throwing BUG() for all sorts of
hangs and not just the h/w state machine hang.

- A simple .idx member variable instead of pointer arithmetic to
determine the index of the response object in its array.

- WARN if RPMH request is made from hard IRQ context. We overselves are
hard IRQ handlers. We may never geta chance to update our state machine
in some cases.

Change-Id: I972bf51647068ead8e3b6fe67ece59f01ba9e6c4
Signed-off-by: Lina Iyer <ilina@codeaurora.org>
1 file changed