]> git.openfabrics.org - ~shefty/rdma-dev.git/commitdiff
mmc: mmc_test: align max_seg_size
authorPer Forlin <per.forlin@stericsson.com>
Mon, 14 Nov 2011 11:04:24 +0000 (12:04 +0100)
committerChris Ball <cjb@laptop.org>
Thu, 12 Jan 2012 04:58:41 +0000 (23:58 -0500)
If max_seg_size is unaligned, mmc_test_map_sg() may create sg element
sizes that are not aligned with 512 byte. Fix, align max_seg_size at
mmc_test_area_init().

Signed-off-by: Per Forlin <per.forlin@stericsson.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
drivers/mmc/card/mmc_test.c

index b038c4a9468b0a9d06d9ae72ac7d4ee3325ac8a4..584899889e8fb86d95e47d540eb30e07b6683e1c 100644 (file)
@@ -1581,6 +1581,7 @@ static int mmc_test_area_init(struct mmc_test_card *test, int erase, int fill)
 
        t->max_segs = test->card->host->max_segs;
        t->max_seg_sz = test->card->host->max_seg_size;
+       t->max_seg_sz -= t->max_seg_sz % 512;
 
        t->max_tfr = t->max_sz;
        if (t->max_tfr >> 9 > test->card->host->max_blk_count)