From: "S, Venkatraman" <svenkatr@ti.com>
To: Subhash Jadavani <subhashj@codeaurora.org>
Cc: linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v1 1/1] mmc: block: fix the data timeout issue with ACMD22
Date: Thu, 14 Jun 2012 00:35:48 +0530 [thread overview]
Message-ID: <CANfBPZ81uBVAhC=NWDMfoU_KsoyKQD0a-mpqO7DW+u3s1SpNWA@mail.gmail.com> (raw)
In-Reply-To: <1339587643-22115-1-git-send-email-subhashj@codeaurora.org>
On Wed, Jun 13, 2012 at 5:10 PM, Subhash Jadavani
<subhashj@codeaurora.org> wrote:
> If multi block write operation fails for SD card, during
> error handling we send the SD_APP_SEND_NUM_WR_BLKS (ACMD22)
> to know how many blocks were already programmed by card.
>
> But mmc_sd_num_wr_blocks() function which sends the ACMD22
> calculates the data timeout value from csd.tacc_ns and
> csd.tacc_clks parameters which will be 0 for block addressed
> (>2GB cards) SD card. This would result in timeout_ns and
> timeout_clks being 0 in the mmc_request passed to host driver.
> This means host controller would program its data timeout timer
> value with 0 which could result in DATA TIMEOUT errors from
> controller.
>
> To fix this issue, mmc_sd_num_wr_blocks() should instead
> just call the mmc_set_data_timeout() to calculate the
> data timeout value. mmc_set_data_timeout() function
> ensures that non zero timeout value is set even for
> block addressed SD cards.
>
> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
The patch log could be improvised (Just mention that
set_data_timeout() is reused .. etc")
Even otherwise, its fine.
Reviewed-by: Venkatraman S <svenkatr@ti.com>
> ---
> drivers/mmc/card/block.c | 14 +-------------
> 1 files changed, 1 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
> index 7e3f453..f1c84de 100644
> --- a/drivers/mmc/card/block.c
> +++ b/drivers/mmc/card/block.c
> @@ -554,7 +554,6 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card)
> struct mmc_request mrq = {NULL};
> struct mmc_command cmd = {0};
> struct mmc_data data = {0};
> - unsigned int timeout_us;
>
> struct scatterlist sg;
>
> @@ -574,23 +573,12 @@ static u32 mmc_sd_num_wr_blocks(struct mmc_card *card)
> cmd.arg = 0;
> cmd.flags = MMC_RSP_SPI_R1 | MMC_RSP_R1 | MMC_CMD_ADTC;
>
> - data.timeout_ns = card->csd.tacc_ns * 100;
> - data.timeout_clks = card->csd.tacc_clks * 100;
> -
> - timeout_us = data.timeout_ns / 1000;
> - timeout_us += data.timeout_clks * 1000 /
> - (card->host->ios.clock / 1000);
> -
> - if (timeout_us > 100000) {
> - data.timeout_ns = 100000000;
> - data.timeout_clks = 0;
> - }
> -
> data.blksz = 4;
> data.blocks = 1;
> data.flags = MMC_DATA_READ;
> data.sg = &sg;
> data.sg_len = 1;
> + mmc_set_data_timeout(&data, card);
>
> mrq.cmd = &cmd;
> mrq.data = &data;
> --
prev parent reply other threads:[~2012-06-13 19:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-13 11:40 [PATCH v1 1/1] mmc: block: fix the data timeout issue with ACMD22 Subhash Jadavani
2012-06-13 19:05 ` S, Venkatraman [this message]
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='CANfBPZ81uBVAhC=NWDMfoU_KsoyKQD0a-mpqO7DW+u3s1SpNWA@mail.gmail.com' \
--to=svenkatr@ti.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=subhashj@codeaurora.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;
as well as URLs for NNTP newsgroup(s).