From: Baolin Wang <baolin.wang@linux.alibaba.com>
To: Wenchao Chen <wenchao.chen666@gmail.com>,
Ulf Hansson <ulf.hansson@linaro.org>
Cc: Wenchao Chen <wenchao.chen@unisoc.com>,
zhang.lyra@gmail.com, orsonzhai@gmail.com,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
zhenxiong.lai@unisoc.com, yuelin.tang@unisoc.com
Subject: Re: [PATCH] mmc: sprd: Fix eMMC init failure after hw reset
Date: Tue, 12 Dec 2023 10:57:16 +0800 [thread overview]
Message-ID: <7541f17a-f0a7-486b-9664-3573623d7154@linux.alibaba.com> (raw)
In-Reply-To: <CA+Da2qyB2tQjq5wxoqNwjb5HXhdPHMsWN08Ot7nMEkZzOgQ9LA@mail.gmail.com>
On 12/8/2023 7:52 PM, Wenchao Chen wrote:
> On Thu, 7 Dec 2023 at 21:59, Ulf Hansson <ulf.hansson@linaro.org> wrote:
>>
>> On Mon, 4 Dec 2023 at 07:50, Wenchao Chen <wenchao.chen@unisoc.com> wrote:
>>>
>>> Some eMMC devices that do not close the auto clk gate
>>> after hw reset will cause eMMC initialization to fail.
>>>
>>> Signed-off-by: Wenchao Chen <wenchao.chen@unisoc.com>
>>
>> I assume we want this tagged for stable kernels too, but do we have a
>> corresponding fixes commit that we can point out?
>>
>> Kind regards
>> Uffe
>>
>
> Hi Uffe
> Sorry, I forgot to add fixes commit.
>
> Fixes: ff874dbc4f86 ("mmc: sdhci-sprd: Disable CLK_AUTO when the clock
> is less than 400K")
With the Fixes tag, looks goo to me.
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
>>> ---
>>> drivers/mmc/host/sdhci-sprd.c | 10 +++++++---
>>> 1 file changed, 7 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/mmc/host/sdhci-sprd.c b/drivers/mmc/host/sdhci-sprd.c
>>> index 6b8a57e2d20f..bed57a1c64b5 100644
>>> --- a/drivers/mmc/host/sdhci-sprd.c
>>> +++ b/drivers/mmc/host/sdhci-sprd.c
>>> @@ -239,15 +239,19 @@ static inline void _sdhci_sprd_set_clock(struct sdhci_host *host,
>>> div = ((div & 0x300) >> 2) | ((div & 0xFF) << 8);
>>> sdhci_enable_clk(host, div);
>>>
>>> + val = sdhci_readl(host, SDHCI_SPRD_REG_32_BUSY_POSI);
>>> + mask = SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN | SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN;
>>> /* Enable CLK_AUTO when the clock is greater than 400K. */
>>> if (clk > 400000) {
>>> - val = sdhci_readl(host, SDHCI_SPRD_REG_32_BUSY_POSI);
>>> - mask = SDHCI_SPRD_BIT_OUTR_CLK_AUTO_EN |
>>> - SDHCI_SPRD_BIT_INNR_CLK_AUTO_EN;
>>> if (mask != (val & mask)) {
>>> val |= mask;
>>> sdhci_writel(host, val, SDHCI_SPRD_REG_32_BUSY_POSI);
>>> }
>>> + } else {
>>> + if (val & mask) {
>>> + val &= ~mask;
>>> + sdhci_writel(host, val, SDHCI_SPRD_REG_32_BUSY_POSI);
>>> + }
>>> }
>>> }
>>>
>>> --
>>> 2.17.1
>>>
next prev parent reply other threads:[~2023-12-12 2:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-04 6:49 Wenchao Chen
2023-12-07 13:58 ` Ulf Hansson
2023-12-08 11:52 ` Wenchao Chen
2023-12-12 2:57 ` Baolin Wang [this message]
2024-01-03 1:40 ` Wenchao Chen
2024-01-03 10:27 ` Ulf Hansson
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=7541f17a-f0a7-486b-9664-3573623d7154@linux.alibaba.com \
--to=baolin.wang@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=orsonzhai@gmail.com \
--cc=ulf.hansson@linaro.org \
--cc=wenchao.chen666@gmail.com \
--cc=wenchao.chen@unisoc.com \
--cc=yuelin.tang@unisoc.com \
--cc=zhang.lyra@gmail.com \
--cc=zhenxiong.lai@unisoc.com \
/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®