All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: card: increase wait time
       [not found] <CGME20171114024825eucas1p218873c4ff649c17d4061b6660aa6264f@eucas1p2.samsung.com>
@ 2017-11-14  2:48 ` Huijin Park
  2017-11-14 12:44   ` Avri Altman
  2017-11-15  9:13   ` Ulf Hansson
  0 siblings, 2 replies; 8+ messages in thread
From: Huijin Park @ 2017-11-14  2:48 UTC (permalink / raw)
  To: ulf.hansson; +Cc: linux-mmc, bbang.huijin.park, Huijin Park

Some eMMC products keep busy time a little longer intermittently.
(eg. prepare free blocks, garbage collection...)
In this case, we recommend to wait a little longer than fail.

Signed-off-by: Huijin Park <huijin.park@samsung.com>
---
 drivers/mmc/core/block.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
index ea80ff4..b5b0fe6 100644
--- a/drivers/mmc/core/block.c
+++ b/drivers/mmc/core/block.c
@@ -584,7 +584,7 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
 		 * Ensure RPMB command has completed by polling CMD13
 		 * "Send Status".
 		 */
-		err = ioctl_rpmb_card_status_poll(card, &status, 5);
+		err = ioctl_rpmb_card_status_poll(card, &status, 50);
 		if (err)
 			dev_err(mmc_dev(card->host),
 					"%s: Card Status=0x%08X, error %d\n",
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* RE: [PATCH] mmc: card: increase wait time
  2017-11-14  2:48 ` [PATCH] mmc: card: increase wait time Huijin Park
@ 2017-11-14 12:44   ` Avri Altman
  2017-11-15  4:52     ` Park Huijin
  2017-11-15  9:13   ` Ulf Hansson
  1 sibling, 1 reply; 8+ messages in thread
From: Avri Altman @ 2017-11-14 12:44 UTC (permalink / raw)
  To: Huijin Park, ulf.hansson; +Cc: linux-mmc, bbang.huijin.park



> -----Original Message-----
> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
> owner@vger.kernel.org] On Behalf Of Huijin Park
> Sent: Tuesday, November 14, 2017 4:48 AM
> To: ulf.hansson@linaro.org
> Cc: linux-mmc@vger.kernel.org; bbang.huijin.park@gmail.com; Huijin Park
> <huijin.park@samsung.com>
> Subject: [PATCH] mmc: card: increase wait time
> 
> Some eMMC products keep busy time a little longer intermittently.
> (eg. prepare free blocks, garbage collection...) In this case, we recommend to
> wait a little longer than fail.
> 
> Signed-off-by: Huijin Park <huijin.park@samsung.com>
> ---
>  drivers/mmc/core/block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index
> ea80ff4..b5b0fe6 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -584,7 +584,7 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card
> *card, struct mmc_blk_data *md,
>  		 * Ensure RPMB command has completed by polling CMD13
>  		 * "Send Status".
>  		 */
> -		err = ioctl_rpmb_card_status_poll(card, &status, 5);
> +		err = ioctl_rpmb_card_status_poll(card, &status, 50);
 Is this up to 1.25 sec or am I counting wrong?
5[msec] x 5 [__mmc_send_status] x 50 

>  		if (err)
>  			dev_err(mmc_dev(card->host),
>  					"%s: Card Status=0x%08X, error
> %d\n",
> --
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the
> body of a message to majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mmc: card: increase wait time
  2017-11-14 12:44   ` Avri Altman
