From: Inochi Amaoto <inochiama@gmail.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>,
Inochi Amaoto <inochiama@gmail.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
Karol Gugala <kgugala@antmicro.com>,
Mateusz Holenko <mholenko@antmicro.com>,
Gabriel Somlo <gsomlo@gmail.com>, Joel Stanley <joel@jms.id.au>,
Maciej Dudek <mdudek@internships.antmicro.com>,
Kamil Rakoczy <krakoczy@antmicro.com>,
linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
Yixun Lan <dlan@gentoo.org>, Longbin Li <looong.bin@gmail.com>
Subject: Re: [PATCH] mmc: litex_mmc: Set mandatory idle clocks before CMD0
Date: Tue, 21 Apr 2026 17:39:38 +0800 [thread overview]
Message-ID: <aedFmiR28hohdtZq@inochi.infowork> (raw)
In-Reply-To: <CAHp75Vf8DN-FY=DKrcid5rPk-tM6o4mxyPLuYGEsNUqrksEdPw@mail.gmail.com>
On Tue, Apr 21, 2026 at 12:01:57PM +0300, Andy Shevchenko wrote:
> On Tue, Apr 21, 2026 at 5:51 AM Inochi Amaoto <inochiama@gmail.com> wrote:
> >
> > The litex_mmc driver assumes the card is already probed in the BIOS
> > and skip the phy initialization. This will cause the command fail
> > like the following when the old card is unplugged and then insert
> > a new card:
> >
> > [ 62.923593] litex-mmc f0004000.mmc: Command (cmd 8) error, status -110
> > [ 62.949717] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110
> > [ 62.976606] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110
> > [ 63.002516] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110
> > [ 63.028442] litex-mmc f0004000.mmc: Command (cmd 55) error, status -110
> >
> > Add required clock settings and initialization for the CMD 0, so it can
> > probe the new card.
>
> ...
>
> > static int litex_mmc_send_cmd(struct litex_mmc_host *host,
>
> > int ret;
> > u8 evt;
> >
> > + if (cmd == MMC_GO_IDLE_STATE) {
> > + litex_mmc_setclk(host, SD_INIT_CLK_HZ);
> > + litex_write8(host->sdphy + LITEX_PHY_INITIALIZE, 1);
>
> > + udelay(SD_INIT_DELAY_US);
>
> Why is it atomic? I see no evidence this function requires an atomic
> context. Please, use fsleep().
>
Thank, it is my mistake. This function does not require atomic context.
I will fix it in the v2.
Regards,
Inochi
prev parent reply other threads:[~2026-04-21 9:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-21 2:50 [PATCH] mmc: litex_mmc: Set mandatory idle clocks before CMD0 Inochi Amaoto
2026-04-21 9:01 ` Andy Shevchenko
2026-04-21 9:39 ` Inochi Amaoto [this message]
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=aedFmiR28hohdtZq@inochi.infowork \
--to=inochiama@gmail.com \
--cc=andy.shevchenko@gmail.com \
--cc=dlan@gentoo.org \
--cc=gsomlo@gmail.com \
--cc=joel@jms.id.au \
--cc=kgugala@antmicro.com \
--cc=krakoczy@antmicro.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=looong.bin@gmail.com \
--cc=mdudek@internships.antmicro.com \
--cc=mholenko@antmicro.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