Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4bb53016 authored by Asutosh Das's avatar Asutosh Das Committed by Gerrit - the friendly Code Review server
Browse files

mmc: queue: fix race in mmc shutdown



The shutdown handler waits for in-flight requests only.
It stops the block queue, but doesn't issue the already
queued requests to the LLD. Furthermore, a request which
is in the process of being queued will timeout eventually
because CQE would be halted by shutdown handler.

mmc_cmdq_thread(mct) -> pulls request (r1)
 shutdown invoked
  stops block queue
  halts cqe
(mct) -> issues r1 to LLD
 - pulls already issued requests
   - CQE halted -> requeues request
 - issued request (r1) times out

Hence, in shutdown handler
- stop the block layer queue
- set a state indicating shutdown
- wake up mmc_cmdqd
  - mmc_cmdqd:
    - pull requests and issue to LLD
    - complete the issuing of already queued requests
    - wake up shutdown handler
- wait for completion from mmc_cmdqd
- wait for all issued request to complete
- proceed with shutdown

Change-Id: I30a9664d8ba2f4b4f580c2cf71c5d01b735c9491
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent 848b312e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment