lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAPDyKFp=prNyPE8hT_9irx0DyFCboF8Ms6uh4Euxe0oyPq79fg@mail.gmail.com>
Date: Thu, 25 Apr 2024 18:59:22 +0200
From: Ulf Hansson <ulf.hansson@...aro.org>
To: Ricky WU <ricky_wu@...ltek.com>
Cc: "wenchao.chen@...soc.com" <wenchao.chen@...soc.com>, "ricardo@...liere.net" <ricardo@...liere.net>, 
	"marex@...x.de" <marex@...x.de>, "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>, 
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mmc: core: resume not check card exist before powerup

On Fri, 19 Apr 2024 at 08:53, Ricky WU <ricky_wu@...ltek.com> wrote:
>
> Soft reminder
>
> If this solution, you still have concert on sd.c.
> can we just do this check card flow in mmc host power up call_back?
>
> > > >
> > > > _mmc_sd_resume
> > > > add get_cd before call powerup, make sure the card exist
> > >
> > > Please elaborate more on what problem you are trying to solve, the
> > > above doesn't make much sense to me, sorry.
> > >
> > > Yes, the card may be removed while the system is suspended. Then, even
> > > if ->get_cd() indicates that there is no card inserted in the
> > > SD-card-slot, we may still have the card being registered - and then
> > > we need to unregister it.
> > > That said, we need to call mmc_power_up() in order to try to
> > > communicate with the card again. At least that is what the
> > > mmc_rescan() work assumes when it runs the bus_ops->detect() callback
> > > at some point later in time.
> > >
> >
> > We saw the power up in a short time from waveform when removing the card,
> > So we saw mmc_sd_resume call the power up did not check the card exist.

Well, that doesn't really tell me if that is a problem or not?

Doesn't the first command sent to the SD card (that has been removed)
fail if there is no card inserted anyway?

> >
> > We think this the short time power up maybe cause OCP if no card exist.

OCP?

> > And this power up we think is unnecessary when no card exist.

It may not be necessary, but in what way does it hurt?

> >
> >
> > > >
> > > > Signed-off-by: Ricky Wu <ricky_wu@...ltek.com>
> > > > ---
> > > >  drivers/mmc/core/sd.c | 3 +++
> > > >  1 file changed, 3 insertions(+)
> > > >
> > > > diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c index
> > > > 1c8148cdda50..35e036672cfb 100644
> > > > --- a/drivers/mmc/core/sd.c
> > > > +++ b/drivers/mmc/core/sd.c
> > > > @@ -1750,6 +1750,9 @@ static int _mmc_sd_resume(struct mmc_host
> > > *host)
> > > >         if (!mmc_card_suspended(host->card))
> > > >                 goto out;
> > > >
> > > > +       if (host->ops->get_cd && !host->ops->get_cd(host))
> > > > +               goto out;
> > > > +
> > > >         mmc_power_up(host, host->card->ocr);
> > > >         err = mmc_sd_init_card(host, host->card->ocr, host->card);
> > > >         mmc_card_clr_suspended(host->card);
> > > > --

Kind regards
Uffe

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