From patchwork Tue Apr 29 17:16:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mateusz Zalega X-Patchwork-Id: 343952 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 803751400AC for ; Wed, 30 Apr 2014 03:15:42 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E188A4B9E5; Tue, 29 Apr 2014 19:15:39 +0200 (CEST) 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 6bLlgHu87ly9; Tue, 29 Apr 2014 19:15:39 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4AFC74B9EA; Tue, 29 Apr 2014 19:15:37 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7392C4B9EA for ; Tue, 29 Apr 2014 19:15:33 +0200 (CEST) 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 XAhYZM95Q+fU for ; Tue, 29 Apr 2014 19:15:31 +0200 (CEST) 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 mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by theia.denx.de (Postfix) with ESMTPS id 2F3BB4B9E5 for ; Tue, 29 Apr 2014 19:15:27 +0200 (CEST) Received: from eucpsbgm1.samsung.com (unknown [203.254.199.244]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4S001VSYLEHA60@mailout2.w1.samsung.com> for u-boot@lists.denx.de; Tue, 29 Apr 2014 18:15:14 +0100 (BST) X-AuditID: cbfec7f4-b7fb36d000006ff7-bd-535fde2b06ff Received: from eusync2.samsung.com ( [203.254.199.212]) by eucpsbgm1.samsung.com (EUCPMTA) with SMTP id 13.57.28663.B2EDF535; Tue, 29 Apr 2014 18:15:24 +0100 (BST) Received: from AMDC2105.digital.local ([106.116.147.44]) by eusync2.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0N4S008XVYLNVT70@eusync2.samsung.com>; Tue, 29 Apr 2014 18:15:23 +0100 (BST) From: Mateusz Zalega To: u-boot@lists.denx.de Date: Tue, 29 Apr 2014 19:16:45 +0200 Message-id: <1398791805-23744-2-git-send-email-m.zalega@samsung.com> X-Mailer: git-send-email 1.9.0 In-reply-to: <1398791805-23744-1-git-send-email-m.zalega@samsung.com> References: <1398791805-23744-1-git-send-email-m.zalega@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrBJMWRmVeSWpSXmKPExsVy+t/xK7o69+KDDT74Wsx9N4XJYtftySwW b/d2sjswe8z7OZHJ4+ydHYwefVtWMQYwR3HZpKTmZJalFunbJXBlvNu2jqXgHUdF84sPbA2M s9i7GDk5JARMJP5u3QJli0lcuLeerYuRi0NIYCmjRHv7DXYIp49J4kHbVWaQKjYBbYkbe+eD dYgISEj86r/KCGIzC8RJNF4+yQRiCwvYSqxa8YYNxGYRUJXY3XIUzOYVcJHY9PAAE8Q2OYkp vxeAzeEUcJWYtXQ52HwhoJq++z0sExh5FzAyrGIUTS1NLihOSs811CtOzC0uzUvXS87P3cQI CY0vOxgXH7M6xCjAwajEwyuwNT5YiDWxrLgy9xCjBAezkgjvt0NAId6UxMqq1KL8+KLSnNTi Q4xMHJxSDYylLA9Wz1eckHqrd9o6xXd60w4rHPPsnnNsj+OHj5L980xqmZ/ezmA6GJryRkDx vkIU1/0jtR97Yp/mXVXk3+k/68iVoB3rN6/pOb9OOGluZMXKy1c8C/Zr3f7MZBn+0mVb3sXs TlY7h3rhsCVyN+fsD20/EGC2ap/wrN7tqnv9zgluenPT7OQdJZbijERDLeai4kQAvIcbzOsB AAA= Cc: Pantelis Antoniou Subject: [U-Boot] [PATCH] mmc: postponed needless timer initialization 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de mmc_init() doesn't call get_timer() anymore if MMC is already initialized. Change-Id: Iec694abe3315d146d35dc130ad80b73dffd0983b Signed-off-by: Mateusz Zalega Cc: Pantelis Antoniou --- Detached from earlier "DFU, MMC, Gadget, Goni, misc." series because of lack of relevance to other patches. There were no changes since the first version of this patch. --- drivers/mmc/mmc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c index 16051e5..c93dc24 100644 --- a/drivers/mmc/mmc.c +++ b/drivers/mmc/mmc.c @@ -1310,15 +1310,18 @@ static int mmc_complete_init(struct mmc *mmc) int mmc_init(struct mmc *mmc) { int err = IN_PROGRESS; - unsigned start = get_timer(0); + unsigned start; if (mmc->has_init) return 0; + + start = get_timer(0); + if (!mmc->init_in_progress) err = mmc_start_init(mmc); - if (!err || err == IN_PROGRESS) err = mmc_complete_init(mmc); + debug("%s: %d, time %lu\n", __func__, err, get_timer(start)); return err; }