Re: [PATCH v11] mmc : general purpose partition support.

From: NamJae Jeon
Date: Wed Oct 05 2011 - 20:13:59 EST


2011/10/6 Andrei Warkentin <awarkentin@xxxxxxxxxx>:
> Hi,
>
> ----- Original Message -----
>> From: "Namjae Jeon" <linkinjeon@xxxxxxxxx>
>> To: cjb@xxxxxxxxxx, linux-mmc@xxxxxxxxxxxxxxx
>> Cc: linux-kernel@xxxxxxxxxxxxxxx, awarkentin@xxxxxxxxxx, "adrian hunter" <adrian.hunter@xxxxxxxxx>, "linus walleij"
>> <linus.walleij@xxxxxxxxxx>, "james p freyensee" <james_p_freyensee@xxxxxxxxxxxxxxx>, sebras@xxxxxxxxx, "Ulf Hansson"
>> <Ulf.Hansson@xxxxxxxxxxxxxx>, "stefan xk nilsson" <stefan.xk.nilsson@xxxxxxxxxxxxxx>, "per forlin"
>> <per.forlin@xxxxxxxxxxxxxx>, "johan rudholm" <johan.rudholm@xxxxxxxxxxxxxx>, "Namjae Jeon" <linkinjeon@xxxxxxxxx>
>> Sent: Wednesday, October 5, 2011 10:45:45 AM
>> Subject: [PATCH v11] mmc : general purpose partition support.
>>
>> It allows gerneral purpose partitions in MMC Device.
>> And I try to simpliy make mmc_blk_alloc_parts using mmc_part
>> structure suggested by Andrei Warkentin.
>> After patching, we can see general purpose partitions like this.
>> > cat /proc/partitions
>> Â Â Â Â Â 179 0 847872 mmcblk0
>> Â Â Â Â Â 179 192 4096 mmcblk0gp3
>> Â Â Â Â Â 179 160 4096 mmcblk0gp2
>> Â Â Â Â Â 179 128 4096 mmcblk0gp1
>> Â Â Â Â Â 179 96 Â1052672 mmcblk0gp0
>> Â Â Â Â Â 179 64 Â1024 mmcblk0boot1
>> Â Â Â Â Â 179 32 Â1024 mmcblk0boot0
>>
>> Signed-off-by: Namjae Jeon <linkinjeon@xxxxxxxxx>
>> ---
>> Âdrivers/mmc/card/block.c | Â 41 +++++++++++++++++++++++------------
>> Âdrivers/mmc/core/mmc.c  |  52
>> Â++++++++++++++++++++++++++++++++++++++++++---
>> Âinclude/linux/mmc/card.h | Â 34 +++++++++++++++++++++++++++++-
>> Âinclude/linux/mmc/mmc.h Â| Â Â5 +++-
>> Â4 files changed, 112 insertions(+), 20 deletions(-)
>>
>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>> + Â Â for (idx = 0; idx < card->nr_parts; idx++) {
>> + Â Â Â Â Â Â if (mmc_is_boot_partition(&card->part[idx]) &&
>> + Â Â Â Â Â Â Â Â Â Â !mmc_boot_partition_access(card->host))
>> + Â Â Â Â Â Â Â Â Â Â continue;
>> + Â Â Â Â Â Â if (card->part[idx].size) {
>> + Â Â Â Â Â Â Â Â Â Â ret = mmc_blk_alloc_part(card, md,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â card->part[idx].part_cfg,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â card->part[idx].size >> 9,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â card->part[idx].force_ro,
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â card->part[idx].name);
>> + Â Â Â Â Â Â Â Â Â Â if (ret)
>> + Â Â Â Â Â Â Â Â Â Â Â Â Â Â return ret;
>> + Â Â Â Â Â Â }
>> Â Â Â }
>
> Is there any reason for putting the mmc_boot_partition_access() logic here? If
> boot partitions are not allowed by host, then just don't add the mmc_parts to
> the parts array, no? Such minutae should belong in core mmc code, not block driver, IMHO.

Hi.

How about changing patch like this ?

if (ext_csd[EXT_CSD_BOOT_MULT] && mmc_boot_partition_access(card->host)) {
for (idx = 0; idx < MMC_NUM_BOOT_PARTITION; idx++) {
part_size = ext_csd[EXT_CSD_BOOT_MULT] << 17;
mmc_part_add(card, part_size,
EXT_CSD_PART_CONFIG_ACC_BOOT0 + idx,
"boot%d", idx, true);
}
}

I want to hear the opinion from andrei and
adrian(mmc_boot_partition_access patch's author)
Thanks.
>
> A
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/