@ 2017-11-15  4:52     ` Park Huijin
  0 siblings, 0 replies; 8+ messages in thread
From: Park Huijin @ 2017-11-15  4:52 UTC (permalink / raw)
  To: Avri Altman; +Cc: Huijin Park, ulf.hansson, linux-mmc

The" [__mmc_send_status] 5" doesn't wait 5[msec].
So it wait up to 5[msec] x 50.

Thanks.

2017-11-14 21:44 GMT+09:00 Avri Altman <Avri.Altman@wdc.com>:
>
>
>> -----Original Message-----
>> From: linux-mmc-owner@vger.kernel.org [mailto:linux-mmc-
>> owner@vger.kernel.org] On Behalf Of Huijin Park
>> Sent: Tuesday, November 14, 2017 4:48 AM
>> To: ulf.hansson@linaro.org
>> Cc: linux-mmc@vger.kernel.org; bbang.huijin.park@gmail.com; Huijin Park
>> <huijin.park@samsung.com>
>> Subject: [PATCH] mmc: card: increase wait time
>>
>> Some eMMC products keep busy time a little longer intermittently.
>> (eg. prepare free blocks, garbage collection...) In this case, we recommend to
>> wait a little longer than fail.
>>
>> Signed-off-by: Huijin Park <huijin.park@samsung.com>
>> ---
>>  drivers/mmc/core/block.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c index
>> ea80ff4..b5b0fe6 100644
>> --- a/drivers/mmc/core/block.c
>> +++ b/drivers/mmc/core/block.c
>> @@ -584,7 +584,7 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card
>> *card, struct mmc_blk_data *md,
>>                * Ensure RPMB command has completed by polling CMD13
>>                * "Send Status".
>>                */
>> -             err = ioctl_rpmb_card_status_poll(card, &status, 5);
>> +             err = ioctl_rpmb_card_status_poll(card, &status, 50);
>  Is this up to 1.25 sec or am I counting wrong?
> 5[msec] x 5 [__mmc_send_status] x 50
>
>>               if (err)
>>                       dev_err(mmc_dev(card->host),
>>                                       "%s: Card Status=0x%08X, error
>> %d\n",
>> --
>> 1.9.1
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the
>> body of a message to majordomo@vger.kernel.org More majordomo info at
>> http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mmc: card: increase wait time
  2017-11-14  2:48 ` [PATCH] mmc: card: increase wait time Huijin Park
  2017-11-14 12:44   ` Avri Altman
@ 2017-11-15  9:13   ` Ulf Hansson
  2017-11-20  4:50     ` Park Huijin
  1 sibling, 1 reply; 8+ messages in thread
From: Ulf Hansson @ 2017-11-15  9:13 UTC (permalink / raw)
  To: Huijin Park; +Cc: linux-mmc, bbang.huijin.park

On 14 November 2017 at 03:48, Huijin Park <huijin.park@samsung.com> wrote:
> Some eMMC products keep busy time a little longer intermittently.
> (eg. prepare free blocks, garbage collection...)
> In this case, we recommend to wait a little longer than fail.

Is this an rpmb specific problem, because the code seems only to change that.

Is it write and read or only write?

>
> Signed-off-by: Huijin Park <huijin.park@samsung.com>
> ---
>  drivers/mmc/core/block.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> index ea80ff4..b5b0fe6 100644
> --- a/drivers/mmc/core/block.c
> +++ b/drivers/mmc/core/block.c
> @@ -584,7 +584,7 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
>                  * Ensure RPMB command has completed by polling CMD13
>                  * "Send Status".
>                  */
> -               err = ioctl_rpmb_card_status_poll(card, &status, 5);
> +               err = ioctl_rpmb_card_status_poll(card, &status, 50);

First, you are changing "re-tries" not a timeout value, which would
seem like a better approach.

Second, it seems like we should remove the
ioctl_rpmb_card_status_poll() function altogether and instead make use
of the more generic card_busy_detect() function here.

Then if card_busy_detect() needs to be adopted to suite rpmb, then we
should do that instead.

>                 if (err)
>                         dev_err(mmc_dev(card->host),
>                                         "%s: Card Status=0x%08X, error %d\n",
> --
> 1.9.1
>

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mmc: card: increase wait time
  2017-11-15  9:13   ` Ulf Hansson
@ 2017-11-20  4:50     ` Park Huijin
  2017-11-21  9:02       ` Ulf Hansson
  0 siblings, 1 reply; 8+ messages in thread
From: Park Huijin @ 2017-11-20  4:50 UTC (permalink / raw)
  To: Ulf Hansson; +Cc: Huijin Park, linux-mmc, js07.lee

