From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stephen Warren Date: Tue, 04 Jun 2013 13:36:31 -0600 Subject: [U-Boot] [PATCH v2] mmc: Update "mmc->part_num" when performing a partition switch In-Reply-To: References: <1370373446-14025-1-git-send-email-fabio.estevam@freescale.com> <51AE3E2F.9020408@wwwdotorg.org> Message-ID: <51AE41BF.8060206@wwwdotorg.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 06/04/2013 01:30 PM, Fabio Estevam wrote: > On Tue, Jun 4, 2013 at 4:21 PM, Stephen Warren wrote: > >> This surely has exactly the same issue as the previous version, where >> the update of part_num was done inside common/env_mmc.c? > > My understading is that the mmc core should update mmc->part_num and I > don't see such update, or am I missing something? That seems like a reasonable way for the code to work. However, you'd need to modify common/env_mmc.c:init_mmc_for_env() so that it saves off mmc->part_num before switching MMC partitions, so that fini_mmc_for_env() knows which partition to switch back to. Right now, it relies on the fact that mmc_switch_part() does not update mmc->part_num, and hence uses that value to save the previously selected partition ID. Also, if you make this change, I think you can update common/cmd_mmc.c:do_mmcops(), since it will no longer need to update mmc->part_num after a successful switch.