diff mbox

[v2] mmc: tmio: Fix timeout value for command request

Message ID 1437323999-7938-1-git-send-email-ykaneko0929@gmail.com (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Yoshihiro Kaneko July 19, 2015, 4:39 p.m. UTC
From: Takeshi Kihara <takeshi.kihara.df@renesas.com>

Fix the problem which timeout occurs at the time of command request with
several cards.

The timeout value was insufficient as a verification of several cards,
so it was changed 5 seconds from 2 seconds.

Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
---

This patch is based on mmc-next branch of Ulf Hansson's mmc tree.

v2 [Yoshihiro Kaneko]
* As suggested by Wolfram Sang
- use a definition instead of a magic value

 drivers/mmc/host/tmio_mmc_pio.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Comments

Leon Romanovsky July 20, 2015, 5:03 a.m. UTC | #1
On Sun, Jul 19, 2015 at 7:39 PM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> From: Takeshi Kihara <takeshi.kihara.df@renesas.com>
>
> Fix the problem which timeout occurs at the time of command request with
> several cards.
Hi Yoshihiro,
I afraid that I missed the answer to my concern about such cards [1].
It is good to write this information in commit message and/or comment
in the code.

It is extremely valuable to know which cards are required x2.5 timeout increase.

[1] http://www.spinics.net/lists/linux-mmc/msg32295.html

>
> The timeout value was insufficient as a verification of several cards,
> so it was changed 5 seconds from 2 seconds.
>
> Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
> ---
>
> This patch is based on mmc-next branch of Ulf Hansson's mmc tree.
>
> v2 [Yoshihiro Kaneko]
> * As suggested by Wolfram Sang
> - use a definition instead of a magic value
>
>  drivers/mmc/host/tmio_mmc_pio.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index e3dcf31..a10fde4 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -83,6 +83,8 @@ static int tmio_mmc_next_sg(struct tmio_mmc_host *host)
>         return --host->sg_len;
>  }
>
> +#define CMDREQ_TIMEOUT 5000
> +
>  #ifdef CONFIG_MMC_DEBUG
>
>  #define STATUS_TO_TEXT(a, status, i) \
> @@ -230,7 +232,7 @@ static void tmio_mmc_reset_work(struct work_struct *work)
>          */
>         if (IS_ERR_OR_NULL(mrq)
>             || time_is_after_jiffies(host->last_req_ts +
> -               msecs_to_jiffies(2000))) {
> +               msecs_to_jiffies(CMDREQ_TIMEOUT))) {
>                 spin_unlock_irqrestore(&host->lock, flags);
>                 return;
>         }
> @@ -818,7 +820,7 @@ static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
>         ret = tmio_mmc_start_command(host, mrq->cmd);
>         if (!ret) {
>                 schedule_delayed_work(&host->delayed_reset_work,
> -                                     msecs_to_jiffies(2000));
> +                                     msecs_to_jiffies(CMDREQ_TIMEOUT));
>                 return;
>         }
>
> --
> 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
Yoshihiro Kaneko July 20, 2015, 2:08 p.m. UTC | #2
Hi Leon,

2015-07-20 14:03 GMT+09:00 Leon Romanovsky <leon@leon.nu>:
> On Sun, Jul 19, 2015 at 7:39 PM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
>> From: Takeshi Kihara <takeshi.kihara.df@renesas.com>
>>
>> Fix the problem which timeout occurs at the time of command request with
>> several cards.
> Hi Yoshihiro,
> I afraid that I missed the answer to my concern about such cards [1].
> It is good to write this information in commit message and/or comment
> in the code.
>
> It is extremely valuable to know which cards are required x2.5 timeout increase.

I apologize for the lack of information.
However, I have not yet obtained information about which cards corresponds to.
I intend to update the commit message if I obtain information.

Thanks,
Kaneko

