Commit 08477099 authored by Russell King's avatar Russell King

[MMC] Fix some review points from Jens Axboe

Remove "suspended" flag, queue plugging/unplugging and associated
checks, remove check for oversized requests.
parent bcbd78d5
...@@ -55,7 +55,6 @@ struct mmc_blk_data { ...@@ -55,7 +55,6 @@ struct mmc_blk_data {
unsigned int usage; unsigned int usage;
unsigned int block_bits; unsigned int block_bits;
unsigned int suspended;
}; };
static DECLARE_MUTEX(open_lock); static DECLARE_MUTEX(open_lock);
...@@ -149,6 +148,7 @@ struct mmc_blk_request { ...@@ -149,6 +148,7 @@ struct mmc_blk_request {
static int mmc_blk_prep_rq(struct mmc_queue *mq, struct request *req) static int mmc_blk_prep_rq(struct mmc_queue *mq, struct request *req)
{ {
struct mmc_blk_data *md = mq->data; struct mmc_blk_data *md = mq->data;
int stat = BLKPREP_OK;
/* /*
* If we have no device, we haven't finished initialising. * If we have no device, we haven't finished initialising.
...@@ -156,29 +156,10 @@ static int mmc_blk_prep_rq(struct mmc_queue *mq, struct request *req) ...@@ -156,29 +156,10 @@ static int mmc_blk_prep_rq(struct mmc_queue *mq, struct request *req)
if (!md || !mq->card) { if (!md || !mq->card) {
printk(KERN_ERR "%s: killing request - no device/host\n", printk(KERN_ERR "%s: killing request - no device/host\n",
req->rq_disk->disk_name); req->rq_disk->disk_name);
goto kill; stat = BLKPREP_KILL;
} }
if (md->suspended) { return stat;
blk_plug_device(md->queue.queue);
goto defer;
}
/*
* Check for excessive requests.
*/
if (req->sector + req->nr_sectors > get_capacity(req->rq_disk)) {
printk(KERN_ERR "%s: bad request size\n",
req->rq_disk->disk_name);
goto kill;
}
return BLKPREP_OK;
defer:
return BLKPREP_DEFER;
kill:
return BLKPREP_KILL;
} }
static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req) static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
......
...@@ -114,7 +114,7 @@ static void mmc_request(request_queue_t *q) ...@@ -114,7 +114,7 @@ static void mmc_request(request_queue_t *q)
{ {
struct mmc_queue *mq = q->queuedata; struct mmc_queue *mq = q->queuedata;
if (!mq->req && !blk_queue_plugged(q)) if (!mq->req)
wake_up(&mq->thread_wq); wake_up(&mq->thread_wq);
} }
...@@ -131,7 +131,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock ...@@ -131,7 +131,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card *card, spinlock_t *lock
u64 limit = BLK_BOUNCE_HIGH; u64 limit = BLK_BOUNCE_HIGH;
int ret; int ret;
if (card->host->dev->dma_mask) if (card->host->dev->dma_mask && *card->host->dev->dma_mask)
limit = *card->host->dev->dma_mask; limit = *card->host->dev->dma_mask;
mq->card = card; mq->card = card;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment