From: Adrian Hunter <adrian.hunter@intel.com>
To: sartgarg@codeaurora.org, Ulf Hansson <ulf.hansson@linaro.org>
Cc: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>,
Sahitya Tummala <stummala@codeaurora.org>,
linux-mmc@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-arm-msm <linux-arm-msm@vger.kernel.org>,
linux-mmc-owner@vger.kernel.org
Subject: Re: [PATCH V1 1/2] mmc: sdhci: Introduce new quirk to use reserved timeout
Date: Sun, 24 May 2020 18:57:42 +0300 [thread overview]
Message-ID: <eddfacfd-ecb6-fda3-5911-48e03046b8d5@intel.com> (raw)
In-Reply-To: <e27745b48566d3535bd1a1a6d8dbb9c4@codeaurora.org>
On 19/05/20 5:08 pm, sartgarg@codeaurora.org wrote:
> On 2020-05-18 18:20, Ulf Hansson wrote:
>> On Mon, 18 May 2020 at 13:45, Adrian Hunter <adrian.hunter@intel.com> wrote:
>>>
>>> On 18/05/20 12:39 pm, Ulf Hansson wrote:
>>> > On Wed, 6 May 2020 at 15:53, Sarthak Garg <sartgarg@codeaurora.org> wrote:
>>> >>
>>> >> Introduce a new quirk for letting vendor drivers to use reserved
>>> >> timeout value (0xF) in timeout control register.
>>> >>
>>> >> Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
>>> >> Signed-off-by: Sarthak Garg <sartgarg@codeaurora.org>
>>> >> ---
>>> >> drivers/mmc/host/sdhci.c | 3 ++-
>>> >> drivers/mmc/host/sdhci.h | 5 +++++
>>> >> 2 files changed, 7 insertions(+), 1 deletion(-)
>>> >>
>>> >> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
>>> >> index 1bb6b67..07528a9 100644
>>> >> --- a/drivers/mmc/host/sdhci.c
>>> >> +++ b/drivers/mmc/host/sdhci.c
>>> >> @@ -967,7 +967,8 @@ static u8 sdhci_calc_timeout(struct sdhci_host
>>> *host, struct mmc_command *cmd,
>>> >> }
>>> >>
>>> >> if (count >= 0xF) {
>>> >> - if (!(host->quirks2 & SDHCI_QUIRK2_DISABLE_HW_TIMEOUT))
>>> >> + if (!(host->quirks2 & SDHCI_QUIRK2_DISABLE_HW_TIMEOUT) ||
>>> >> + !(host->quirks2 & SDHCI_QUIRK2_USE_RESERVED_MAX_TIMEOUT))
>>> >
>>> > I don't quite get how this can make your variant use 0xF rather than 0xE?
>>> >
>>> > To me it looks like an updated conditional check to print a debug
>>> message, no?
>>>
>>> Probably need to introduce host->max_timeout_count, set it to 0xE in
>>> sdhci_alloc_host(), and change sdhci_calc_timeout() to use it in place of
>>> all the 0xE and 0xF constants.
>>
>> Yep, that seems like a reasonable approach to me as well.
>>
>> [...]
>>
>> Kind regards
>> Uffe
>
> Resending the mail again as can't see my comment on the
> https://patchwork.kernel.org/ page.
> Sorry for the mistake just want to update the logic as below.
> - count = 0xE;
> + if(!(host->quirks2 & SDHCI_QUIRK2_USE_RESERVED_MAX_TIMEOUT))
> + count = 0xE;
I think it is conceptually simpler to define SDHCI constants as variables
and let vendor drivers change them if need be. In other words, what I wrote
above. It changes more code, but the overall result is more consistent.
next prev parent reply other threads:[~2020-05-24 15:57 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-06 13:44 [PATCH V1 0/2] Introduce new quirk to use reserved timeout Sarthak Garg
2020-05-06 13:44 ` [PATCH V1 1/2] mmc: sdhci: " Sarthak Garg
2020-05-18 9:39 ` Ulf Hansson
2020-05-18 11:46 ` Adrian Hunter
2020-05-18 12:50 ` Ulf Hansson
2020-05-19 14:08 ` sartgarg
2020-05-24 15:57 ` Adrian Hunter [this message]
2020-05-06 13:44 ` [PATCH V1 2/2] mmc: sdhci-msm: Use maximum possible data timeout value Sarthak Garg
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=eddfacfd-ecb6-fda3-5911-48e03046b8d5@intel.com \
--to=adrian.hunter@intel.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc-owner@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=sartgarg@codeaurora.org \
--cc=stummala@codeaurora.org \
--cc=ulf.hansson@linaro.org \
--cc=vbadigan@codeaurora.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;
as well as URLs for NNTP newsgroup(s).