Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel...
[sfrench/cifs-2.6.git] / drivers / mmc / card / queue.c
index 49e582356c65ab34bc17b1db1bbae002bc5faaff..c5a7a855f4b1c5f0a8ad7472a8f7896127d03ea8 100644 (file)
@@ -90,9 +90,10 @@ static void mmc_request(struct request_queue *q)
        struct request *req;
 
        if (!mq) {
-               printk(KERN_ERR "MMC: killing requests for dead queue\n");
-               while ((req = blk_fetch_request(q)) != NULL)
+               while ((req = blk_fetch_request(q)) != NULL) {
+                       req->cmd_flags |= REQ_QUIET;
                        __blk_end_request_all(req, -EIO);
+               }
                return;
        }
 
@@ -223,17 +224,18 @@ 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;
@@ -245,8 +247,6 @@ 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);