>
> [1] http://www.spinics.net/lists/linux-mmc/msg32295.html
>
>>
>> The timeout value was insufficient as a verification of several cards,
>> so it was changed 5 seconds from 2 seconds.
>>
>> Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
>> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
>> ---
>>
>> This patch is based on mmc-next branch of Ulf Hansson's mmc tree.
>>
>> v2 [Yoshihiro Kaneko]
>> * As suggested by Wolfram Sang
>> - use a definition instead of a magic value
>>
>>  drivers/mmc/host/tmio_mmc_pio.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
>> index e3dcf31..a10fde4 100644
>> --- a/drivers/mmc/host/tmio_mmc_pio.c
>> +++ b/drivers/mmc/host/tmio_mmc_pio.c
>> @@ -83,6 +83,8 @@ static int tmio_mmc_next_sg(struct tmio_mmc_host *host)
>>         return --host->sg_len;
>>  }
>>
>> +#define CMDREQ_TIMEOUT 5000
>> +
>>  #ifdef CONFIG_MMC_DEBUG
>>
>>  #define STATUS_TO_TEXT(a, status, i) \
>> @@ -230,7 +232,7 @@ static void tmio_mmc_reset_work(struct work_struct *work)
>>          */
>>         if (IS_ERR_OR_NULL(mrq)
>>             || time_is_after_jiffies(host->last_req_ts +
>> -               msecs_to_jiffies(2000))) {
>> +               msecs_to_jiffies(CMDREQ_TIMEOUT))) {
>>                 spin_unlock_irqrestore(&host->lock, flags);
>>                 return;
>>         }
>> @@ -818,7 +820,7 @@ static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
>>         ret = tmio_mmc_start_command(host, mrq->cmd);
>>         if (!ret) {
>>                 schedule_delayed_work(&host->delayed_reset_work,
>> -                                     msecs_to_jiffies(2000));
>> +                                     msecs_to_jiffies(CMDREQ_TIMEOUT));
>>                 return;
>>         }
>>
>> --
>> 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
>
>
>
> --
> Leon Romanovsky | Independent Linux Consultant
>         www.leon.nu | leon@leon.nu
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Leon Romanovsky July 20, 2015, 7:33 p.m. UTC | #3
On Mon, Jul 20, 2015 at 5:08 PM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> Hi Leon,
>
> 2015-07-20 14:03 GMT+09:00 Leon Romanovsky <leon@leon.nu>:
>> On Sun, Jul 19, 2015 at 7:39 PM, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
>>> From: Takeshi Kihara <takeshi.kihara.df@renesas.com>
>>>
>>> Fix the problem which timeout occurs at the time of command request with
>>> several cards.
>> Hi Yoshihiro,
>> I afraid that I missed the answer to my concern about such cards [1].
>> It is good to write this information in commit message and/or comment
>> in the code.
>>
>> It is extremely valuable to know which cards are required x2.5 timeout increase.
>
> I apologize for the lack of information.
> However, I have not yet obtained information about which cards corresponds to.
> I intend to update the commit message if I obtain information.
Please don't hesitate to resend this patch when you will get such information.

Thanks.


>
> Thanks,
> Kaneko
>
>>
>> [1] http://www.spinics.net/lists/linux-mmc/msg32295.html
>>
>>>
>>> The timeout value was insufficient as a verification of several cards,
>>> so it was changed 5 seconds from 2 seconds.
>>>
>>> Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
>>> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
>>> ---
>>>
>>> This patch is based on mmc-next branch of Ulf Hansson's mmc tree.
>>>
>>> v2 [Yoshihiro Kaneko]
>>> * As suggested by Wolfram Sang
>>> - use a definition instead of a magic value
>>>
>>>  drivers/mmc/host/tmio_mmc_pio.c | 6 ++++--
>>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
>>> index e3dcf31..a10fde4 100644
>>> --- a/drivers/mmc/host/tmio_mmc_pio.c
>>> +++ b/drivers/mmc/host/tmio_mmc_pio.c
>>> @@ -83,6 +83,8 @@ static int tmio_mmc_next_sg(struct tmio_mmc_host *host)
>>>         return --host->sg_len;
>>>  }
>>>
>>> +#define CMDREQ_TIMEOUT 5000
>>> +
>>>  #ifdef CONFIG_MMC_DEBUG
>>>
>>>  #define STATUS_TO_TEXT(a, status, i) \
>>> @@ -230,7 +232,7 @@ static void tmio_mmc_reset_work(struct work_struct *work)
>>>          */
>>>         if (IS_ERR_OR_NULL(mrq)
>>>             || time_is_after_jiffies(host->last_req_ts +
>>> -               msecs_to_jiffies(2000))) {
>>> +               msecs_to_jiffies(CMDREQ_TIMEOUT))) {
>>>                 spin_unlock_irqrestore(&host->lock, flags);
>>>                 return;
>>>         }
>>> @@ -818,7 +820,7 @@ static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
>>>         ret = tmio_mmc_start_command(host, mrq->cmd);
>>>         if (!ret) {
>>>                 schedule_delayed_work(&host->delayed_reset_work,
>>> -                                     msecs_to_jiffies(2000));
>>> +                                     msecs_to_jiffies(CMDREQ_TIMEOUT));
>>>                 return;
>>>         }
>>>
>>> --
>>> 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
>>
>>
>>
>> --
>> Leon Romanovsky | Independent Linux Consultant
>>         www.leon.nu | leon@leon.nu
Ulf Hansson Aug. 25, 2015, 12:03 p.m. UTC | #4
On 19 July 2015 at 18:39, Yoshihiro Kaneko <ykaneko0929@gmail.com> wrote:
> From: Takeshi Kihara <takeshi.kihara.df@renesas.com>
>
> Fix the problem which timeout occurs at the time of command request with
> several cards.
>
> The timeout value was insufficient as a verification of several cards,
> so it was changed 5 seconds from 2 seconds.
>
> Signed-off-by: Takeshi Kihara <takeshi.kihara.df@renesas.com>
> Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>