2017-11-15 18:13 GMT+09:00 Ulf Hansson <ulf.hansson@linaro.org>:
>
> On 14 November 2017 at 03:48, Huijin Park <huijin.park@samsung.com> wrote:
> > Some eMMC products keep busy time a little longer intermittently.
> > (eg. prepare free blocks, garbage collection...)
> > In this case, we recommend to wait a little longer than fail.
>
> Is this an rpmb specific problem, because the code seems only to change that.
>
> Is it write and read or only write?
Yes. It's rpmb specific problem.
RPMB R/W use same flow. but only 'write' case makes the problem(long
busy state) sometimes.
When I test it, the 5~25ms is not enough although there is not max
busy time in the spec.

>
> >
> > Signed-off-by: Huijin Park <huijin.park@samsung.com>
> > ---
> >  drivers/mmc/core/block.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
> > index ea80ff4..b5b0fe6 100644
> > --- a/drivers/mmc/core/block.c
> > +++ b/drivers/mmc/core/block.c
> > @@ -584,7 +584,7 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
> >                  * Ensure RPMB command has completed by polling CMD13
> >                  * "Send Status".
> >                  */
> > -               err = ioctl_rpmb_card_status_poll(card, &status, 5);
> > +               err = ioctl_rpmb_card_status_poll(card, &status, 50);
>
> First, you are changing "re-tries" not a timeout value, which would
> seem like a better approach.
I will modify it. Thanks.

>
> Second, it seems like we should remove the
> ioctl_rpmb_card_status_poll() function altogether and instead make use
> of the more generic card_busy_detect() function here.
>
> Then if card_busy_detect() needs to be adopted to suite rpmb, then we
> should do that instead.
I agree that. But the two function are different a little.
'ioctl_rpmb_card_status_poll()' has interval(1~5ms) that prevent to
poll too frequently.
So I suggest to improve 'card_busy_detect()' about interval time in
another patch.
Then the 'ioctl_rpmb_card_status_poll()' can replaced by 'card_busy_detect()'

