Revert "mmc_block: fix queue cleanup"

This reverts commit a895a6359c.
This commit is contained in:
黄涛
2011-07-30 22:49:01 +08:00
parent 430a623eb9
commit 1264a71167
2 changed files with 9 additions and 11 deletions

View File

@@ -91,8 +91,6 @@ static void mmc_blk_put(struct mmc_blk_data *md)
if (!devmaj)
devidx = md->disk->first_minor >> MMC_SHIFT;
blk_cleanup_queue(md->queue.queue);
__clear_bit(devidx, dev_use);
put_disk(md->disk);

View File

@@ -90,10 +90,9 @@ static void mmc_request(struct request_queue *q)
struct request *req;
if (!mq) {
while ((req = blk_fetch_request(q)) != NULL) {
req->cmd_flags |= REQ_QUIET;
printk(KERN_ERR "MMC: killing requests for dead queue\n");
while ((req = blk_fetch_request(q)) != NULL)
__blk_end_request_all(req, -EIO);
}
return;
}
@@ -224,18 +223,17 @@ void mmc_cleanup_queue(struct mmc_queue *mq)
struct request_queue *q = mq->queue;
unsigned long flags;
/* Mark that we should start throwing out stragglers */
spin_lock_irqsave(q->queue_lock, flags);
q->queuedata = NULL;
spin_unlock_irqrestore(q->queue_lock, flags);
/* Make sure the queue isn't suspended, as that will deadlock */
mmc_queue_resume(mq);
/* Then terminate our worker thread */
kthread_stop(mq->thread);
/* Empty the queue */
spin_lock_irqsave(q->queue_lock, flags);
q->queuedata = NULL;
blk_start_queue(q);
spin_unlock_irqrestore(q->queue_lock, flags);
if (mq->bounce_sg)
kfree(mq->bounce_sg);
mq->bounce_sg = NULL;
@@ -247,6 +245,8 @@ void mmc_cleanup_queue(struct mmc_queue *mq)
kfree(mq->bounce_buf);
mq->bounce_buf = NULL;
blk_cleanup_queue(mq->queue);
mq->card = NULL;
}
EXPORT_SYMBOL(mmc_cleanup_queue);