public inbox for linux-mmc@vger.kernel.org
 help / color / mirror / Atom feed
From: Johan Kristell <johan.kristell@axis.com>
To: linux-mmc@vger.kernel.org
Subject: [patch] mmc_test: block addressed cards
Date: Mon, 11 Jan 2010 13:32:48 +0100	[thread overview]
Message-ID: <4B4B1A70.5060202@axis.com> (raw)

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 <johan.kristell@axis.com>
---

--- linux-2.6/drivers/mmc/card/mmc_test.c	2010-01-11 10:57:02.000000000 +0100
+++ linux-2.6-devel/drivers/mmc/card/mmc_test.c	2010-01-11 09:52:42.000000000 +0100
@@ -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_t
 	memset(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;
 		}

             reply	other threads:[~2010-01-11 13:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-11 12:32 Johan Kristell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-05-24 13:34 [PATCH] mmc_test: block addressed cards Niko Jokinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B4B1A70.5060202@axis.com \
    --to=johan.kristell@axis.com \
    --cc=linux-mmc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox