mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: "Christian Löhle" <CLoehle@hyperstone.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>
Cc: "marten.lindahl@axis.com" <marten.lindahl@axis.com>,
	"ulf.hansson@linaro.org" <ulf.hansson@linaro.org>
Subject: Re: [PATCH] mmc: dw_mmc: avoid long timeout if register invalid
Date: Fri, 24 Sep 2021 18:49:04 +0900	[thread overview]
Message-ID: <a8031e66-77a0-ae9b-d78d-daebc1d7dc47@samsung.com> (raw)
In-Reply-To: <bf19053cf6f547bcbb364975cda84c30@hyperstone.com>

Hi,

On 9/17/21 4:50 PM, Christian Löhle wrote:
> 
> Set the limit to 1s if the register is at reset value.
> 
> Signed-off-by: Christian Loehle <cloehle@hyperstone.com>
> ---
>  drivers/mmc/host/dw_mmc.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c
> index 6578cc64ae9e..cd9a6e0a7449 100644
> --- a/drivers/mmc/host/dw_mmc.c
> +++ b/drivers/mmc/host/dw_mmc.c
> @@ -1983,6 +1983,14 @@ static void dw_mci_set_drto(struct dw_mci *host)
>  	/* add a bit spare time */
>  	drto_ms += 10;
>  
> +	/*
> +	 * If TMOUT register still holds the reset value the above calculation
> +	 * would yield a timeout of over 167 seconds, limit it to 1000ms.
> +	 * Normal reads/writes should not take anywhere close to 120s.
> +	 */
> +	if (drto_ms > 120000)
> +		drto_ms = 1000;
> +

If dtrt_ms is 167sec, it means that bus_hz should be 0 or 1.
What value is your host->bus_hz?

Best Regards,
Jaehoon Chung

>  	spin_lock_irqsave(&host->irq_lock, irqflags);
>  	if (!test_bit(EVENT_DATA_COMPLETE, &host->pending_events))
>  		mod_timer(&host->dto_timer,
> 


  parent reply	other threads:[~2021-09-24  9:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210917075050epcas1p1962cd1c7c388b20ad17cb841461dae1b@epcas1p1.samsung.com>
2021-09-17  7:50 ` Christian Löhle
2021-09-17 13:41   ` Jesper Nilsson
2021-09-20  9:34     ` Christian Löhle
2021-09-24  9:49   ` Jaehoon Chung [this message]
2021-09-29  6:53     ` Christian Löhle
2021-10-01  0:15       ` Jaehoon Chung
2021-09-30  6:53   ` [PATCHv2] " Christian Löhle

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=a8031e66-77a0-ae9b-d78d-daebc1d7dc47@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=CLoehle@hyperstone.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=marten.lindahl@axis.com \
    --cc=ulf.hansson@linaro.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

all inboxes | Powered by JetHome®