From: Bean Huo <huobean@gmail.com>
To: Adrian Hunter <adrian.hunter@intel.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: Bean Huo <beanhuo@micron.com>,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/2] mmc: sdhci: Use the SW timer when the HW timer cannot meet the timeout value required by the device
Date: Tue, 28 Sep 2021 11:39:59 +0200 [thread overview]
Message-ID: <987cb93359dc95ce9fb387b755fadb0ab6eb98f9.camel@gmail.com> (raw)
In-Reply-To: <37497369a4cf5f729e7b3e31727a7d64be5482db.camel@gmail.com>
On Fri, 2021-09-24 at 23:33 +0200, Bean Huo wrote:
> On Fri, 2021-09-24 at 16:26 +0300, Adrian Hunter wrote:
> > On 24/09/21 4:08 pm, Bean Huo wrote:
> > > On Fri, 2021-09-24 at 15:17 +0300, Adrian Hunter wrote:
> > > > > > > sdhci_writeb(host, count,
> > > > > > > SDHCI_TIMEOUT_CONTROL);
> > > > > > > }
> > > > > > > The driver has detected that the hardware timer cannot
> > > > > > > meet
> > > > > > > the
> > > > > > > timeout
> > > > > > > requirements of the device, but we still use the hardware
> > > > > > > timer,
> > > > > > > which will
> > > > > > > allow potential timeout issuea . Rather than allowing a
> > > > > > > potential
> > > > > > > problem to exist, why can’t software timing be used to
> > > > > > > avoid
> > > > > > > this
> > > > > > > problem?
> > > > > > Timeouts aren't that accurate. The maximum is assumed
> > > > > > still
> > > > > > to
> > > > > > work.
> > > > > > mmc->max_busy_timeout is used to tell the core what the
> > > > > > maximum
> > > > > > is.
> > > > > mmc->max_busy_timeout is still a representation of Host HW
> > > > > timer
> > > > > maximum timeout count, isn't it?
> > > >
> > > > Not necessarily. For SDHCI_QUIRK2_DISABLE_HW_TIMEOUT it would
> > > > be
> > > >
> > > > set to zero to indicate no maximum.
> > >
> > > yes, this is the purpose of the patch, for the host controller
> > > without
> > > quirk SDHCI_QUIRK2_DISABLE_HW_TIMEOUT, if the timeout count
> > > required by
> > > device is beyond the HW timer max count, we choose SW timer to
> > > avoid the HW timer timeout IRQ.
> > >
> > > I don't know if I get it correctly.
> >
> > Why can't drivers that want the behaviour just set the quirk?
> >
> > Drivers that do not work with the quirk, do not have to set it.
>
> Adrian,
>
> We cannot add this quirk to every host driver. This is the difference
> on the device side. In addition, I don't know what the maximum
> hardware
> timer budget for each host is. Even if you use the same SOC, the
> maximum time budget on different platforms may be different.
>
> Assume that the maximum timeout time supported by the hardware timer
> is
> 100 milliseconds, but the maximum data transmission time required by
> the device is 150 milliseconds. In most cases, data transfer will not
> take so long. 150 is the maximum time under extreme conditions. This
> means that the device just needs to complete a data transfer within
> > 100ms and keep the data line busy. If we still use the HW timer, it
> will trigger a DATA LINE timeout interrupt.
>
> This patch does not affect scenarios where the hardware timer meets
> the
> max data transmission time requirements of the device. It will still
> use the hardware timer. Only when the device changes, will it switch
> to
> using the SW timer.
>
> Bean
>
Hi Adrian,
Would you please review this patch again and is it possible to be
accepted?
Bean
next prev parent reply other threads:[~2021-09-28 9:40 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210917172727.26834-1-huobean@gmail.com>
2021-09-17 17:27 ` [PATCH v1 1/2] mmc: sdhci: Return true only when timeout exceeds capacity of the HW timer Bean Huo
2021-09-24 6:32 ` Adrian Hunter
2021-09-27 22:31 ` Ulf Hansson
2021-09-17 17:27 ` [PATCH v1 2/2] mmc: sdhci: Use the SW timer when the HW timer cannot meet the timeout value required by the device Bean Huo
2021-09-24 5:29 ` Adrian Hunter
2021-09-24 9:17 ` Bean Huo
2021-09-24 10:07 ` Adrian Hunter
2021-09-24 11:45 ` Bean Huo
2021-09-24 12:17 ` Adrian Hunter
2021-09-24 13:08 ` Bean Huo
2021-09-24 13:26 ` Adrian Hunter
2021-09-24 21:33 ` Bean Huo
2021-09-28 9:39 ` Bean Huo [this message]
2021-09-28 10:18 ` Adrian Hunter
2021-09-29 10:49 ` Bean Huo
2021-09-29 12:38 ` Adrian Hunter
2021-09-30 8:34 ` Bean Huo
2021-09-30 8:59 ` Adrian Hunter
2021-09-30 9:02 ` Bean Huo
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=987cb93359dc95ce9fb387b755fadb0ab6eb98f9.camel@gmail.com \
--to=huobean@gmail.com \
--cc=adrian.hunter@intel.com \
--cc=beanhuo@micron.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--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