>
> >                 if (err)
> >                         dev_err(mmc_dev(card->host),
> >                                         "%s: Card Status=0x%08X, error %d\n",
> > --
> > 1.9.1
> >
>
> Kind regards
> Uffe

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mmc: card: increase wait time
  2017-11-20  4:50     ` Park Huijin
@ 2017-11-21  9:02       ` Ulf Hansson
  2017-11-21  9:34         ` Shawn Lin
  0 siblings, 1 reply; 8+ messages in thread
From: Ulf Hansson @ 2017-11-21  9:02 UTC (permalink / raw)
  To: Park Huijin; +Cc: Huijin Park, linux-mmc, Jungseung Lee

On 20 November 2017 at 05:50, Park Huijin <bbang.huijin.park@gmail.com> wrote:
> 2017-11-15 18:13 GMT+09:00 Ulf Hansson <ulf.hansson@linaro.org>:
>>
>> On 14 November 2017 at 03:48, Huijin Park <huijin.park@samsung.com> wrote:
>> > Some eMMC products keep busy time a little longer intermittently.
>> > (eg. prepare free blocks, garbage collection...)
>> > In this case, we recommend to wait a little longer than fail.
>>
>> Is this an rpmb specific problem, because the code seems only to change that.
>>
>> Is it write and read or only write?
> Yes. It's rpmb specific problem.
> RPMB R/W use same flow. but only 'write' case makes the problem(long
> busy state) sometimes.
> When I test it, the 5~25ms is not enough although there is not max
> busy time in the spec.

As a matter of fact this isn't specific to RPMB writes at all but to
all data writes. That's why we call card_busy_detect() after a data
write.

>
>>
>> >
>> > Signed-off-by: Huijin Park <huijin.park@samsung.com>
>> > ---
>> >  drivers/mmc/core/block.c | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
>> > index ea80ff4..b5b0fe6 100644
>> > --- a/drivers/mmc/core/block.c
>> > +++ b/drivers/mmc/core/block.c
>> > @@ -584,7 +584,7 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
>> >                  * Ensure RPMB command has completed by polling CMD13
>> >                  * "Send Status".
>> >                  */
>> > -               err = ioctl_rpmb_card_status_poll(card, &status, 5);
>> > +               err = ioctl_rpmb_card_status_poll(card, &status, 50);
>>
>> First, you are changing "re-tries" not a timeout value, which would
>> seem like a better approach.
> I will modify it. Thanks.
>
>>
>> Second, it seems like we should remove the
>> ioctl_rpmb_card_status_poll() function altogether and instead make use
>> of the more generic card_busy_detect() function here.
>>
>> Then if card_busy_detect() needs to be adopted to suite rpmb, then we
>> should do that instead.
> I agree that. But the two function are different a little.
> 'ioctl_rpmb_card_status_poll()' has interval(1~5ms) that prevent to
> poll too frequently.

Well, polling too frequently is then already a problem for the general
data writes. Isn't it?

Or you think RPMB may differ a bit in this regards?

> So I suggest to improve 'card_busy_detect()' about interval time in
> another patch.

Okay.

However, I don't think it's a stopper, you should be able to convert
RPMB to use card_busy_detect() as is. Then you can fix the polling
interval time on top.

What you do need to fix is that card_busy_detect() takes an struct
request *req as in-parameter, and uses it to print the disk_name. I
suggest to change the in-parameter to be the disk_name instead, that
way it would work for RPMB as well.

> Then the 'ioctl_rpmb_card_status_poll()' can replaced by 'card_busy_detect()'

Great!

[...]

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mmc: card: increase wait time
  2017-11-21  9:02       ` Ulf Hansson
@ 2017-11-21  9:34         ` Shawn Lin
  2017-11-21 11:38           ` Ulf Hansson
  0 siblings, 1 reply; 8+ messages in thread
From: Shawn Lin @ 2017-11-21  9:34 UTC (permalink / raw)
  To: Ulf Hansson, Park Huijin; +Cc: shawn.lin, Huijin Park, linux-mmc, Jungseung Lee

Hi Ulf,

On 2017/11/21 17:02, Ulf Hansson wrote:
> On 20 November 2017 at 05:50, Park Huijin <bbang.huijin.park@gmail.com> wrote:
>> 2017-11-15 18:13 GMT+09:00 Ulf Hansson <ulf.hansson@linaro.org>:
>>>
>>> On 14 November 2017 at 03:48, Huijin Park <huijin.park@samsung.com> wrote:
>>>> Some eMMC products keep busy time a little longer intermittently.
>>>> (eg. prepare free blocks, garbage collection...)
>>>> In this case, we recommend to wait a little longer than fail.
>>>
>>> Is this an rpmb specific problem, because the code seems only to change that.
>>>
>>> Is it write and read or only write?
>> Yes. It's rpmb specific problem.
>> RPMB R/W use same flow. but only 'write' case makes the problem(long
>> busy state) sometimes.
>> When I test it, the 5~25ms is not enough although there is not max
>> busy time in the spec.
> 
> As a matter of fact this isn't specific to RPMB writes at all but to
> all data writes. That's why we call card_busy_detect() after a data
> write.

Further more, we should cover all transfer pattern from userspace, not
just data writes. :)

https://www.spinics.net/lists/linux-mmc/msg46147.html


