aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/card
diff options
context:
space:
mode:
authorPierre Ossman <pierre@ossman.eu>2009-04-10 11:52:57 -0400
committerPierre Ossman <pierre@ossman.eu>2009-05-03 16:11:00 -0400
commit548d2de9bd978a4d4e941477500f1ab97aade137 (patch)
tree28c3464c82296de10737f9174c775ae92a9c2727 /drivers/mmc/card
parent0c8454f56623505a99463405fd7d5664adfbb094 (diff)
mmc_block: be prepared for oversized requests
The block layer does not support very low sector count restrictions so we need to be prepared to handle bigger requests than we can send directly to the controller. Problem found by Manuel Lauss. Signed-off-by: Pierre Ossman <pierre@ossman.eu>
Diffstat (limited to 'drivers/mmc/card')
-rw-r--r--drivers/mmc/card/block.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index fe8041e619ea..b25e9b6516ae 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -254,6 +254,14 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
254 brq.data.blocks = req->nr_sectors; 254 brq.data.blocks = req->nr_sectors;
255 255
256 /* 256 /*
257 * The block layer doesn't support all sector count
258 * restrictions, so we need to be prepared for too big
259 * requests.
260 */
261 if (brq.data.blocks > card->host->max_blk_count)
262 brq.data.blocks = card->host->max_blk_count;
263
264 /*
257 * After a read error, we redo the request one sector at a time 265 * After a read error, we redo the request one sector at a time
258 * in order to accurately determine which sectors can be read 266 * in order to accurately determine which sectors can be read
259 * successfully. 267 * successfully.