Thanks, applied for next!

Kind regards
Uffe

> ---
>
> This patch is based on mmc-next branch of Ulf Hansson's mmc tree.
>
> v2 [Yoshihiro Kaneko]
> * As suggested by Wolfram Sang
> - use a definition instead of a magic value
>
>  drivers/mmc/host/tmio_mmc_pio.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
> index e3dcf31..a10fde4 100644
> --- a/drivers/mmc/host/tmio_mmc_pio.c
> +++ b/drivers/mmc/host/tmio_mmc_pio.c
> @@ -83,6 +83,8 @@ static int tmio_mmc_next_sg(struct tmio_mmc_host *host)
>         return --host->sg_len;
>  }
>
> +#define CMDREQ_TIMEOUT 5000
> +
>  #ifdef CONFIG_MMC_DEBUG
>
>  #define STATUS_TO_TEXT(a, status, i) \
> @@ -230,7 +232,7 @@ static void tmio_mmc_reset_work(struct work_struct *work)
>          */
>         if (IS_ERR_OR_NULL(mrq)
>             || time_is_after_jiffies(host->last_req_ts +
> -               msecs_to_jiffies(2000))) {
> +               msecs_to_jiffies(CMDREQ_TIMEOUT))) {
>                 spin_unlock_irqrestore(&host->lock, flags);
>                 return;
>         }
> @@ -818,7 +820,7 @@ static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
>         ret = tmio_mmc_start_command(host, mrq->cmd);
>         if (!ret) {
>                 schedule_delayed_work(&host->delayed_reset_work,
> -                                     msecs_to_jiffies(2000));
> +                                     msecs_to_jiffies(CMDREQ_TIMEOUT));
>                 return;
>         }
>
> --
> 1.9.1
>
--
To unsubscribe from this list: send the line "unsubscribe linux-sh" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/mmc/host/tmio_mmc_pio.c b/drivers/mmc/host/tmio_mmc_pio.c
index e3dcf31..a10fde4 100644
--- a/drivers/mmc/host/tmio_mmc_pio.c
+++ b/drivers/mmc/host/tmio_mmc_pio.c
@@ -83,6 +83,8 @@  static int tmio_mmc_next_sg(struct tmio_mmc_host *host)
 	return --host->sg_len;
 }
 
+#define CMDREQ_TIMEOUT	5000
+
 #ifdef CONFIG_MMC_DEBUG
 
 #define STATUS_TO_TEXT(a, status, i) \
@@ -230,7 +232,7 @@  static void tmio_mmc_reset_work(struct work_struct *work)
 	 */
 	if (IS_ERR_OR_NULL(mrq)
 	    || time_is_after_jiffies(host->last_req_ts +
-		msecs_to_jiffies(2000))) {
+		msecs_to_jiffies(CMDREQ_TIMEOUT))) {
 		spin_unlock_irqrestore(&host->lock, flags);
 		return;
 	}
@@ -818,7 +820,7 @@  static void tmio_mmc_request(struct mmc_host *mmc, struct mmc_request *mrq)
 	ret = tmio_mmc_start_command(host, mrq->cmd);
 	if (!ret) {
 		schedule_delayed_work(&host->delayed_reset_work,
-				      msecs_to_jiffies(2000));
+				      msecs_to_jiffies(CMDREQ_TIMEOUT));
 		return;
 	}