From patchwork Sun Jan 27 04:32:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Vasut X-Patchwork-Id: 215943 X-Patchwork-Delegate: afleming@freescale.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 6555B2C0082 for ; Sun, 27 Jan 2013 15:32:22 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D11D64A15E; Sun, 27 Jan 2013 05:32:18 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZJZS2B-+SIok; Sun, 27 Jan 2013 05:32:18 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 67E274A151; Sun, 27 Jan 2013 05:32:17 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E766A4A151 for ; Sun, 27 Jan 2013 05:32:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id n+8UlG-oPTIs for ; Sun, 27 Jan 2013 05:32:15 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9]) by theia.denx.de (Postfix) with ESMTPS id 5CC774A147 for ; Sun, 27 Jan 2013 05:32:14 +0100 (CET) Received: from frontend1.mail.m-online.net (unknown [192.168.8.180]) by mail-out.m-online.net (Postfix) with ESMTP id 3Yv1K94rTzz4KK78; Sun, 27 Jan 2013 05:32:13 +0100 (CET) X-Auth-Info: QtWInLnyVB4TugprKXCS4pF8LL3jB5Cye/1qO2/YBq0= Received: from mashiro.localnet (unknown [195.140.253.167]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-auth.mnet-online.de (Postfix) with ESMTPSA id 3Yv1K91W6bzbbg3; Sun, 27 Jan 2013 05:32:13 +0100 (CET) From: Marek Vasut To: Andy Fleming , u-boot@lists.denx.de Date: Sun, 27 Jan 2013 05:32:12 +0100 User-Agent: KMail/1.13.7 (Linux/3.7-trunk-amd64; KDE/4.8.4; x86_64; ; ) MIME-Version: 1.0 Message-Id: <201301270532.12393.marex@denx.de> Subject: [U-Boot] Possible MMC subsystem bug X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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;