[U-Boot] [PATCH v3 2/2] usb:gadget:f_thor: fix write to filesystem by add dfu_flush()

Lukasz Majewski l.majewski at samsung.com
Wed Apr 23 14:40:52 CEST 2014


Hi Przemyslaw,

> Since dfu read/write operations needs to be flushed manually,
> writing to filesystem on MMC by thor was broken. MMC raw write
> actually is working fine because current dfu_flush() function
> writes filesystem only. This commit adds dfu_flush() to f_thor
> and now filesystem write is working.
> 
> This change was tested on Trats2 board.
> 
> Signed-off-by: Przemyslaw Marczak <p.marczak at samsung.com>
> Cc: Lukasz Majewski <l.majewski at samsung.com>
> Cc: Marek Vasut <marex at denx.de>
> Cc: Heiko Schocher <hs at denx.de>
> Cc: Tom Rini <trini at ti.com>
> 
> ---
> Changes v2:
> - separate fix and cleanup into two commits
> 
> Changes v3:
> - none
> 
> ---
>  drivers/usb/gadget/f_thor.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/f_thor.c b/drivers/usb/gadget/f_thor.c
> index 1190c74..1420606 100644
> --- a/drivers/usb/gadget/f_thor.c
> +++ b/drivers/usb/gadget/f_thor.c
> @@ -226,8 +226,14 @@ static int download_tail(long long int left, int
> cnt)
>  	 * need fo call dfu_free_buf() is needed.
>  	 */
>  	ret = dfu_write(dfu_entity, transfer_buffer, 0, cnt);

	I think this dfu_write() call can be now removed, since what we
	expect now is to call the dfu_flush() here.

	After this change please accordingly update the above comment. 

> -	if (ret)
> +	if (ret) {
>  		error("DFU write failed [%d] cnt: %d", ret, cnt);
> +		goto exit;
> +	}
> +
> +	ret = dfu_flush(dfu_entity, transfer_buffer, 0, cnt);
> +	if (ret)
> +		error("DFU flush failed!");
>  
>  exit:
>  	return ret;



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group


More information about the U-Boot mailing list