From: Jaehoon Chung <jh80.chung-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: Shawn Lin <shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>,
Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org,
Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Adrian Hunter
<adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 2/2] mmc: core: fall back host->f_init if failing to init mmc card after resume
Date: Tue, 02 Aug 2016 19:47:32 +0900 [thread overview]
Message-ID: <57A07A44.9000400@samsung.com> (raw)
In-Reply-To: <98cd6af4-3296-9020-aeae-802f797f0631-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
Hi Shawn,
On 08/02/2016 06:07 PM, Shawn Lin wrote:
> Hi Ulf,
>
> 在 2016/7/20 9:57, Shawn Lin 写道:
>> We observed the failure of initializing card after resume
>> accidentally. It's hard to reproduce but we did get report from
>> the suspend/resume test of our RK3399 mp test farm . Unfortunately,
>> we still fail to figure out what was going wrong at that time.
>> Also we can't achieve it by retrying the host->f_init without falling
>> back it. But this patch will solve the problem as we could add some log
>> there and see that we resume the mmc card successfully after falling
>> back the host->f_init. There is no obvious side effect found, so it seems
>> this patch will improve the stability.
>>
>> [ 93.405085] mmc1: unexpected status 0x800900 after switch
>> [ 93.408474] mmc1: switch to bus width 1 failed
>> [ 93.408482] mmc1: mmc_select_hs200 failed, error -110
>> [ 93.408492] mmc1: error -110 during resume (card was removed?)
>> [ 93.408705] PM: resume of devices complete after 213.453 msecs
>>
Status 0x800900 is COM_CRC_ERROR..it seems that CRC check fails.
But i don't know what is related with "fall back host->f_init".
I don't have a knowledge of rockchip...
but in my experience, there are some cases, not mmc core problem..
1. Exynos is using the gpio as clk/cmd/data line..and gpio has the driver strength value.
If driver strength is changed after resuming, it's possible to occur the error.
2. And glitch for I/O line..this loop has the delay..Just delay?
So you can check the other problem... :)
At Booting time, f_init can use 400K..but after resuming..f_init need to use 100K..hmm..strange..
Best Regards,
Jaehoon Chung
>
> Any comments for this patch? :)
>
>> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
>>
>> ---
>>
>> Changes in v2:
>> - remove mmc_power_off
>> - take f_min into consideration
>>
>> drivers/mmc/core/mmc.c | 19 +++++++++++++++++--
>> 1 file changed, 17 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>> index 403b97b..a2891c1 100644
>> --- a/drivers/mmc/core/mmc.c
>> +++ b/drivers/mmc/core/mmc.c
>> @@ -1945,6 +1945,7 @@ static int mmc_suspend(struct mmc_host *host)
>> static int _mmc_resume(struct mmc_host *host)
>> {
>> int err = 0;
>> + int i;
>>
>> BUG_ON(!host);
>> BUG_ON(!host->card);
>> @@ -1954,8 +1955,22 @@ static int _mmc_resume(struct mmc_host *host)
>> if (!mmc_card_suspended(host->card))
>> goto out;
>>
>> - mmc_power_up(host, host->card->ocr);
>> - err = mmc_init_card(host, host->card->ocr, host->card);
>> + /*
>> + * Let's try to fallback the host->f_init
>> + * if failing to init mmc card after resume.
>> + */
>> + for (i = 0; i < ARRAY_SIZE(freqs); i++) {
>> + if (host->f_init < max(freqs[i], host->f_min))
>> + continue;
>> + else
>> + host->f_init = max(freqs[i], host->f_min);
>> +
>> + mmc_power_up(host, host->card->ocr);
>> + err = mmc_init_card(host, host->card->ocr, host->card);
>> + if (!err)
>> + break;
>> + }
>> +
>> mmc_card_clr_suspended(host->card);
>>
>> out:
>>
>
>
_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip
WARNING: multiple messages have this Message-ID (diff)
From: Jaehoon Chung <jh80.chung@samsung.com>
To: Shawn Lin <shawn.lin@rock-chips.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: Adrian Hunter <adrian.hunter@intel.com>,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
Doug Anderson <dianders@chromium.org>,
linux-rockchip@lists.infradead.org
Subject: Re: [PATCH v2 2/2] mmc: core: fall back host->f_init if failing to init mmc card after resume
Date: Tue, 02 Aug 2016 19:47:32 +0900 [thread overview]
Message-ID: <57A07A44.9000400@samsung.com> (raw)
In-Reply-To: <98cd6af4-3296-9020-aeae-802f797f0631@rock-chips.com>
Hi Shawn,
On 08/02/2016 06:07 PM, Shawn Lin wrote:
> Hi Ulf,
>
> 在 2016/7/20 9:57, Shawn Lin 写道:
>> We observed the failure of initializing card after resume
>> accidentally. It's hard to reproduce but we did get report from
>> the suspend/resume test of our RK3399 mp test farm . Unfortunately,
>> we still fail to figure out what was going wrong at that time.
>> Also we can't achieve it by retrying the host->f_init without falling
>> back it. But this patch will solve the problem as we could add some log
>> there and see that we resume the mmc card successfully after falling
>> back the host->f_init. There is no obvious side effect found, so it seems
>> this patch will improve the stability.
>>
>> [ 93.405085] mmc1: unexpected status 0x800900 after switch
>> [ 93.408474] mmc1: switch to bus width 1 failed
>> [ 93.408482] mmc1: mmc_select_hs200 failed, error -110
>> [ 93.408492] mmc1: error -110 during resume (card was removed?)
>> [ 93.408705] PM: resume of devices complete after 213.453 msecs
>>
Status 0x800900 is COM_CRC_ERROR..it seems that CRC check fails.
But i don't know what is related with "fall back host->f_init".
I don't have a knowledge of rockchip...
but in my experience, there are some cases, not mmc core problem..
1. Exynos is using the gpio as clk/cmd/data line..and gpio has the driver strength value.
If driver strength is changed after resuming, it's possible to occur the error.
2. And glitch for I/O line..this loop has the delay..Just delay?
So you can check the other problem... :)
At Booting time, f_init can use 400K..but after resuming..f_init need to use 100K..hmm..strange..
Best Regards,
Jaehoon Chung
>
> Any comments for this patch? :)
>
>> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
>>
>> ---
>>
>> Changes in v2:
>> - remove mmc_power_off
>> - take f_min into consideration
>>
>> drivers/mmc/core/mmc.c | 19 +++++++++++++++++--
>> 1 file changed, 17 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>> index 403b97b..a2891c1 100644
>> --- a/drivers/mmc/core/mmc.c
>> +++ b/drivers/mmc/core/mmc.c
>> @@ -1945,6 +1945,7 @@ static int mmc_suspend(struct mmc_host *host)
>> static int _mmc_resume(struct mmc_host *host)
>> {
>> int err = 0;
>> + int i;
>>
>> BUG_ON(!host);
>> BUG_ON(!host->card);
>> @@ -1954,8 +1955,22 @@ static int _mmc_resume(struct mmc_host *host)
>> if (!mmc_card_suspended(host->card))
>> goto out;
>>
>> - mmc_power_up(host, host->card->ocr);
>> - err = mmc_init_card(host, host->card->ocr, host->card);
>> + /*
>> + * Let's try to fallback the host->f_init
>> + * if failing to init mmc card after resume.
>> + */
>> + for (i = 0; i < ARRAY_SIZE(freqs); i++) {
>> + if (host->f_init < max(freqs[i], host->f_min))
>> + continue;
>> + else
>> + host->f_init = max(freqs[i], host->f_min);
>> +
>> + mmc_power_up(host, host->card->ocr);
>> + err = mmc_init_card(host, host->card->ocr, host->card);
>> + if (!err)
>> + break;
>> + }
>> +
>> mmc_card_clr_suspended(host->card);
>>
>> out:
>>
>
>
next prev parent reply other threads:[~2016-08-02 10:47 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-20 1:57 [PATCH v2 1/2] mmc: core: move freqs table into core.h Shawn Lin
2016-07-20 1:57 ` [PATCH v2 2/2] mmc: core: fall back host->f_init if failing to init mmc card after resume Shawn Lin
[not found] ` <1468979860-28712-2-git-send-email-shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-08-02 9:07 ` Shawn Lin
[not found] ` <98cd6af4-3296-9020-aeae-802f797f0631-TNX95d0MmH7DzftRWevZcw@public.gmane.org>
2016-08-02 10:47 ` Jaehoon Chung [this message]
2016-08-02 10:47 ` Jaehoon Chung
[not found] ` <57A07A44.9000400-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-08-03 1:35 ` Shawn Lin
2016-08-03 1:35 ` Shawn Lin
2016-08-03 6:54 ` Jaehoon Chung
[not found] ` <1e664e27-09c9-dc14-b978-2483c1fa1da4-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2016-08-03 7:44 ` Shawn Lin
2016-08-03 7:44 ` Shawn Lin
2016-08-20 3:02 ` Shawn Lin
2016-08-20 3:02 ` Shawn Lin
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=57A07A44.9000400@samsung.com \
--to=jh80.chung-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
--cc=adrian.hunter-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-mmc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
--cc=shawn.lin-TNX95d0MmH7DzftRWevZcw@public.gmane.org \
--cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.