From patchwork Tue Jun 4 18:23:43 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 248797 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 1451F2C009C for ; Wed, 5 Jun 2013 04:25:05 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 479704A0F4; Tue, 4 Jun 2013 20:25:03 +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 RXpF9tva99rX; Tue, 4 Jun 2013 20:25:03 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DC3964A08A; Tue, 4 Jun 2013 20:25:00 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 566824A08A for ; Tue, 4 Jun 2013 20:24:59 +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 KTx6NQUGDTb0 for ; Tue, 4 Jun 2013 20:24:53 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 BL_NJABL=ERR(-1.5) (only DNSBL check requested) Received: from co9outboundpool.messaging.microsoft.com (co9ehsobe002.messaging.microsoft.com [207.46.163.25]) by theia.denx.de (Postfix) with ESMTPS id 7525F4A026 for ; Tue, 4 Jun 2013 20:24:46 +0200 (CEST) Received: from mail150-co9-R.bigfish.com (10.236.132.249) by CO9EHSOBE007.bigfish.com (10.236.130.70) with Microsoft SMTP Server id 14.1.225.23; Tue, 4 Jun 2013 18:24:44 +0000 Received: from mail150-co9 (localhost [127.0.0.1]) by mail150-co9-R.bigfish.com (Postfix) with ESMTP id 4B61A360481; Tue, 4 Jun 2013 18:24:44 +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(zzzz1f42h1ee6h1de0h1fdah1202h1e76h1d1ah1d2ah1fc6hzz8275bhz2dh2a8h668h839hd24he5bhf0ah1288h12a5h12a9h12bdh12e5h137ah139eh13b6h1441h1504h1537h162dh1631h1758h1898h18e1h1946h19b5h1ad9h1b0ah1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1155h) Received: from mail150-co9 (localhost.localdomain [127.0.0.1]) by mail150-co9 (MessageSwitch) id 1370370282641068_6210; Tue, 4 Jun 2013 18:24:42 +0000 (UTC) Received: from CO9EHSMHS020.bigfish.com (unknown [10.236.132.234]) by mail150-co9.bigfish.com (Postfix) with ESMTP id 9A52E320069; Tue, 4 Jun 2013 18:24:42 +0000 (UTC) Received: from mail.freescale.net (70.37.183.190) by CO9EHSMHS020.bigfish.com (10.236.130.30) with Microsoft SMTP Server (TLS) id 14.1.225.23; Tue, 4 Jun 2013 18:24:42 +0000 Received: from tx30smr01.am.freescale.net (10.81.153.31) by 039-SN1MMR1-002.039d.mgd.msft.net (10.84.1.15) with Microsoft SMTP Server (TLS) id 14.2.328.11; Tue, 4 Jun 2013 18:25:25 +0000 Received: from fabio-Latitude-E6410.am.freescale.net ([10.29.244.119]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id r54IO4o7009872; Tue, 4 Jun 2013 11:24:05 -0700 From: Fabio Estevam To: Date: Tue, 4 Jun 2013 15:23:43 -0300 Message-ID: <1370370223-7087-1-git-send-email-fabio.estevam@freescale.com> X-Mailer: git-send-email 1.8.1.2 MIME-Version: 1.0 X-OriginatorOrg: freescale.com Cc: Fabio Estevam , swarren@nvidia.com, u-boot@lists.denx.de Subject: [U-Boot] [PATCH] common: env_mmc: Make mmc->part_num in sync after a partition switch 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 When running the "save" command several times on a mx6qsabresd we see: U-Boot > save Saving Environment to MMC... Writing to MMC(1)... done U-Boot > save Saving Environment to MMC... MMC partition switch failed U-Boot > save Saving Environment to MMC... Writing to MMC(1)... done U-Boot > save Saving Environment to MMC... MMC partition switch failed U-Boot > save Saving Environment to MMC... Writing to MMC(1)... done U-Boot > save Saving Environment to MMC... MMC partition switch failed Fix this by making mmc->part_num to be in sync with CONFIG_SYS_MMC_ENV_PART after the partition has been changed in mmc_switch_part(). After this fix, we no longer see the error after the "save" command on a mx6qsabresd. Also tested on a mx53loco. Reported-by: Jason Liu Signed-off-by: Fabio Estevam --- common/env_mmc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/common/env_mmc.c b/common/env_mmc.c index 9ca098f..8020fc5 100644 --- a/common/env_mmc.c +++ b/common/env_mmc.c @@ -89,6 +89,7 @@ static int init_mmc_for_env(struct mmc *mmc) puts("MMC partition switch failed\n"); return -1; } + mmc->part_num = CONFIG_SYS_MMC_ENV_PART; } #endif