All of lore.kernel.org
 help / color / mirror / Atom feed
From: NamJae Jeon <linkinjeon@gmail.com>
To: J Freyensee <james_p_freyensee@linux.intel.com>
Cc: cjb@laptop.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc : general purpose partition support.
Date: Sat, 24 Sep 2011 14:21:00 +0900	[thread overview]
Message-ID: <CAKYAXd_N1aXR7tPAen6P=QxY-4=PzeYy+WbCx74KR0tLvS=7Kw@mail.gmail.com> (raw)
In-Reply-To: <4E7CB5FC.3090301@linux.intel.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=UTF-8, Size: 12390 bytes --]

2011/9/24 J Freyensee <james_p_freyensee@linux.intel.com>:
> On 09/22/2011 05:29 PM, NamJae Jeon wrote:
>>
>> 2011/9/23 J Freyensee<james_p_freyensee@linux.intel.com>
>>>
>>> On 09/22/2011 04:58 PM, NamJae Jeon wrote:
>>>>
>>>> 2011/9/23 J Freyensee<james_p_freyensee@linux.intel.com>:
>>>>>
>>>>> On 09/22/2011 04:15 PM, NamJae Jeon wrote:
>>>>>>
>>>>>> 2011/9/23 J Freyensee<james_p_freyensee@linux.intel.com>:
>>>>>>>
>>>>>>> On 09/22/2011 08:34 AM, Namjae Jeon wrote:
>>>>>>>>
>>>>>>>> It allows general purpose parition in MMC Device. If it is enable,
>>>>>>>> it
>>>>>>>> will
>>>>>>>> make mmcblk0gp1,gp2,gp3,gp4 partition like this.
>>>>>>>>
>>>>>>>>> cat /proc/paritition
>>>>>>>>
>>>>>>>>       179 0 847872 mmcblk0
>>>>>>>>       179 192 4096 mmcblk0gp4
>>>>>>>>       179 160 4096 mmcblk0gp3
>>>>>>>>       179 128 4096 mmcblk0gp2
>>>>>>>>       179 96  1052672 mmcblk0gp1
>>>>>>>>       179 64  1024 mmcblk0boot1
>>>>>>>>       179 32  1024 mmcblk0boot0
>>>>>>>>
>>>>>>>> Signed-off-by: Namjae Jeon<linkinjeon@gmail.com>
>>>>>>>> ---
>>>>>>>>  drivers/mmc/card/block.c |   36
>>>>>>>> ++++++++++++++++++++++++++++++++++++
>>>>>>>>  drivers/mmc/core/mmc.c   |   42
>>>>>>>> ++++++++++++++++++++++++++++++++++++++++++
>>>>>>>>  include/linux/mmc/card.h |    4 ++++
>>>>>>>>  include/linux/mmc/mmc.h  |    4 ++++
>>>>>>>>  4 files changed, 86 insertions(+), 0 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>>>>>>>> index 9b90726..074ec55 100644
>>>>>>>> --- a/drivers/mmc/card/block.c
>>>>>>>> +++ b/drivers/mmc/card/block.c
>>>>>>>> @@ -1402,6 +1402,42 @@ static int mmc_blk_alloc_parts(struct
>>>>>>>> mmc_card
>>>>>>>> *card, struct mmc_blk_data *md)
>>>>>>>>                        return ret;
>>>>>>>>        }
>>>>>>>>
>>>>>>>> +       if (card->ext_csd.gp1_size) {
>
> Looks like you may need to also incorporate the ideas Adrian Hunter did in a
> patch that seems similar to yours, mainly also checking
> mmc_boot_partition_access(card->host) in your if() statement?
>
> I attached his patch that was sent today.
>
> Jay
I checked attached patch, see the patch v2. I think that adrian may
modify his patch base on my patch.
Thanks

>>>>>>>>
>>>>>>>> +               ret = mmc_blk_alloc_part(card, md,
>>>>>>>> EXT_CSD_PART_CONFIG_ACC_GP1,
>>>>>>>> +                                       card->ext_csd.gp1_size>>
>>>>>>>>    9,
>>>>>>>> +                                       false,
>>>>>>>> +                                       "gp1");
>>>>>>>> +               if (ret)
>>>>>>>> +                       return ret;
>>>>>>>> +       }
>>>>>>>> +
>>>>>>>
>>>>>>> if mmc_blk_alloc_part() fails for 'if (card->ext_csd.pt1_size)', why
>>>>>>> would
>>>>>>> you want to give this code the opportunity to call
>>>>>>> mmc_blk_alloc_part()
>>>>>>> again with the next if() below?  If mmc_blk_alloc_part() fails, is it
>>>>>>> a
>>>>>>> big
>>>>>>> problem, like kzalloc() failing?  If so, I would think you would want
>>>>>>> to
>>>>>>> immediately quit this function and report an error (either use errno
>>>>>>> value
>>>>>>> or pass the value of ret).
>>>>>>
>>>>>> ->      if card->ext_csd.gp1_size is no zero, it means general purpose
>>>>>> partition is enable.
>>>>>> and it can set up to 4 partition in specification. so we should check
>>>>>> it by next if().
>>>>>
>>>>> Please document that in your code.  Please add a function header to
>>>>> this
>>>>> function.
>>>>
>>>> I will add comments at this code.  I don't understand why a function
>>>> header should be added yet.
>>>
>>> One or the other.
>>>
>>> but a function comment header should be added at some point.  Yes, the
>>> mmc subsystem is pretty legacy, but any new work that gets added to the
>>> kernel is usually has higher standards for stuff like not just adding
>>> function header comments but putting them in a certain format...at least
>>> this is what I went through when I had things accepted upstream.
>>
>> Okay, I will release patch v2 after adding function header comments again.
>> Thanks for your review.
>>>
>>>>
>>>>>
>>>>>>
>>>>>>>
>>>>>>>> +       if (card->ext_csd.gp2_size) {
>>>>>>>> +               ret = mmc_blk_alloc_part(card, md,
>>>>>>>> EXT_CSD_PART_CONFIG_ACC_GP2,
>>>>>>>> +                                       card->ext_csd.gp2_size>>
>>>>>>>>    9,
>>>>>>>> +                                       false,
>>>>>>>> +                                       "gp2");
>>>>>>>> +               if (ret)
>>>>>>>> +                       return ret;
>>>>>>>> +       }
>>>>>>>> +
>>>>>>>> +       if (card->ext_csd.gp3_size) {
>>>>>>>> +               ret = mmc_blk_alloc_part(card, md,
>>>>>>>> EXT_CSD_PART_CONFIG_ACC_GP3,
>>>>>>>> +                                       card->ext_csd.gp3_size>>
>>>>>>>>    9,
>>>>>>>> +                                       false,
>>>>>>>> +                                       "gp3");
>>>>>>>> +               if (ret)
>>>>>>>> +                       return ret;
>>>>>>>> +       }
>>>>>>>> +
>>>>>>>> +       if (card->ext_csd.gp4_size) {
>>>>>>>> +               ret = mmc_blk_alloc_part(card, md,
>>>>>>>> EXT_CSD_PART_CONFIG_ACC_GP4,
>>>>>>>> +                                       card->ext_csd.gp4_size>>
>>>>>>>>    9,
>>>>>>>> +                                       false,
>>>>>>>> +                                       "gp4");
>>>>>>>> +               if (ret)
>>>>>>>> +                       return ret;
>>>>>>>> +       }
>>>>>>>> +
>>>>>>>>        return ret;
>>>>>>>>  }
>>>>>>>>
>>>>>>>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>>>>>>>> index 10f5a19..cc31511 100644
>>>>>>>> --- a/drivers/mmc/core/mmc.c
>>>>>>>> +++ b/drivers/mmc/core/mmc.c
>>>>>>>> @@ -393,6 +393,48 @@ static int mmc_read_ext_csd(struct mmc_card
>>>>>>>> *card,
>>>>>>>> u8
>>>>>>>> *ext_csd)
>>>>>>>>                        card->ext_csd.enhanced_area_offset = -EINVAL;
>>>>>>>>                        card->ext_csd.enhanced_area_size = -EINVAL;
>>>>>>>>                }
>>>>>>>> +
>>>>>>>> +               /*
>>>>>>>> +                * General purpose partition Support
>>>>>>>> +                */
>>>>>>>> +
>>>>>>>> +               if (ext_csd[EXT_CSD_PARTITION_SUPPORT]&        0x1)
>>>>>>>> {
>>>>>>>> +
>>>>>>>> +                       u8 hc_erase_grp_sz =
>>>>>>>> +                               ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE];
>>>>>>>> +                       u8 hc_wp_grp_sz =
>>>>>>>> +                               ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
>>>>>>>> +
>>>>>>>> +                       card->ext_csd.enhanced_area_en = 1;
>>>>>>>> +
>>>>>>>> +                       card->ext_csd.gp1_size =
>>>>>>>> +                               (ext_csd[145]<<        16) +
>>>>>>>> (ext_csd[144]<<
>>>>>>>>    8)
>>>>>>>> +
>>>>>>>> +                               ext_csd[143];
>>>>>>>> +                       card->ext_csd.gp1_size *=
>>>>>>>> +                               (size_t)(hc_erase_grp_sz *
>>>>>>>> hc_wp_grp_sz);
>>>>>>>> +                       card->ext_csd.gp1_size<<= 19;
>>>>>>>> +
>>>>>>>> +                       card->ext_csd.gp2_size =
>>>>>>>> +                               (ext_csd[148]<<        16) +
>>>>>>>> (ext_csd[147]<<
>>>>>>>>    8)
>>>>>>>> +
>>>>>>>> +                               ext_csd[146];
>>>>>>>> +                       card->ext_csd.gp2_size *=
>>>>>>>> +                               (size_t)(hc_erase_grp_sz *
>>>>>>>> hc_wp_grp_sz);
>>>>>>>> +                               card->ext_csd.gp2_size<<= 19;
>>>>>>>> +
>>>>>>>> +                       card->ext_csd.gp3_size =
>>>>>>>> +                               (ext_csd[151]<<        16) +
>>>>>>>> (ext_csd[150]<<
>>>>>>>>    8)
>>>>>>>> +
>>>>>>>> +                               ext_csd[149];
>>>>>>>> +                       card->ext_csd.gp3_size *=
>>>>>>>> +                               (size_t)(hc_erase_grp_sz *
>>>>>>>> hc_wp_grp_sz);
>>>>>>>> +                       card->ext_csd.gp3_size<<= 19;
>>>>>>>> +
>>>>>>>> +                       card->ext_csd.gp4_size =
>>>>>>>> +                               (ext_csd[154]<<        16) +
>>>>>>>> (ext_csd[153]<<
>>>>>>>>    8)
>>>>>>>> +
>>>>>>>> +                               ext_csd[152];
>>>>>>>> +                       card->ext_csd.gp4_size *=
>>>>>>>> +                               (size_t)(hc_erase_grp_sz *
>>>>>>>> hc_wp_grp_sz);
>>>>>>>> +                       card->ext_csd.gp4_size<<= 19;
>>>>>>>> +               }
>>>>>>>>                card->ext_csd.sec_trim_mult =
>>>>>>>>                        ext_csd[EXT_CSD_SEC_TRIM_MULT];
>>>>>>>>                card->ext_csd.sec_erase_mult =
>>>>>>>> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
>>>>>>>> index b460fc2..96a98a7 100644
>>>>>>>> --- a/include/linux/mmc/card.h
>>>>>>>> +++ b/include/linux/mmc/card.h
>>>>>>>> @@ -64,6 +64,10 @@ struct mmc_ext_csd {
>>>>>>>>        unsigned long long      enhanced_area_offset;   /* Units:
>>>>>>>> Byte */
>>>>>>>>        unsigned int            enhanced_area_size;     /* Units: KB
>>>>>>>> */
>>>>>>>>        unsigned int            boot_size;              /* in bytes
>>>>>>>> */
>>>>>>>> +       unsigned int            gp1_size;               /* in bytes
>>>>>>>> */
>>>>>>>> +       unsigned int            gp2_size;               /* in bytes
>>>>>>>> */
>>>>>>>> +       unsigned int            gp3_size;               /* in bytes
>>>>>>>> */
>>>>>>>> +       unsigned int            gp4_size;               /* in bytes
>>>>>>>> */
>>>>>>>>        u8                      raw_partition_support;  /* 160 */
>>>>>>>>        u8                      raw_erased_mem_count;   /* 181 */
>>>>>>>>        u8                      raw_ext_csd_structure;  /* 194 */
>>>>>>>> diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
>>>>>>>> index 5a794cb..380720a 100644
>>>>>>>> --- a/include/linux/mmc/mmc.h
>>>>>>>> +++ b/include/linux/mmc/mmc.h
>>>>>>>> @@ -303,6 +303,10 @@ struct _mmc_csd {
>>>>>>>>  #define EXT_CSD_PART_CONFIG_ACC_MASK  (0x7)
>>>>>>>>  #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1)
>>>>>>>>  #define EXT_CSD_PART_CONFIG_ACC_BOOT1 (0x2)
>>>>>>>> +#define EXT_CSD_PART_CONFIG_ACC_GP1    (0x4)
>>>>>>>> +#define EXT_CSD_PART_CONFIG_ACC_GP2    (0x5)
>>>>>>>> +#define EXT_CSD_PART_CONFIG_ACC_GP3    (0x6)
>>>>>>>> +#define EXT_CSD_PART_CONFIG_ACC_GP4    (0x7)
>>>>>>>>
>>>>>>>>  #define EXT_CSD_CMD_SET_NORMAL                (1<<0)
>>>>>>>>  #define EXT_CSD_CMD_SET_SECURE                (1<<1)
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> J (James/Jay) Freyensee
>>>>>>> Storage Technology Group
>>>>>>> Intel Corporation
>>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> J (James/Jay) Freyensee
>>>>> Storage Technology Group
>>>>> Intel Corporation
>>>>>
>>>
>>>
>>> --
>>> J (James/Jay) Freyensee
>>> Storage Technology Group
>>> Intel Corporation
>>
>> N�����r��y���b�X��ǧv�^�)޺{.n�+����{��g"��^n�r��z� ��h����&�� �G���h�
>> (�階�ݢj"�� � m�����z�ޖ���f���h���~�mml==
>
>
> --
> J (James/Jay) Freyensee
> Storage Technology Group
> Intel Corporation
>
ÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

WARNING: multiple messages have this Message-ID (diff)
From: NamJae Jeon <linkinjeon@gmail.com>
To: J Freyensee <james_p_freyensee@linux.intel.com>
Cc: cjb@laptop.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mmc : general purpose partition support.
Date: Sat, 24 Sep 2011 14:21:00 +0900	[thread overview]
Message-ID: <CAKYAXd_N1aXR7tPAen6P=QxY-4=PzeYy+WbCx74KR0tLvS=7Kw@mail.gmail.com> (raw)
In-Reply-To: <4E7CB5FC.3090301@linux.intel.com>

2011/9/24 J Freyensee <james_p_freyensee@linux.intel.com>:
> On 09/22/2011 05:29 PM, NamJae Jeon wrote:
>>
>> 2011/9/23 J Freyensee<james_p_freyensee@linux.intel.com>
>>>
>>> On 09/22/2011 04:58 PM, NamJae Jeon wrote:
>>>>
>>>> 2011/9/23 J Freyensee<james_p_freyensee@linux.intel.com>:
>>>>>
>>>>> On 09/22/2011 04:15 PM, NamJae Jeon wrote:
>>>>>>
>>>>>> 2011/9/23 J Freyensee<james_p_freyensee@linux.intel.com>:
>>>>>>>
>>>>>>> On 09/22/2011 08:34 AM, Namjae Jeon wrote:
>>>>>>>>
>>>>>>>> It allows general purpose parition in MMC Device. If it is enable,
>>>>>>>> it
>>>>>>>> will
>>>>>>>> make mmcblk0gp1,gp2,gp3,gp4 partition like this.
>>>>>>>>
>>>>>>>>> cat /proc/paritition
>>>>>>>>
>>>>>>>>       179 0 847872 mmcblk0
>>>>>>>>       179 192 4096 mmcblk0gp4
>>>>>>>>       179 160 4096 mmcblk0gp3
>>>>>>>>       179 128 4096 mmcblk0gp2
>>>>>>>>       179 96  1052672 mmcblk0gp1
>>>>>>>>       179 64  1024 mmcblk0boot1
>>>>>>>>       179 32  1024 mmcblk0boot0
>>>>>>>>
>>>>>>>> Signed-off-by: Namjae Jeon<linkinjeon@gmail.com>
>>>>>>>> ---
>>>>>>>>  drivers/mmc/card/block.c |   36
>>>>>>>> ++++++++++++++++++++++++++++++++++++
>>>>>>>>  drivers/mmc/core/mmc.c   |   42
>>>>>>>> ++++++++++++++++++++++++++++++++++++++++++
>>>>>>>>  include/linux/mmc/card.h |    4 ++++
>>>>>>>>  include/linux/mmc/mmc.h  |    4 ++++
>>>>>>>>  4 files changed, 86 insertions(+), 0 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
>>>>>>>> index 9b90726..074ec55 100644
>>>>>>>> --- a/drivers/mmc/card/block.c
>>>>>>>> +++ b/drivers/mmc/card/block.c
>>>>>>>> @@ -1402,6 +1402,42 @@ static int mmc_blk_alloc_parts(struct
>>>>>>>> mmc_card
>>>>>>>> *card, struct mmc_blk_data *md)
>>>>>>>>                        return ret;
>>>>>>>>        }
>>>>>>>>
>>>>>>>> +       if (card->ext_csd.gp1_size) {
>
> Looks like you may need to also incorporate the ideas Adrian Hunter did in a
> patch that seems similar to yours, mainly also checking
> mmc_boot_partition_access(card->host) in your if() statement?
>
> I attached his patch that was sent today.
>
> Jay
I checked attached patch, see the patch v2. I think that adrian may
modify his patch base on my patch.
Thanks

>>>>>>>>
>>>>>>>> +               ret = mmc_blk_alloc_part(card, md,
>>>>>>>> EXT_CSD_PART_CONFIG_ACC_GP1,
>>>>>>>> +                                       card->ext_csd.gp1_size>>
>>>>>>>>    9,
>>>>>>>> +                                       false,
>>>>>>>> +                                       "gp1");
>>>>>>>> +               if (ret)
>>>>>>>> +                       return ret;
>>>>>>>> +       }
>>>>>>>> +
>>>>>>>
>>>>>>> if mmc_blk_alloc_part() fails for 'if (card->ext_csd.pt1_size)', why
>>>>>>> would
>>>>>>> you want to give this code the opportunity to call
>>>>>>> mmc_blk_alloc_part()
>>>>>>> again with the next if() below?  If mmc_blk_alloc_part() fails, is it
>>>>>>> a
>>>>>>> big
>>>>>>> problem, like kzalloc() failing?  If so, I would think you would want
>>>>>>> to
>>>>>>> immediately quit this function and report an error (either use errno
>>>>>>> value
>>>>>>> or pass the value of ret).
>>>>>>
>>>>>> ->      if card->ext_csd.gp1_size is no zero, it means general purpose
>>>>>> partition is enable.
>>>>>> and it can set up to 4 partition in specification. so we should check
>>>>>> it by next if().
>>>>>
>>>>> Please document that in your code.  Please add a function header to
>>>>> this
>>>>> function.
>>>>
>>>> I will add comments at this code.  I don't understand why a function
>>>> header should be added yet.
>>>
>>> One or the other.
>>>
>>> but a function comment header should be added at some point.  Yes, the
>>> mmc subsystem is pretty legacy, but any new work that gets added to the
>>> kernel is usually has higher standards for stuff like not just adding
>>> function header comments but putting them in a certain format...at least
>>> this is what I went through when I had things accepted upstream.
>>
>> Okay, I will release patch v2 after adding function header comments again.
>> Thanks for your review.
>>>
>>>>
>>>>>
>>>>>>
>>>>>>>
>>>>>>>> +       if (card->ext_csd.gp2_size) {
>>>>>>>> +               ret = mmc_blk_alloc_part(card, md,
>>>>>>>> EXT_CSD_PART_CONFIG_ACC_GP2,
>>>>>>>> +                                       card->ext_csd.gp2_size>>
>>>>>>>>    9,
>>>>>>>> +                                       false,
>>>>>>>> +                                       "gp2");
>>>>>>>> +               if (ret)
>>>>>>>> +                       return ret;
>>>>>>>> +       }
>>>>>>>> +
>>>>>>>> +       if (card->ext_csd.gp3_size) {
>>>>>>>> +               ret = mmc_blk_alloc_part(card, md,
>>>>>>>> EXT_CSD_PART_CONFIG_ACC_GP3,
>>>>>>>> +                                       card->ext_csd.gp3_size>>
>>>>>>>>    9,
>>>>>>>> +                                       false,
>>>>>>>> +                                       "gp3");
>>>>>>>> +               if (ret)
>>>>>>>> +                       return ret;
>>>>>>>> +       }
>>>>>>>> +
>>>>>>>> +       if (card->ext_csd.gp4_size) {
>>>>>>>> +               ret = mmc_blk_alloc_part(card, md,
>>>>>>>> EXT_CSD_PART_CONFIG_ACC_GP4,
>>>>>>>> +                                       card->ext_csd.gp4_size>>
>>>>>>>>    9,
>>>>>>>> +                                       false,
>>>>>>>> +                                       "gp4");
>>>>>>>> +               if (ret)
>>>>>>>> +                       return ret;
>>>>>>>> +       }
>>>>>>>> +
>>>>>>>>        return ret;
>>>>>>>>  }
>>>>>>>>
>>>>>>>> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
>>>>>>>> index 10f5a19..cc31511 100644
>>>>>>>> --- a/drivers/mmc/core/mmc.c
>>>>>>>> +++ b/drivers/mmc/core/mmc.c
>>>>>>>> @@ -393,6 +393,48 @@ static int mmc_read_ext_csd(struct mmc_card
>>>>>>>> *card,
>>>>>>>> u8
>>>>>>>> *ext_csd)
>>>>>>>>                        card->ext_csd.enhanced_area_offset = -EINVAL;
>>>>>>>>                        card->ext_csd.enhanced_area_size = -EINVAL;
>>>>>>>>                }
>>>>>>>> +
>>>>>>>> +               /*
>>>>>>>> +                * General purpose partition Support
>>>>>>>> +                */
>>>>>>>> +
>>>>>>>> +               if (ext_csd[EXT_CSD_PARTITION_SUPPORT]&        0x1)
>>>>>>>> {
>>>>>>>> +
>>>>>>>> +                       u8 hc_erase_grp_sz =
>>>>>>>> +                               ext_csd[EXT_CSD_HC_ERASE_GRP_SIZE];
>>>>>>>> +                       u8 hc_wp_grp_sz =
>>>>>>>> +                               ext_csd[EXT_CSD_HC_WP_GRP_SIZE];
>>>>>>>> +
>>>>>>>> +                       card->ext_csd.enhanced_area_en = 1;
>>>>>>>> +
>>>>>>>> +                       card->ext_csd.gp1_size =
>>>>>>>> +                               (ext_csd[145]<<        16) +
>>>>>>>> (ext_csd[144]<<
>>>>>>>>    8)
>>>>>>>> +
>>>>>>>> +                               ext_csd[143];
>>>>>>>> +                       card->ext_csd.gp1_size *=
>>>>>>>> +                               (size_t)(hc_erase_grp_sz *
>>>>>>>> hc_wp_grp_sz);
>>>>>>>> +                       card->ext_csd.gp1_size<<= 19;
>>>>>>>> +
>>>>>>>> +                       card->ext_csd.gp2_size =
>>>>>>>> +                               (ext_csd[148]<<        16) +
>>>>>>>> (ext_csd[147]<<
>>>>>>>>    8)
>>>>>>>> +
>>>>>>>> +                               ext_csd[146];
>>>>>>>> +                       card->ext_csd.gp2_size *=
>>>>>>>> +                               (size_t)(hc_erase_grp_sz *
>>>>>>>> hc_wp_grp_sz);
>>>>>>>> +                               card->ext_csd.gp2_size<<= 19;
>>>>>>>> +
>>>>>>>> +                       card->ext_csd.gp3_size =
>>>>>>>> +                               (ext_csd[151]<<        16) +
>>>>>>>> (ext_csd[150]<<
>>>>>>>>    8)
>>>>>>>> +
>>>>>>>> +                               ext_csd[149];
>>>>>>>> +                       card->ext_csd.gp3_size *=
>>>>>>>> +                               (size_t)(hc_erase_grp_sz *
>>>>>>>> hc_wp_grp_sz);
>>>>>>>> +                       card->ext_csd.gp3_size<<= 19;
>>>>>>>> +
>>>>>>>> +                       card->ext_csd.gp4_size =
>>>>>>>> +                               (ext_csd[154]<<        16) +
>>>>>>>> (ext_csd[153]<<
>>>>>>>>    8)
>>>>>>>> +
>>>>>>>> +                               ext_csd[152];
>>>>>>>> +                       card->ext_csd.gp4_size *=
>>>>>>>> +                               (size_t)(hc_erase_grp_sz *
>>>>>>>> hc_wp_grp_sz);
>>>>>>>> +                       card->ext_csd.gp4_size<<= 19;
>>>>>>>> +               }
>>>>>>>>                card->ext_csd.sec_trim_mult =
>>>>>>>>                        ext_csd[EXT_CSD_SEC_TRIM_MULT];
>>>>>>>>                card->ext_csd.sec_erase_mult =
>>>>>>>> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
>>>>>>>> index b460fc2..96a98a7 100644
>>>>>>>> --- a/include/linux/mmc/card.h
>>>>>>>> +++ b/include/linux/mmc/card.h
>>>>>>>> @@ -64,6 +64,10 @@ struct mmc_ext_csd {
>>>>>>>>        unsigned long long      enhanced_area_offset;   /* Units:
>>>>>>>> Byte */
>>>>>>>>        unsigned int            enhanced_area_size;     /* Units: KB
>>>>>>>> */
>>>>>>>>        unsigned int            boot_size;              /* in bytes
>>>>>>>> */
>>>>>>>> +       unsigned int            gp1_size;               /* in bytes
>>>>>>>> */
>>>>>>>> +       unsigned int            gp2_size;               /* in bytes
>>>>>>>> */
>>>>>>>> +       unsigned int            gp3_size;               /* in bytes
>>>>>>>> */
>>>>>>>> +       unsigned int            gp4_size;               /* in bytes
>>>>>>>> */
>>>>>>>>        u8                      raw_partition_support;  /* 160 */
>>>>>>>>        u8                      raw_erased_mem_count;   /* 181 */
>>>>>>>>        u8                      raw_ext_csd_structure;  /* 194 */
>>>>>>>> diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
>>>>>>>> index 5a794cb..380720a 100644
>>>>>>>> --- a/include/linux/mmc/mmc.h
>>>>>>>> +++ b/include/linux/mmc/mmc.h
>>>>>>>> @@ -303,6 +303,10 @@ struct _mmc_csd {
>>>>>>>>  #define EXT_CSD_PART_CONFIG_ACC_MASK  (0x7)
>>>>>>>>  #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1)
>>>>>>>>  #define EXT_CSD_PART_CONFIG_ACC_BOOT1 (0x2)
>>>>>>>> +#define EXT_CSD_PART_CONFIG_ACC_GP1    (0x4)
>>>>>>>> +#define EXT_CSD_PART_CONFIG_ACC_GP2    (0x5)
>>>>>>>> +#define EXT_CSD_PART_CONFIG_ACC_GP3    (0x6)
>>>>>>>> +#define EXT_CSD_PART_CONFIG_ACC_GP4    (0x7)
>>>>>>>>
>>>>>>>>  #define EXT_CSD_CMD_SET_NORMAL                (1<<0)
>>>>>>>>  #define EXT_CSD_CMD_SET_SECURE                (1<<1)
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> J (James/Jay) Freyensee
>>>>>>> Storage Technology Group
>>>>>>> Intel Corporation
>>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> J (James/Jay) Freyensee
>>>>> Storage Technology Group
>>>>> Intel Corporation
>>>>>
>>>
>>>
>>> --
>>> J (James/Jay) Freyensee
>>> Storage Technology Group
>>> Intel Corporation
>>
>> N�����r��y���b�X��ǧv�^�)޺{.n�+����{��g"��^n�r��z� ��h����&�� �G���h�
>> (�階�ݢj"�� � m�����z�ޖ���f���h���~�mml==
>
>
> --
> J (James/Jay) Freyensee
> Storage Technology Group
> Intel Corporation
>

  parent reply	other threads:[~2011-09-24  5:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-22 15:34 [PATCH] mmc : general purpose partition support Namjae Jeon
2011-09-22 22:08 ` J Freyensee
2011-09-22 23:15   ` NamJae Jeon
2011-09-22 23:15     ` NamJae Jeon
2011-09-22 23:25     ` J Freyensee
2011-09-22 23:58       ` NamJae Jeon
2011-09-22 23:58         ` NamJae Jeon
2011-09-23  0:19         ` J Freyensee
2011-09-23  0:29           ` NamJae Jeon
2011-09-23  0:29             ` NamJae Jeon
     [not found]             ` <4E7CB5FC.3090301@linux.intel.com>
2011-09-24  5:21               ` NamJae Jeon [this message]
2011-09-24  5:21                 ` NamJae Jeon
2011-09-23  3:25 ` Andrei Warkentin
2011-09-23  3:56   ` NamJae Jeon
2011-10-04 16:16 Namjae Jeon

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='CAKYAXd_N1aXR7tPAen6P=QxY-4=PzeYy+WbCx74KR0tLvS=7Kw@mail.gmail.com' \
    --to=linkinjeon@gmail.com \
    --cc=cjb@laptop.org \
    --cc=james_p_freyensee@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.