From: Aaron Lu <aaron.lu@amd.com>
To: Girish K S <girish.shivananjappa@linaro.org>
Cc: Subhash Jadavani <subhashj@codeaurora.org>,
Philip Rakity <prakity@marvell.com>, Chris Ball <cjb@laptop.org>,
linux-mmc@vger.kernel.org, Aaron Lu <aaron.lwe@gmail.com>,
stable <stable@vger.kernel.org>
Subject: Re: [PATCH v2] mmc: sdhci: fix incorrect command used in tuning
Date: Tue, 3 Jul 2012 21:52:45 +0800 [thread overview]
Message-ID: <20120703135243.GA2721@localhost.localdomain> (raw)
In-Reply-To: <CAGxe1ZGuunrQCyhujss1vtbyqcC-qxyV8Ui2_Jb026U315u7pg@mail.gmail.com>
Hi,
On Tue, Jul 03, 2012 at 05:32:36PM +0530, Girish K S wrote:
> >>> > @@ -1292,8 +1294,12 @@ static void sdhci_request(struct mmc_host *mmc, struct mmc_request *mrq)
> >>> > */
> >>> > if ((host->flags & SDHCI_NEEDS_RETUNING) &&
> >>> > !(present_state & (SDHCI_DOING_WRITE | SDHCI_DOING_READ))) {
> >>> > + /* eMMC uses cmd21 while sd and sdio use cmd19 */
> >>> > + tuning_opcode = mmc->card->type == MMC_TYPE_MMC ?
> >>> > + MMC_SEND_TUNING_BLOCK_HS200 :
> >>> > + MMC_SEND_TUNING_BLOCK;
> >>> > spin_unlock_irqrestore(&host->lock, flags);
> >>> > - sdhci_execute_tuning(mmc, mrq->cmd->opcode);
> >>> > + sdhci_execute_tuning(mmc, tuning_opcode);
> >>> dont you think the previous implementation does the same. It is
> >>> already handled by introducing the 2nd parameter.
> >>
> >> Suppose the following scenario:
> >> mmc_start_request (e.g. mrq->cmd->opcode is 18 for this call)
> >> -> host->ops->request
> >> (sdhci's retuning timer expired, the flag SDHCI_NEEDS_RETUNING is set)
> >> -> sdhci_request
> >> -> sdhci_execute_tuning will be called before processing the
> >> actual request due to retuning's requirement, but with the wrong command
> >> opcode(cmd18) instead of cmd19 for sd/sdio or cmd21 for emmc.
> >>
> >> The problem is with retuning, for normal explicit calls of
> >> sdhci_execute_tuning, there is no problem with the code. But when
> >> retuning is required, sdhci_execute_retuning will be executed implicitly
> >> to the above layer and we have to use the right tuning command instead of
> >> the current processing command, which can be any of the valid sd/sdio/mmc
> >> commands.
> > Thanks for the explanation. is it possible to make a separate local
> > function for this. Since mmc_host_ops has a member .execute_tuning
> > which takes 2 parameters that are called from respective sd/mmc/sdio
> > card files. there might be conflict
> Sorry i just read it wrongly (function has only 1 param).
So do you have any other problems with this patch?
If not, can I have your ack on this patch?
Thanks,
Aaron
next prev parent reply other threads:[~2012-07-03 13:52 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-03 9:27 [PATCH v2] mmc: sdhci: fix incorrect command used in tuning Aaron Lu
2012-07-03 9:58 ` Girish K S
2012-07-03 11:31 ` Aaron Lu
2012-07-03 11:57 ` Girish K S
2012-07-03 12:00 ` Girish K S
2012-07-03 12:02 ` Girish K S
2012-07-03 13:52 ` Aaron Lu [this message]
2012-07-03 14:03 ` Philip Rakity
2012-07-04 0:37 ` Chris Ball
2012-07-04 5:11 ` Aaron Lu
2012-11-05 19:45 ` Chris Ball
2012-11-09 1:46 ` Chris Ball
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=20120703135243.GA2721@localhost.localdomain \
--to=aaron.lu@amd.com \
--cc=aaron.lwe@gmail.com \
--cc=cjb@laptop.org \
--cc=girish.shivananjappa@linaro.org \
--cc=linux-mmc@vger.kernel.org \
--cc=prakity@marvell.com \
--cc=stable@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