[U-Boot] Problems around fatwrite command from uboot

Jean Louis 1978.jl at gmail.com
Fri Mar 1 10:50:49 CET 2013


Hi Damien,

I see there are other set_cluster() uses and then your test of size=0 is
certainly at the good place.

It remains  for me to try to reproduce the "Invalid FAT entry" on one SD
(my first post) and test to reboot it with the new version patched uboot to
see if the new write of file doesn't block.

Thank you for your help.

----

2013/3/1 Damien HUANG 黄卫 <damienwei at hotmail.com>

> Why the size equals zero? it is coming from the same file, but within
> function "set_contents". look the below codes
>
>         actsize = bytesperclust;
>         ...
>         ...
>
>         /* actsize >= file size */
>         actsize -= bytesperclust;
>         /* set remaining clusters */
>         if (set_cluster(mydata, curclust, buffer, (int)actsize) != 0) {
>             debug("error: writing cluster\n");
>             return -1;
>         }
> Cheers,
>
> ------------------------------
> From: 1978.jl at gmail.com
> Date: Thu, 28 Feb 2013 12:21:53 +0100
> Subject: Re: [U-Boot] Problems around fatwrite command from uboot
> To: damienwei at hotmail.com
> CC: scott at jumpnowtek.com; u-boot at lists.denx.de; sean at bcodeme.com
>
> Hi,
>
> I confirm that your patch correct my problem and the bug disappear.
>
> The question is : why (or when) the size equals zero ?
>
> Thank you Damien.
>
> ----
>
> 2013/2/28 Damien HUANG 黄卫 <damienwei at hotmail.com>
>
> Hi,
> You received this email, because you had recently experienced fatwrite
> issue with uboot.
>
> The symptom of the problem is at the time of calling fatwrite to write a
> block of data to file, the below message would be shown, despite the
> message saying "xxxx bytes written" at the end, however, there was not data
> being actually stored.
>
> >* mmc_send_cmd: timedout waiting on cmd inhibit to clear*>* mmc_send_cmd: timedout waiting on cmd inhibit to clear*>* mmc_send_cmd: timedout waiting on cmd inhibit to clear*>* mmc_send_cmd: timedout waiting on cmd inhibit to clear*>* mmc_send_cmd: timedout waiting on cmd inhibit to clear*>* mmc_send_cmd: timedout waiting on cmd inhibit to clear*>* mmc_send_cmd: timedout waiting on cmd inhibit to clear*>* mmc_send_cmd: timedout waiting on cmd inhibit to clear*>* mmc_send_cmd: timedout waiting on cmd inhibit to clear*>* mmc_send_cmd: timedout waiting on cmd inhibit to clear*>* mmc_send_cmd: timedout waiting on cmd inhibit to clear
> *>* 42428 bytes written*
>
>
> After investigation, I believe the problem can be fixed at function
> "set_cluster" within file fat_write.c under directory /fs/fat (patch file
> was attached).
>
> The reason of the issue is: If function "set_cluster" was called with size
> equals ZERO, then the function would only issue the write instruction to
> MMC driver without data, this caused the MMC to be in a wait state for data
> and inhibiting further commands. As all subsequent commands to MMC would
> first check whether MMC is in inhibit state before actual command being
> issued, this check would always fail and time out occur, so the above
> message being displayed.
>
> Cheers,
> Damien
>
> ------------------------------
> From: 1978.jl at gmail.com
> Date: Wed, 27 Feb 2013 09:02:42 +0100
> Subject: Re: [U-Boot] Problems around fatwrite command from uboot
> To: damienwei at hotmail.com
>
> Hi Damien,
>
> I have only patched as I say on :
> http://lists.denx.de/pipermail/u-boot/2013-February/147407.html
>
> I have no more changes for the moment.
>
> Bye.
>
> ----
>
> 2013/2/27 Damien HUANG 黄卫 <damienwei at hotmail.com>
>
> Hi Jean,
> I saw your post in regard to the issue of fatwrite command from uboot. As
> I am also experienced with such an error, I am wonder if you got the
> problem fixed? If so, please share your success.
> Cheers,
> Damien
>
>
>


More information about the U-Boot mailing list