From: Chris Ball <cjb@laptop.org>
To: Girish K S <girish.shivananjappa@linaro.org>
Cc: Subhash Jadavani <subhashj@codeaurora.org>,
linux-mmc@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v2 1/1] mmc: core: hs200 fixes
Date: Thu, 08 Mar 2012 23:46:05 -0500 [thread overview]
Message-ID: <m2pqcmpek2.fsf@bob.laptop.org> (raw)
In-Reply-To: <CAGxe1ZGxxLV8=w32Ka3aoTmwCkrK2yNNLj+W=mgqZG+epab56w@mail.gmail.com> (Girish K. S.'s message of "Tue, 6 Mar 2012 18:37:31 +0530")
Hi,
On Tue, Mar 06 2012, Girish K S wrote:
> On 6 March 2012 17:59, Subhash Jadavani <subhashj@codeaurora.org> wrote:
>> This patch fixes following issues when HS200 is enabled:
>>
>> 1. If executing_tuning() host ops is called without mmc_host_clk_hold(),
>> card clocks might get turned off (if MMC_CLK_GATING is enabled)
>> while execute_tuning() is in progress. So this patch makes sure
>> that execute_tuning() is called with mmc_host_clk_hold().
>>
>> 2. If host timing mode is set to HS200 mode, there should not be
>> any communication with the card until execute_tuning() is completed.
>> But there is a chance that CMD6 might be sent to enable set HPI_EN
>> (of HPI_MGMT field in EXT_CSD) before execute_tuning() is called.
>> So this patch moves this operation after execute_tuning() is completed.
>>
>> Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
>> ---
>> drivers/mmc/core/mmc.c | 38 +++++++++++++++++++++-----------------
>> 1 files changed, 21 insertions(+), 17 deletions(-)
>>
>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>> index a480663..d36d2c4 100644
>> --- a/drivers/mmc/core/mmc.c
>> +++ b/drivers/mmc/core/mmc.c
>> @@ -1030,22 +1030,6 @@ static int mmc_init_card(struct mmc_host
>> *host, u32 ocr,
>> }
>>
>> /*
>> - * Enable HPI feature (if supported)
>> - */
>> - if (card->ext_csd.hpi) {
>> - err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
>> - EXT_CSD_HPI_MGMT, 1, 0);
>> - if (err && err != -EBADMSG)
>> - goto free_card;
>> - if (err) {
>> - pr_warning("%s: Enabling HPI failed\n",
>> - mmc_hostname(card->host));
>> - err = 0;
>> - } else
>> - card->ext_csd.hpi_en = 1;
>> - }
>> -
>> - /*
>> * Compute bus speed.
>> */
>> max_dtr = (unsigned int)-1;
>> @@ -1094,9 +1078,12 @@ static int mmc_init_card(struct mmc_host
>> *host, u32 ocr,
>> * 4. execute tuning for HS200
>> */
>> if ((host->caps2 & MMC_CAP2_HS200) &&
>> - card->host->ops->execute_tuning)
>> + card->host->ops->execute_tuning) {
>> + mmc_host_clk_hold(card->host);
>> err = card->host->ops->execute_tuning(card->host,
>> MMC_SEND_TUNING_BLOCK_HS200);
>> + mmc_host_clk_release(card->host);
>> + }
>> if (err) {
>> pr_warning("%s: tuning execution failed\n",
>> mmc_hostname(card->host));
>> @@ -1216,6 +1203,23 @@ static int mmc_init_card(struct mmc_host
>> *host, u32 ocr,
>> }
>>
>> /*
>> + * Enable HPI feature (if supported)
>> + */
>> + if (card->ext_csd.hpi) {
>> + err = mmc_switch(card, EXT_CSD_CMD_SET_NORMAL,
>> + EXT_CSD_HPI_MGMT, 1,
>> + card->ext_csd.generic_cmd6_time);
>> + if (err && err != -EBADMSG)
>> + goto free_card;
>> + if (err) {
>> + pr_warning("%s: Enabling HPI failed\n",
>> + mmc_hostname(card->host));
>> + err = 0;
>> + } else
>> + card->ext_csd.hpi_en = 1;
>> + }
>> +
>> + /*
>> * If cache size is higher than 0, this indicates
>> * the existence of cache and it can be turned on.
>> */
>
> Reviewed-By: girish.shivananjappa@linaro.org
Thanks, pushed to mmc-next for 3.4.
- Chris.
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
prev parent reply other threads:[~2012-03-09 4:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-06 12:29 [PATCH v2 1/1] mmc: core: hs200 fixes Subhash Jadavani
2012-03-06 13:07 ` Girish K S
2012-03-09 4:46 ` Chris Ball [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=m2pqcmpek2.fsf@bob.laptop.org \
--to=cjb@laptop.org \
--cc=girish.shivananjappa@linaro.org \
--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