[U-Boot] [PATCH 8/9] ums: always initialize mmc before ums_disk_init()

Mateusz Zalega m.zalega at samsung.com
Tue Jan 14 11:55:16 CET 2014


On 01/14/14 01:49, Minkyu Kang wrote:
> On 09/01/14 23:31, Mateusz Zalega wrote:
>> In some cases MMC was still uninitialized while media capacity check,
>> leading to broken ums command.
>>
>> Change-Id: I4b86c2c59e430fb8b55272ea14f00316d8cb3dca
>> Signed-off-by: Mateusz Zalega <m.zalega at samsung.com>
>> Cc: Lukasz Majewski <l.majewski at samsung.com>
>> Cc: Minkyu Kang <mk7.kang at samsung.com>
>> Cc: Kyungmin Park <kyungmin.park at samsung.com>
>> ---
>>  board/samsung/common/ums.c | 3 +++
>>  1 file changed, 3 insertions(+)
>>
>> diff --git a/board/samsung/common/ums.c b/board/samsung/common/ums.c
>> index dc155ad..0d8f30d 100644
>> --- a/board/samsung/common/ums.c
>> +++ b/board/samsung/common/ums.c
>> @@ -37,6 +37,9 @@ static struct ums ums_dev = {
>>  
>>  static struct ums *ums_disk_init(struct mmc *mmc)
>>  {
>> +	if (mmc_init(mmc))
>> +		return NULL;
>> +
>>  	uint64_t mmc_end_sector = mmc->capacity / SECTOR_SIZE;
>>  	uint64_t ums_end_sector = UMS_NUM_SECTORS + UMS_START_SECTOR;
>>  
>>
> 
> Why don't you init the mmc before call this function?
> 
> diff --git a/board/samsung/common/ums.c b/board/samsung/common/ums.c
> index dc155ad..7017c2a 100644
> --- a/board/samsung/common/ums.c
> +++ b/board/samsung/common/ums.c
> @@ -72,5 +72,8 @@ struct ums *ums_init(unsigned int dev_num)
>         if (!mmc)
>                 return NULL;
>  
> +       if (mmc_init(mmc))
> +               return NULL;
> +
>         return ums_disk_init(mmc);
>  }

I agree, ACK.

-- 
Mateusz Zalega
Samsung R&D Institute Poland


More information about the U-Boot mailing list