> 
>>
>>>
>>>>
>>>> Signed-off-by: Huijin Park <huijin.park@samsung.com>
>>>> ---
>>>>   drivers/mmc/core/block.c | 2 +-
>>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
>>>> index ea80ff4..b5b0fe6 100644
>>>> --- a/drivers/mmc/core/block.c
>>>> +++ b/drivers/mmc/core/block.c
>>>> @@ -584,7 +584,7 @@ static int __mmc_blk_ioctl_cmd(struct mmc_card *card, struct mmc_blk_data *md,
>>>>                   * Ensure RPMB command has completed by polling CMD13
>>>>                   * "Send Status".
>>>>                   */
>>>> -               err = ioctl_rpmb_card_status_poll(card, &status, 5);
>>>> +               err = ioctl_rpmb_card_status_poll(card, &status, 50);
>>>
>>> First, you are changing "re-tries" not a timeout value, which would
>>> seem like a better approach.
>> I will modify it. Thanks.
>>
>>>
>>> Second, it seems like we should remove the
>>> ioctl_rpmb_card_status_poll() function altogether and instead make use
>>> of the more generic card_busy_detect() function here.
>>>
>>> Then if card_busy_detect() needs to be adopted to suite rpmb, then we
>>> should do that instead.
>> I agree that. But the two function are different a little.
>> 'ioctl_rpmb_card_status_poll()' has interval(1~5ms) that prevent to
>> poll too frequently.
> 
> Well, polling too frequently is then already a problem for the general
> data writes. Isn't it?
> 
> Or you think RPMB may differ a bit in this regards?
> 
>> So I suggest to improve 'card_busy_detect()' about interval time in
>> another patch.
> 
> Okay.
> 
> However, I don't think it's a stopper, you should be able to convert
> RPMB to use card_busy_detect() as is. Then you can fix the polling
> interval time on top.
> 
> What you do need to fix is that card_busy_detect() takes an struct
> request *req as in-parameter, and uses it to print the disk_name. I
> suggest to change the in-parameter to be the disk_name instead, that
> way it would work for RPMB as well.
> 
>> Then the 'ioctl_rpmb_card_status_poll()' can replaced by 'card_busy_detect()'
> 
> Great!
> 
> [...]
> 
> Kind regards
> Uffe
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 
> 


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] mmc: card: increase wait time
  2017-11-21  9:34         ` Shawn Lin
@ 2017-11-21 11:38           ` Ulf Hansson
  0 siblings, 0 replies; 8+ messages in thread
From: Ulf Hansson @ 2017-11-21 11:38 UTC (permalink / raw)
  To: Shawn Lin; +Cc: Park Huijin, Huijin Park, linux-mmc, Jungseung Lee

On 21 November 2017 at 10:34, Shawn Lin <shawn.lin@rock-chips.com> wrote:
> Hi Ulf,
>
> On 2017/11/21 17:02, Ulf Hansson wrote:
>>
>> On 20 November 2017 at 05:50, Park Huijin <bbang.huijin.park@gmail.com>
>> wrote:
>>>
>>> 2017-11-15 18:13 GMT+09:00 Ulf Hansson <ulf.hansson@linaro.org>:
>>>>
>>>>
>>>> On 14 November 2017 at 03:48, Huijin Park <huijin.park@samsung.com>
>>>> wrote:
>>>>>
>>>>> Some eMMC products keep busy time a little longer intermittently.
>>>>> (eg. prepare free blocks, garbage collection...)
>>>>> In this case, we recommend to wait a little longer than fail.
>>>>
>>>>
>>>> Is this an rpmb specific problem, because the code seems only to change
>>>> that.
>>>>
>>>> Is it write and read or only write?
>>>
>>> Yes. It's rpmb specific problem.
>>> RPMB R/W use same flow. but only 'write' case makes the problem(long
>>> busy state) sometimes.
>>> When I test it, the 5~25ms is not enough although there is not max
>>> busy time in the spec.
>>
>>
>> As a matter of fact this isn't specific to RPMB writes at all but to
>> all data writes. That's why we call card_busy_detect() after a data
>> write.
>
>
> Further more, we should cover all transfer pattern from userspace, not
> just data writes. :)
>
> https://www.spinics.net/lists/linux-mmc/msg46147.html

Ack!

Kind regards
Uffe

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-11-21 11:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20171114024825eucas1p218873c4ff649c17d4061b6660aa6264f@eucas1p2.samsung.com>
2017-11-14  2:48 ` [PATCH] mmc: card: increase wait time Huijin Park
2017-11-14 12:44   ` Avri Altman
2017-11-15  4:52     ` Park Huijin
2017-11-15  9:13   ` Ulf Hansson
2017-11-20  4:50     ` Park Huijin
2017-11-21  9:02       ` Ulf Hansson
2017-11-21  9:34         ` Shawn Lin
2017-11-21 11:38           ` Ulf Hansson

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.