From patchwork Mon Dec 30 08:20:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Haijun.Zhang" X-Patchwork-Id: 305755 X-Patchwork-Delegate: panto@antoniou-consulting.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 395862C00E5 for ; Mon, 30 Dec 2013 20:48:20 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 8150B4AC4D; Mon, 30 Dec 2013 10:48: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 Y4m8yDpW2PNv; Mon, 30 Dec 2013 10:48:18 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7FD214AD9D; Mon, 30 Dec 2013 10:47:59 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 291314AD9A for ; Mon, 30 Dec 2013 10:47:53 +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 TKSYX1IHk3yb for ; Mon, 30 Dec 2013 10:47:48 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=SKIP(-1.5) (only DNSBL check requested) Received: from ch1outboundpool.messaging.microsoft.com (ch1ehsobe004.messaging.microsoft.com [216.32.181.184]) by theia.denx.de (Postfix) with ESMTPS id 2149B4AC4D for ; Mon, 30 Dec 2013 10:47:40 +0100 (CET) Received: from mail119-ch1-R.bigfish.com (10.43.68.246) by CH1EHSOBE014.bigfish.com (10.43.70.64) with Microsoft SMTP Server id 14.1.225.22; Mon, 30 Dec 2013 09:47:39 +0000 Received: from mail119-ch1 (localhost [127.0.0.1]) by mail119-ch1-R.bigfish.com (Postfix) with ESMTP id 751FB4E024F; Mon, 30 Dec 2013 09:47:39 +0000 (UTC) X-Forefront-Antispam-Report: CIP:70.37.183.190; KIP:(null); UIP:(null); IPV:NLI; H:mail.freescale.net; RD:none; EFVD:NLI X-SpamScore: 0 X-BigFish: VS0(zzzz1f42h2148h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h2189h1d1ah1d2ah1fc6hzz1de098h8275bh1de097hz2dh2a8h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh2222h224fh1fb3h1d0ch1d2eh1d3fh1dfeh1dffh1e23h1fe8h1ff5h2218h2216h226dh22d0h2327h2336h1155h) Received: from mail119-ch1 (localhost.localdomain [127.0.0.1]) by mail119-ch1 (MessageSwitch) id 1388396857948499_9410; Mon, 30 Dec 2013 09:47:37 +0000 (UTC) Received: from CH1EHSMHS007.bigfish.com (snatpool1.int.messaging.microsoft.com [10.43.68.245]) by mail119-ch1.bigfish.com (Postfix) with ESMTP id E10A16004C; Mon, 30 Dec 2013 09:47:37 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CH1EHSMHS007.bigfish.com (10.43.70.7) with Microsoft SMTP Server (TLS) id 14.16.227.3; Mon, 30 Dec 2013 09:47:37 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-005.039d.mgd.msft.net (10.84.1.17) with Microsoft SMTP Server (TLS) id 14.3.158.2; Mon, 30 Dec 2013 09:47:36 +0000 Received: from Tank.am.freescale.net (tank.ap.freescale.net [10.193.20.104]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id rBU9lBv5014907; Mon, 30 Dec 2013 02:47:33 -0700 From: Haijun Zhang To: , , Date: Mon, 30 Dec 2013 16:20:56 +0800 Message-ID: <1388391658-28560-5-git-send-email-haijun.zhang@freescale.com> X-Mailer: git-send-email 1.8.4.1 In-Reply-To: <1388391658-28560-1-git-send-email-haijun.zhang@freescale.com> References: <1388391658-28560-1-git-send-email-haijun.zhang@freescale.com> MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-FOPE-CONNECTOR: Id%0$Dn%*$RO%0$TLS%0$FQDN%$TlsDn% X-FOPE-CONNECTOR: Id%0$Dn%FREESCALE.MAIL.ONMICROSOFT.COM$RO%1$TLS%0$FQDN%$TlsDn% Cc: Haijun Zhang , jh80.chung@samsung.com, trini@ti.com, X.Xie@freescale.com, scottwood@freescale.com Subject: [U-Boot] [PATCH 5/7 V5] mmc: Enhance mmcinfo command 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 Once mmc initialization was failed has_init should be cleared to 0, prepare for the next initialization. Once mmcinfo command failed, error should be reported instead of printing incorrect mmc device information. Error log: => mmcinfo Device: FSL_SDHC Manufacturer ID: 0 OEM: 0 Name: Tran Speed: 0 Rd Block Len: 0 MMC version 0.0 High Capacity: No Capacity: 0 Bytes Bus Width: 1-bit => mmcinfo Device: FSL_SDHC Manufacturer ID: 0 OEM: 0 Name: Tran Speed: 0 Rd Block Len: 0 MMC version 0.0 High Capacity: No Capacity: 0 Bytes Bus Width: 1-bit Signed-off-by: Haijun Zhang --- changes for V5 - no changes common/cmd_mmc.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index d83d1e2..94eb4a0 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -115,7 +115,8 @@ static int do_mmcinfo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) mmc = find_mmc_device(curr_device); if (mmc) { - mmc_init(mmc); + if (mmc_init(mmc)) + return 1; print_mmcinfo(mmc); return 0; @@ -191,9 +192,10 @@ static int do_mmcops(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) mmc->has_init = 0; - if (mmc_init(mmc)) + if (mmc_init(mmc)) { + mmc->has_init = 0; return 1; - else + } else return 0; } else if (strncmp(argv[1], "part", 4) == 0) { block_dev_desc_t *mmc_dev;