if (!devmaj)
devidx = md->disk->first_minor >> MMC_SHIFT;
- blk_cleanup_queue(md->queue.queue);
-
__clear_bit(devidx, dev_use);
put_disk(md->disk);
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;
}
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;
kfree(mq->bounce_buf);
mq->bounce_buf = NULL;
+ blk_cleanup_queue(mq->queue);
+
mq->card = NULL;
}
EXPORT_SYMBOL(mmc_cleanup_queue);