mmc: CMDQ Error handling context syncronization
This patch adds err_rwsem in mmc_cmdq_context_info, which is used to synchronize between: 1. Error handler work <--> blk softirqs completion. 2. Error handler work <--> mmc_cmdq_thread issue ctx. Error handler takes the writer lock and remaining contexts which can run in parallel needs to rake read semaphore. To make sure that we release the read rwsem before sleeping in case we expect error handler to run and again check the state of the req. If the req is not valid we return to the caller otherwise we proceed to issue this req to controller. Also note that error handler as of now is doing mmc_put_card for all the requests pulled for which mmc_get_card is done. So in case if the request was re-queued by cmdq-err handler, then corresponding mmc_put_card is also already done. So after we wake up and acquire the semaphore, we should simply return to the caller. Change-Id: Ie29a02cee4e42a0df1bd0fff6c746f112527b433 Signed-off-by:Ritesh Harjani <riteshh@codeaurora.org> Signed-off-by:
Sahitya Tummala <stummala@codeaurora.org>
Loading
Please register or sign in to comment