Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 107254
b: refs/heads/master
c: b41e9c7
h: refs/heads/master
v: v3
  • Loading branch information
Pierre Ossman committed Aug 1, 2008
1 parent 043c46a commit af3a8d0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a84756c5735f28bf000617f18734a9e94426386a
refs/heads/master: b41e9c7b8e14ea57aa0fc05fd63a0de0e935d58d
17 changes: 11 additions & 6 deletions trunk/drivers/mmc/card/block.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)
struct mmc_blk_data *md = mq->data;
struct mmc_card *card = md->queue.card;
struct mmc_blk_request brq;
int ret = 1, sg_pos, data_size;
int ret = 1, data_size, i;
struct scatterlist *sg;

mmc_claim_host(card->host);

Expand Down Expand Up @@ -267,18 +268,22 @@ static int mmc_blk_issue_rq(struct mmc_queue *mq, struct request *req)

mmc_queue_bounce_pre(mq);

/*
* Adjust the sg list so it is the same size as the
* request.
*/
if (brq.data.blocks !=
(req->nr_sectors >> (md->block_bits - 9))) {
data_size = brq.data.blocks * brq.data.blksz;
for (sg_pos = 0; sg_pos < brq.data.sg_len; sg_pos++) {
data_size -= mq->sg[sg_pos].length;
for_each_sg(brq.data.sg, sg, brq.data.sg_len, i) {
data_size -= sg->length;
if (data_size <= 0) {
mq->sg[sg_pos].length += data_size;
sg_pos++;
sg->length += data_size;
i++;
break;
}
}
brq.data.sg_len = sg_pos;
brq.data.sg_len = i;
}

mmc_wait_for_req(card->host, &brq.mrq);
Expand Down

0 comments on commit af3a8d0

Please sign in to comment.