mmc_test: block addressed cards
The tests in mmc_test assumes that all cards are byte addressable. This patch updates the tests to also work with cards that use block addresses.
Signed-off-by Johan Kristell <[email protected]>
---
drivers/mmc/card/mmc_test.c +6 -3
@@ -74,6 +74,9 @@ static void mmc_test_prepare_mrq(struct } mrq->cmd->arg = dev_addr; +if (!mmc_card_blockaddr (test->card)) + mrq->cmd->arg <<=9 ; + mrq->cmd->flags =MMC_RSP_R1 |MMC_CMD_ADTC ;if (blocks ==1 )
@@ -190,7 +193,7 @@ static int __mmc_test_prepare(struct mmc }for (i =0 ;i <BUFFER_SIZE /512 ;i++) { - ret =mmc_test_buffer_transfer (test, test->buffer, i *512 ,512 ,1 ); + ret =mmc_test_buffer_transfer (test, test->buffer, i,512 ,1 );if (ret)return ret; }
@@ -219,7 +222,7 @@ static int mmc_test_cleanup(struct mmc_tmemset (test->buffer,0 ,512 );for (i =0 ;i <BUFFER_SIZE /512 ;i++) { - ret =mmc_test_buffer_transfer (test, test->buffer, i *512 ,512 ,1 ); + ret =mmc_test_buffer_transfer (test, test->buffer, i,512 ,1 );if (ret)return ret; }
@@ -426,7 +429,7 @@ static int mmc_test_transfer(struct mmc_for (i =0 ;i < sectors;i++) { ret =mmc_test_buffer_transfer (test, test->buffer + i *512 , - dev_addr + i *512 ,512 ,0 ); + dev_addr + i,512 ,0 );if (ret)return ret; }
Quoted 3 lines · On Mon, 1 Feb 2010 13:04:55 +0100 Johan Kristell <[email protected]>…
The tests in
mmc_testassumes that all cards are byte addressable. This patch updates the tests to also work with cards that use block addresses.
When fixing a bug, please decribe the bug! Otherwise it's hard for others (ie: me) to work out the severity of the bug and hence the urgency of the fix.
Quoted 1 line
From the above info, I'm unable to decide whether this fix is needed in
2.6.33 or 2.6.32.