
5 Jun
2013
5 Jun
'13
1:31 a.m.
On 06/04/2013 05:16 PM, Fabio Estevam wrote:
On Tue, Jun 4, 2013 at 7:12 PM, Stephen Warren swarren@wwwdotorg.org wrote:
static void fini_mmc_for_env(struct mmc *mmc) { #ifdef CONFIG_SYS_MMC_ENV_PART
if (CONFIG_SYS_MMC_ENV_PART != mmc->part_num)
if (mmc->part_num != orig_part_num) mmc_switch_part(CONFIG_SYS_MMC_ENV_DEV,
mmc->part_num);
orig_part_num);
If I keep the original 'mmc->part_num' here, then it works.
It doesn't "work", it just hides the problem. By passing mmc->part_num here, you're passing the partition that's already/currently selected rather than restoring the original value. Selecting it again is a no-op; IIRC the MMC core explicitly checks for this condition and immediately returns without touching the HW.