summaryrefslogtreecommitdiff
path: root/drivers/mmc/card/queue.h
diff options
context:
space:
mode:
authorSubhash Jadavani <subhashj@codeaurora.org>2015-10-27 15:43:11 -0700
committerSubhash Jadavani <subhashj@codeaurora.org>2016-05-31 15:27:48 -0700
commit3b0520abdd56e26dd3cf26f09083a0d3dc60fa2a (patch)
tree3d5f69541b18b856ae23eb651b4c5a98b6292175 /drivers/mmc/card/queue.h
parent98afc17278b691b950dd003c3a0d7958de78aec7 (diff)
mmc: card: fix race with shutdown handler
There could be 2 different race conditions possible with current shutdown handler: 1. Shutdown handler sees that there is no request in queue but mmc-cmdqd might have fetched the request from queue and about to issue it to driver. 2. Shutdown handler keeps looping in the while(1) loop as it sees request being pending in the request queue. But mmc-cmdqd thread doesn't wake up to fetch the requests from the request queue. mmc-cmdqd thread isn't waking up because shutdown path has stopped queue and request came into the queue after that. Once queue is stopped, block layer won't invoke the queue's ->request_fn() callback to notify driver about pending request. Remedy to fix both these race condition is simple. In shutdown handler, make sure that we drain (& complete) all the outstanding requests from the queue and then don't allow any new requests to be queued. Block layer API blk_cleanup_queue() precisely does what we want and this change basically use the same API in shutdown handler. Change-Id: I761ba6a2e2974d955bb72ff993b1cc2c32c9ec29 Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Diffstat (limited to 'drivers/mmc/card/queue.h')
-rw-r--r--drivers/mmc/card/queue.h1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/mmc/card/queue.h b/drivers/mmc/card/queue.h
index e67d0546346a..964262f0eb79 100644
--- a/drivers/mmc/card/queue.h
+++ b/drivers/mmc/card/queue.h
@@ -70,7 +70,6 @@ struct mmc_queue {
int num_wr_reqs_to_start_packing;
bool no_pack_for_random;
struct work_struct cmdq_err_work;
- struct completion cmdq_shutdown_complete;
struct completion cmdq_pending_req_done;
struct request *cmdq_req_peeked;