From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964791Ab1JFGcA (ORCPT ); Thu, 6 Oct 2011 02:32:00 -0400 Received: from mga09.intel.com ([134.134.136.24]:32671 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935243Ab1JFGb7 (ORCPT ); Thu, 6 Oct 2011 02:31:59 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.67,351,1309762800"; d="scan'208";a="60427570" Message-ID: <4E8D4B5A.6040106@intel.com> Date: Thu, 06 Oct 2011 09:31:54 +0300 From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:7.0.1) Gecko/20110930 Thunderbird/7.0.1 MIME-Version: 1.0 To: Andrei Warkentin CC: Namjae Jeon , linux-kernel@vger.kernel.org, linus walleij , james p freyensee , sebras@gmail.com, Ulf Hansson , stefan xk nilsson , per forlin , johan rudholm , cjb@laptop.org, linux-mmc@vger.kernel.org Subject: Re: [PATCH v11] mmc : general purpose partition support. References: <1757717892.66886.1317828833207.JavaMail.root@zimbra-prod-mbox-2.vmware.com> In-Reply-To: <1757717892.66886.1317828833207.JavaMail.root@zimbra-prod-mbox-2.vmware.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 05/10/11 18:33, Andrei Warkentin wrote: > Hi, > > ----- Original Message ----- >> From: "Namjae Jeon" >> To: cjb@laptop.org, linux-mmc@vger.kernel.org >> Cc: linux-kernel@vger.kernel.org, awarkentin@vmware.com, "adrian hunter", "linus walleij" >> , "james p freyensee", sebras@gmail.com, "Ulf Hansson" >> , "stefan xk nilsson", "per forlin" >> , "johan rudholm", "Namjae Jeon" >> 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 >> --- >> 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. I like data structures to model reality i.e. the partitions exist but are not accessible. However I am not fussed - change it or not. > > A >