From patchwork Fri Nov 8 02:07:01 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Haijun.Zhang" X-Patchwork-Id: 289669 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 32FD02C00A9 for ; Fri, 8 Nov 2013 13:53:59 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DFDF34A43E; Fri, 8 Nov 2013 03:53:40 +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 2pNOM7Tx09eK; Fri, 8 Nov 2013 03:53:40 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6A5024A3F5; Fri, 8 Nov 2013 03:53:10 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 518684A3C0 for ; Fri, 8 Nov 2013 03:51:32 +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 qKFP8X75ryiK for ; Fri, 8 Nov 2013 03:51:27 +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 db8outboundpool.messaging.microsoft.com (mail-db8lp0184.outbound.messaging.microsoft.com [213.199.154.184]) by theia.denx.de (Postfix) with ESMTPS id 723924A3BB for ; Fri, 8 Nov 2013 03:51:27 +0100 (CET) Received: from mail32-db8-R.bigfish.com (10.174.8.234) by DB8EHSOBE036.bigfish.com (10.174.4.99) with Microsoft SMTP Server id 14.1.225.22; Fri, 8 Nov 2013 02:51:25 +0000 Received: from mail32-db8 (localhost [127.0.0.1]) by mail32-db8-R.bigfish.com (Postfix) with ESMTP id 7CDA26C0304; Fri, 8 Nov 2013 02:51:25 +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(zzzz1f42h2148h208ch1ee6h1de0h1fdah2073h2146h1202h1e76h1d1ah1d2ah1fc6hzz1de098h8275bh1de097hz2dh2a8h839he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1b2fh2222h224fh1fb3h1d0ch1d2eh1d3fh1dfeh1dffh1e23h1fe8h1ff5h2218h2216h1155h) Received: from mail32-db8 (localhost.localdomain [127.0.0.1]) by mail32-db8 (MessageSwitch) id 1383879082902338_24180; Fri, 8 Nov 2013 02:51:22 +0000 (UTC) Received: from DB8EHSMHS005.bigfish.com (unknown [10.174.8.227]) by mail32-db8.bigfish.com (Postfix) with ESMTP id D719C580223; Fri, 8 Nov 2013 02:51:22 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by DB8EHSMHS005.bigfish.com (10.174.4.15) with Microsoft SMTP Server (TLS) id 14.16.227.3; Fri, 8 Nov 2013 02:51:22 +0000 Received: from az84smr01.freescale.net (10.64.34.197) by 039-SN1MMR1-001.039d.mgd.msft.net (10.84.1.13) with Microsoft SMTP Server (TLS) id 14.3.158.2; Fri, 8 Nov 2013 02:51:20 +0000 Received: from rock.am.freescale.net (rock.ap.freescale.net [10.193.20.106]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id rA82osJw031858; Thu, 7 Nov 2013 19:51:17 -0700 From: Haijun Zhang To: , , Date: Fri, 8 Nov 2013 10:07:01 +0800 Message-ID: <1383876423-2265-6-git-send-email-Haijun.Zhang@freescale.com> X-Mailer: git-send-email 1.8.4 In-Reply-To: <1383876423-2265-1-git-send-email-Haijun.Zhang@freescale.com> References: <1383876423-2265-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-Mailman-Approved-At: Fri, 08 Nov 2013 03:53:06 +0100 Cc: Haijun Zhang , Haijun Zhang , trini@ti.com, X.Xie@freescale.com, scottwood@freescale.com Subject: [U-Boot] [PATCH 5/7 V2] 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 faild has_init should be set to 0, prepard for the next initialization to recover from error. Once mmcinfo command failed error should point out instead of print 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 V2: - Update the print content common/cmd_mmc.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/common/cmd_mmc.c b/common/cmd_mmc.c index c124df0..90edb64 100644 --- a/common/cmd_mmc.c +++ b/common/cmd_mmc.c @@ -115,8 +115,10 @@ 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)) { + puts("Got MMC device infor error\n"); + return 1; + } print_mmcinfo(mmc); return 0; } else { @@ -191,9 +193,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;