public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 2/2] usb:gadget:f_thor: fix write to filesystem by add dfu_flush()
Date: Wed, 23 Apr 2014 14:40:52 +0200	[thread overview]
Message-ID: <20140423144052.63157387@amdc2363> (raw)
In-Reply-To: <1398246231-22214-2-git-send-email-p.marczak@samsung.com>

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@samsung.com>
> Cc: Lukasz Majewski <l.majewski@samsung.com>
> Cc: Marek Vasut <marex@denx.de>
> Cc: Heiko Schocher <hs@denx.de>
> Cc: Tom Rini <trini@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

  reply	other threads:[~2014-04-23 12:40 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-17 17:31 [U-Boot] [PATCH] usb:gadget:f_thor: fix write to filesystem by add dfu_flush() Przemyslaw Marczak
2014-04-17 18:11 ` Marek Vasut
2014-04-18  7:48 ` [U-Boot] [PATCH v2 1/2] usb:gadget:f_thor: code cleanup in function download_tail() Przemyslaw Marczak
2014-04-18  7:48   ` [U-Boot] [PATCH v2 2/2] usb:gadget:f_thor: fix write to filesystem by add dfu_flush() Przemyslaw Marczak
2014-04-21 15:08     ` Marek Vasut
2014-04-21 15:08   ` [U-Boot] [PATCH v2 1/2] usb:gadget:f_thor: code cleanup in function download_tail() Marek Vasut
2014-04-23  9:43   ` [U-Boot] [PATCH v3 " Przemyslaw Marczak
2014-04-23  9:43     ` [U-Boot] [PATCH v3 2/2] usb:gadget:f_thor: fix write to filesystem by add dfu_flush() Przemyslaw Marczak
2014-04-23 12:40       ` Lukasz Majewski [this message]
2014-04-23 12:46         ` Marek Vasut
2014-04-28 16:57     ` [U-Boot] [PATCH v4 1/3] usb:gadget:f_thor: code cleanup in function download_tail() Przemyslaw Marczak
2014-04-28 16:57       ` [U-Boot] [PATCH v4 2/3] usb:gadget:f_thor: fix write to filesystem by add dfu_flush() Przemyslaw Marczak
2014-04-28 16:57       ` [U-Boot] [PATCH v4 3/3] drivers:dfu: dfu_flush(): add raw data flush to complete Przemyslaw Marczak
2014-05-06  6:30       ` [U-Boot] [PATCH v4 1/3] usb:gadget:f_thor: code cleanup in function download_tail() Przemyslaw Marczak
2014-05-09  7:21       ` Przemyslaw Marczak
2014-05-09  8:35         ` Lukasz Majewski
2014-05-10  9:41           ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140423144052.63157387@amdc2363 \
    --to=l.majewski@samsung.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox