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]
Date:   Tue, 28 Apr 2020 17:27:18 +0800
From:   "yong.mao@...iatek.com" <yong.mao@...iatek.com>
To:     Ulf Hansson <ulf.hansson@...aro.org>
CC:     <mka@...omium.org>, Chaotian Jing <chaotian.jing@...iatek.com>,
        "Matthias Brugger" <matthias.bgg@...il.com>,
        "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
        Linux ARM <linux-arm-kernel@...ts.infradead.org>,
        "moderated list:ARM/Mediatek SoC support" 
        <linux-mediatek@...ts.infradead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        srv_heupstream <srv_heupstream@...iatek.com>
Subject: Re: [PATCH 1/3] mmc: core: need do mmc_power_cycle in
 mmc_sdio_resend_if_cond


On Fri, 2020-04-24 at 12:09 +0200, Ulf Hansson wrote:
> On Tue, 14 Apr 2020 at 05:40, Yong Mao <yong.mao@...iatek.com> wrote:
> >
> > From: yong mao <yong.mao@...iatek.com>
> >
> > When mmc_sdio_resned_if_cond is invoked, it indicates the SDIO
> > device is not in the right state. In this condition, the previous
> > implementation of mmc_sdio_resend_if_cond can't make sure SDIO
> > device be back to idle state. mmc_power_cycle can reset the SDIO
> > device by HW and also make sure SDIO device enter to idle state
> > correctly.
> >
> > Signed-off-by: Yong Mao <yong.mao@...iatek.com>
> > ---
> >  drivers/mmc/core/sdio.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c
> > index ebb387a..ada0a80 100644
> > --- a/drivers/mmc/core/sdio.c
> > +++ b/drivers/mmc/core/sdio.c
> > @@ -546,6 +546,7 @@ static int mmc_sdio_init_uhs_card(struct mmc_card *card)
> >  static void mmc_sdio_resend_if_cond(struct mmc_host *host,
> >                                     struct mmc_card *card)
> >  {
> > +       mmc_power_cycle(host, host->card->ocr);
> 
> This looks wrong to me. mmc_sdio_resend_if_cond() is called from two places.
> 
> 1. In the case when mmc_set_uhs_voltage() fails in
> mmc_sdio_init_card(), which means a call to mmc_power_cycle() has
> already been done.
> 
  Thanks for your comment.
  Yes. It is right that mmc_power_cycle() has already been done when
  mmc_sdio_resend_if_cond() is called. In normal re-initialization case, 
  this mmc_power_cycle() (currently in 1.8v voltage and 208Mhz clock) 
  can make SDIO device really back to idle state. Unfortunately, in some
  special SDIO device, it will enter to unstable state.

  At this unstable state, device may keep data0 always low after receiving CMD11.
  And then every other SDIO CMD can't be sent to device any more due to card 
  is busy(data0 is low). Therefore, previous implementation can't save the 
  device. At this time, mmc_power_cycle() may be the final solution to make 
  sure SDIO device can back to idle state correctly.

> 2. Wen sdio_read_cccr() fails and when we decide to retry the UHS-I
> voltage switch. Then perhaps it could make sense to run a power cycle.
> But if so, we better do it only for that path.
> 
> I will continue to look a bit, as I think there are really more issues
> that we may want to look into while looking at this piece of code.
> However, allow me some more time before I can provide some more ideas
> of how to move forward.
  In the actual project, we do encounter many relative issues about re-initialized card.
  The following two categories are the most common issue we met before.
  A. the SDIO card is initialized by UHS-I mode at the first time, but will be 
     re-initialized by High Speed mode at the second time.
     ==> All this type of issues is relative with S18A in response of CMD5.
	 And most of the issues are related to the interval between powering off and 
         powering on card.
  B. If there is something wrong in the flow of voltage switch(after CMD11), card will
     always keep all data pins to low. And then it hangs up because data0 is always low.
  Hope this information will be helpful for you.
  
  Anyway, we will wait for your advises. 
> 
> >         sdio_reset(host);
> >         mmc_go_idle(host);
> >         mmc_send_if_cond(host, host->ocr_avail);
> > --
> > 1.9.1
> 
> Kind regards
> Uffe



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