diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/mmc/card/block.c | 2 | ||||
-rw-r--r-- | drivers/mmc/card/queue.c | 18 |
2 files changed, 11 insertions, 9 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c index ee879117017f..1f552c6e7579 100644 --- a/drivers/mmc/card/block.c +++ b/drivers/mmc/card/block.c | |||
@@ -91,6 +91,8 @@ static void mmc_blk_put(struct mmc_blk_data *md) | |||
91 | if (!devmaj) | 91 | if (!devmaj) |
92 | devidx = md->disk->first_minor >> MMC_SHIFT; | 92 | devidx = md->disk->first_minor >> MMC_SHIFT; |
93 | 93 | ||
94 | blk_cleanup_queue(md->queue.queue); | ||
95 | |||
94 | __clear_bit(devidx, dev_use); | 96 | __clear_bit(devidx, dev_use); |
95 | 97 | ||
96 | put_disk(md->disk); | 98 | put_disk(md->disk); |
diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c index 49e582356c65..c5a7a855f4b1 100644 --- a/drivers/mmc/card/queue.c +++ b/drivers/mmc/card/queue.c | |||
@@ -90,9 +90,10 @@ static void mmc_request(struct request_queue *q) | |||
90 | struct request *req; | 90 | struct request *req; |
91 | 91 | ||
92 | if (!mq) { | 92 | if (!mq) { |
93 | printk(KERN_ERR "MMC: killing requests for dead queue\n"); | 93 | while ((req = blk_fetch_request(q)) != NULL) { |
94 | while ((req = blk_fetch_request(q)) != NULL) | 94 | req->cmd_flags |= REQ_QUIET; |
95 | __blk_end_request_all(req, -EIO); | 95 | __blk_end_request_all(req, -EIO); |
96 | } | ||
96 | return; | 97 | return; |
97 | } | 98 | } |
98 | 99 | ||
@@ -223,17 +224,18 @@ void mmc_cleanup_queue(struct mmc_queue *mq) | |||
223 | struct request_queue *q = mq->queue; | 224 | struct request_queue *q = mq->queue; |
224 | unsigned long flags; | 225 | unsigned long flags; |
225 | 226 | ||
226 | /* Mark that we should start throwing out stragglers */ | ||
227 | spin_lock_irqsave(q->queue_lock, flags); | ||
228 | q->queuedata = NULL; | ||
229 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
230 | |||
231 | /* Make sure the queue isn't suspended, as that will deadlock */ | 227 | /* Make sure the queue isn't suspended, as that will deadlock */ |
232 | mmc_queue_resume(mq); | 228 | mmc_queue_resume(mq); |
233 | 229 | ||
234 | /* Then terminate our worker thread */ | 230 | /* Then terminate our worker thread */ |
235 | kthread_stop(mq->thread); | 231 | kthread_stop(mq->thread); |
236 | 232 | ||
233 | /* Empty the queue */ | ||
234 | spin_lock_irqsave(q->queue_lock, flags); | ||
235 | q->queuedata = NULL; | ||
236 | blk_start_queue(q); | ||
237 | spin_unlock_irqrestore(q->queue_lock, flags); | ||
238 | |||
237 | if (mq->bounce_sg) | 239 | if (mq->bounce_sg) |
238 | kfree(mq->bounce_sg); | 240 | kfree(mq->bounce_sg); |
239 | mq->bounce_sg = NULL; | 241 | mq->bounce_sg = NULL; |
@@ -245,8 +247,6 @@ void mmc_cleanup_queue(struct mmc_queue *mq) | |||
245 | kfree(mq->bounce_buf); | 247 | kfree(mq->bounce_buf); |
246 | mq->bounce_buf = NULL; | 248 | mq->bounce_buf = NULL; |
247 | 249 | ||
248 | blk_cleanup_queue(mq->queue); | ||
249 | |||
250 | mq->card = NULL; | 250 | mq->card = NULL; |
251 | } | 251 | } |
252 | EXPORT_SYMBOL(mmc_cleanup_queue); | 252 | EXPORT_SYMBOL(mmc_cleanup_queue); |