From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marek Vasut Date: Sun, 27 Jan 2013 05:49:12 +0100 Subject: [U-Boot] Possible MMC subsystem bug In-Reply-To: <7A2BA75C-089D-453F-80BB-0B6D2371A06A@freescale.com> References: <201301270532.12393.marex@denx.de> <7A2BA75C-089D-453F-80BB-0B6D2371A06A@freescale.com> Message-ID: <201301270549.12233.marex@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Fleming Andy-AFLEMING, > I'll need to double-check the spec, but I believe the BUSY bit has the > opposite meaning of common sense. I tihnk my brain is maybe just giving up really ... I think the code is right after some quick poking through the spec. > On Jan 26, 2013, at 22:32, "Marek Vasut" wrote: > > Hi Andy, > > > > I was going through the MMC code, trying to get Phison 8007 SD-to-NAND > > bridge working (don't ask please, this chip's sole existence defies any > > logic). > > > > So, I found the following code and I was wondering if the following patch > > is not needed. Maybe my brain is just giving up though. Give it some > > thought please and let me know, thanks! > > > > diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c > > index 72e8ce6..94926ca 100644 > > --- a/drivers/mmc/mmc.c > > +++ b/drivers/mmc/mmc.c > > @@ -475,8 +474,11 @@ static int sd_send_op_cond(struct mmc *mmc) > > > > if (err) > > > > return err; > > > > + if (!(cmd.response[0] & OCR_BUSY)) > > + break; > > + > > > > udelay(1000); > > > > - } while ((!(cmd.response[0] & OCR_BUSY)) && timeout--); > > + } while (timeout--); > > > > if (timeout <= 0) > > > > return UNUSABLE_ERR; Best regards, Marek Vasut