Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359888
b: refs/heads/master
c: 5b4c924
h: refs/heads/master
v: v3
  • Loading branch information
Seungwon Jeon authored and Chris Ball committed Jan 28, 2013
1 parent 3e465e1 commit f75e0a8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa11d6d892c9cf0170865fadbce04d558d359d1a
refs/heads/master: 5b4c924b1a18f0d04732ee03b408ace39089fdcf
10 changes: 10 additions & 0 deletions trunk/drivers/mmc/card/queue.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

#define MMC_QUEUE_SUSPENDED (1 << 0)

#define MMC_REQ_SPECIAL_MASK (REQ_DISCARD | REQ_FLUSH)

/*
* Prepare a MMC request. This just filters out odd stuff.
*/
Expand Down Expand Up @@ -58,6 +60,7 @@ static int mmc_queue_thread(void *d)
do {
struct request *req = NULL;
struct mmc_queue_req *tmp;
unsigned int cmd_flags = 0;

spin_lock_irq(q->queue_lock);
set_current_state(TASK_INTERRUPTIBLE);
Expand All @@ -67,12 +70,19 @@ static int mmc_queue_thread(void *d)

if (req || mq->mqrq_prev->req) {
set_current_state(TASK_RUNNING);
cmd_flags = req ? req->cmd_flags : 0;
mq->issue_fn(mq, req);

/*
* Current request becomes previous request
* and vice versa.
* In case of special requests, current request
* has been finished. Do not assign it to previous
* request.
*/
if (cmd_flags & MMC_REQ_SPECIAL_MASK)
mq->mqrq_cur->req = NULL;

mq->mqrq_prev->brq.mrq.data = NULL;
mq->mqrq_prev->req = NULL;
tmp = mq->mqrq_prev;
Expand Down

0 comments on commit f75e0a8

Please sign in to comment.