[U-Boot] ext4write issue.

Przemyslaw Marczak p.marczak at samsung.com
Mon May 25 11:36:40 CEST 2015


Hello Durga,

On 05/25/2015 09:01 AM, S Durga Prasad Paladugu wrote:
> Hi all,
>
> I am having an ext4write issue on zynq, which fails when i am trying to
> write a file to ext4 formatted SD card. here is the log below.
>
> zynq-uboot> ext4ls mmc 0:2
> <DIR>       1024 .
> <DIR>       1024 ..
> <DIR>       1024 lost+found
> zynq-uboot>
> zynq-uboot>
> zynq-uboot> ext4write mmc 0:2 0x40000000 /bar.txt 10
> File System is consistent
> sdhci_send_command: MMC: 0 busy timeout increasing to: 200 ms.
> sdhci_send_command: MMC: 0 busy timeout increasing to: 400 ms.
> sdhci_send_command: MMC: 0 busy timeout increasing to: 800 ms.
> sdhci_send_command: MMC: 0 busy timeout increasing to: 1600 ms.
> sdhci_send_command: MMC: 0 busy timeout increasing to: 3200 ms.

It seem that your card is slowly.
You can test it by:
- increasing this timeout by adding: "#define
  CONFIG_SDHCI_CMD_MAX_TIMEOUT 10000 " (10 sec) to your board config.
- you can try erase your card by command: mmc erase ...,
  and then create new partition table and filesystems.
- try another sd card ?

Usually, when card is busy, it means that the last command didn't 
finished and/or the card is doing some background operations. I have 
seen this for in few eMMC cards, but for eMMC we can enable bkops 
manually and wait until card finishes.

> sdhci_send_command: MMC: 0 busy timeout.
> sdhci_send_command: MMC: 0 busy timeout.
> sdhci_send_command: MMC: 0 busy timeout.
> sdhci_send_command: MMC: 0 busy timeout.
> sdhci_send_command: MMC: 0 busy timeout.
> sdhci_send_command: MMC: 0 busy timeout.
> sdhci_send_command: MMC: 0 busy timeout.
>   ** ext4fs_devread read error - block
> sdhci_send_command: MMC: 0 busy timeout.
> sdhci_send_command: MMC: 0 busy timeout.
>   ** ext4fs_devread read error - block
> Error in getting the block group descriptor table
> sdhci_send_command: MMC: 0 busy timeout.
> sdhci_send_command: MMC: 0 busy timeout.
>   ** ext2fs_devread() read error **
> sdhci_send_command: MMC: 0 busy timeout.
>   ** ext4fs_devread read error - block
> sdhci_send_command: MMC: 0 busy timeout.
> sdhci_send_command: MMC: 0 busy timeout.
>   ** ext4fs_devread read error - block
> sdhci_send_command: MMC: 0 busy timeout.
> error in File System init
> ** Error ext4fs_write() **
> zynq-uboot>
> sdhci_send_command: MMC: 0 busy timeout.
> ** Can't read partition table on 0:0 **
> ** Invalid partition 2 **
> zynq-uboot>  ext4ls mmc 0:2
> sdhci_send_command: MMC: 0 busy timeout.
> ** Can't read partition table on 0:0 **
> ** Invalid partition 2 **
> zynq-uboot>
>
> I further debugged and found that the same is working with single block
> write commands instead of multi block write commands. Here is the diff of
> the changes i made to make it single block write.
>
>   drivers/mmc/mmc_write.c |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/mmc_write.c b/drivers/mmc/mmc_write.c
> index aa2fdef..269d233 100644
> --- a/drivers/mmc/mmc_write.c
> +++ b/drivers/mmc/mmc_write.c
> @@ -167,7 +167,7 @@ ulong mmc_bwrite(int dev_num, lbaint_t start, lbaint_t
> blkcnt, const void *src)
>    return 0;
>
>    do {
> - cur = (blocks_todo > mmc->b_max) ?  mmc->b_max : blocks_todo;
> + cur = 1;
>    if (mmc_write_blocks(mmc, start, cur, src) != cur)
>    return 0;
>    blocks_todo -= cur;
>

Best regards,
-- 
Przemyslaw Marczak
Samsung R&D Institute Poland
Samsung Electronics
p.marczak at samsung.com


More information about the U-Boot mailing list