mmc: core: kick block queue after unhalting cmdq
If request has to be requeued due to cmdq being halted and if we change the task status to interruptible before going to sleep then cmdq thread may not wakeup again. Note that blk_requeue_request() doesn't trigger ->request_fn() again to wakeup the cmdq thread. Fix this issue by kicking the queue once cmdq state machine is unhalted. Change-Id: Icbfb3b6560285fa0a0ce7e83eee66b651d4594a0 Signed-off-by: Gilad Broner <gbroner@codeaurora.org> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
This commit is contained in:
parent
602d8c8cfc
commit
9bc36b07a2
3 changed files with 7 additions and 1 deletions
|
@ -347,6 +347,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card,
|
|||
} else {
|
||||
sema_init(&mq->thread_sem, 1);
|
||||
mq->queue->queuedata = mq;
|
||||
card->host->cmdq_ctx.q = mq->queue;
|
||||
mq->thread = kthread_run(mmc_cmdq_thread, mq,
|
||||
"mmc-cmdqd/%d%s",
|
||||
host->index,
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
#include <linux/of.h>
|
||||
#include <linux/pm.h>
|
||||
#include <linux/jiffies.h>
|
||||
#include <linux/blkdev.h>
|
||||
|
||||
#include <trace/events/mmc.h>
|
||||
|
||||
|
@ -1505,8 +1506,11 @@ int mmc_cmdq_halt(struct mmc_host *host, bool halt)
|
|||
host->ops->notify_halt(host, halt);
|
||||
if (!err && halt)
|
||||
mmc_host_set_halt(host);
|
||||
else if (!err && !halt)
|
||||
else if (!err && !halt) {
|
||||
mmc_host_clr_halt(host);
|
||||
if (host->cmdq_ctx.q)
|
||||
blk_run_queue(host->cmdq_ctx.q);
|
||||
}
|
||||
} else {
|
||||
err = -ENOSYS;
|
||||
}
|
||||
|
|
|
@ -257,6 +257,7 @@ struct mmc_cmdq_context_info {
|
|||
/* no free tag available */
|
||||
unsigned long req_starved;
|
||||
wait_queue_head_t queue_empty_wq;
|
||||
struct request_queue *q;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue