From: Peter A. Bigot <pab@pabigot.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 1/2] env_mmc: remove condition on call to mmc_switch_part
Date: Wed, 03 Sep 2014 11:03:18 -0500 [thread overview]
Message-ID: <54073BC6.2070408@pabigot.com> (raw)
In-Reply-To: <540737D1.2040808@wwwdotorg.org>
On 09/03/2014 10:46 AM, Stephen Warren wrote:
> On 09/02/2014 05:31 PM, Peter A. Bigot wrote:
>> Though it might be expected to do so, mmc_switch_part() does not change
>> the part_num field of the device on which the partition has been
>> changed. As such, checking to see whether the partition is already the
>> target partition will fail to correctly restore the original
>> configuration in cases like env_mmc which rely on this behavior to
>> avoid having to preserve the pre-switch partition number outside the
>> device structure.
>
>> diff --git a/common/env_mmc.c b/common/env_mmc.c
>
>> - if (part != mmc->part_num) {
>> - ret = mmc_switch_part(dev, part);
>> - if (ret)
>> - puts("MMC partition switch failed\n");
>> - }
>> + ret = mmc_switch_part(dev, part);
>> + if (ret)
>> + puts("MMC partition switch failed\n");
>
> I'm not sure this is correct, but it might be.
>
> I believe the if() is present to avoid any attempt to call
> mmc_switch_part() on a device that doesn't have HW partitions (in
> which case, both part and mmc->part_num should already be 0), since
> such an attempt might print an error message.
That could be true. The patch that added the feature didn't provide
that information. In my case, the device does have HW partitions.
> If you don't observe any error message printed after this change, then
> perhaps this patch is fine.
It does work in my environment, but would not retain the behavior you
describe. The existing code is still wrong, but the error is elsewhere:
I'll provide a new patch to supersede this one.
Peter
next prev parent reply other threads:[~2014-09-03 16:03 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-02 23:31 [U-Boot] [PATCH 0/2] fix issue with mmc partition management Peter A. Bigot
2014-09-02 23:31 ` [U-Boot] [PATCH 1/2] env_mmc: remove condition on call to mmc_switch_part Peter A. Bigot
2014-09-03 15:46 ` Stephen Warren
2014-09-03 16:03 ` Peter A. Bigot [this message]
2014-09-03 16:32 ` [U-Boot] [PATCH v2] env_mmc: correct fini partition to match init partition Peter A. Bigot
2014-09-03 16:52 ` Stephen Warren
2014-09-03 17:30 ` Peter A. Bigot
2014-09-03 17:46 ` Stephen Warren
2014-09-03 17:55 ` Peter A. Bigot
2014-09-03 17:22 ` [U-Boot] [PATCH v3] " Peter A. Bigot
2014-09-09 15:25 ` Igor Grinberg
2014-09-14 13:21 ` Dmitry Lifshitz
2014-10-02 11:09 ` Pantelis Antoniou
2014-09-02 23:31 ` [U-Boot] [PATCH 2/2] mmc: restore capacity when switching to partition 0 Peter A. Bigot
2014-09-03 15:48 ` Stephen Warren
2014-09-03 15:59 ` Peter A. Bigot
2014-09-03 16:05 ` Stephen Warren
2014-09-03 16:36 ` Peter A. Bigot
2014-09-11 17:45 ` Tom Rini
2014-10-02 11:07 ` Pantelis Antoniou
2014-09-11 15:57 ` [U-Boot] [PATCH 0/2] fix issue with mmc partition management Tom Rini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=54073BC6.2070408@pabigot.com \
--to=pab@pabigot.com \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox