[U-Boot] [PATCH] mmc: fix ERASE_GRP_DEF handling

Pantelis Antoniou panto at antoniou-consulting.com
Thu Oct 2 12:49:54 CEST 2014


Hi Hannes,

On Aug 12, 2014, at 8:47 AM, Hannes Petermaier <Hannes.Petermaier at br-automation.com> wrote:

>> Hi, Hannes.
> Hi Jaehoon,
> 
>>> diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
>>> index a26f3ce..52a8e36 100644
>>> --- a/drivers/mmc/mmc.c
>>> +++ b/drivers/mmc/mmc.c
>>> @@ -1010,6 +1010,8 @@ static int mmc_startup(struct mmc *mmc)
>>> 
>>>          if (err)
>>>             return err;
>>> +         else
>>> +            ext_csd[EXT_CSD_ERASE_GROUP_DEF] = 1;
>> When is this value read?
> 
> a few lines above, have a look at line 967:
> /* check  ext_csd version and capacity */
> err = mmc_send_ext_csd(mmc, ext_csd);
> 
>> If i'm right, you means that it has to set before comparing with 
> test_csd, right?
> yes, exactly thats what i mean.
> 
>> It's reasonable, but i'm not sure that hard-coding is right.
> why not ? we set the bit using mmc_switch, and only after success we alter 
> our internal structure.
> 

It is reasonable in this context, but I’m wary of cases where a read would be
required in case the write didn’t ‘take’.

I’ll apply this for now.

>> 
>> Best Regards,
>> Jaehoon Chung
> 
> best regards,
> Hannes
> 
> 
> 

Regards

— Pantelis



More information about the U-Boot mailing list