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] dfu: add write error handling
Date: Fri, 20 Jun 2014 09:54:06 +0200	[thread overview]
Message-ID: <20140620095406.0b85fc0b@amdc2363> (raw)
In-Reply-To: <1402512488-31957-1-git-send-email-swarren@wwwdotorg.org>

Hi Stephen,

> From: Stephen Warren <swarren@nvidia.com>
> 
> Fix calls to dfu_write() and dfu_flush() to detect errors in the I/O
> itself. This could happen due to problems with the storage medium, or
> simply when trying to write a FAT/ext file that is larger than the
> buffer dfu_mmc.c maintains for this purpose.
> 
> Signal the error by switching the DFU state/status. This will be
> picked up by the DFU client when it sends the next DFU request. Note
> that errors can't simply be returned from e.g.
> dnload_request_complete(), since that function has no way to pass
> errors back to the DFU client; a call to dnload_request_complete()
> simply means that a USB OUT completed.
> 
> This error state/status needs to be cleared when the next DFU client
> connects. While there is a DFU_CLRSTATUS request, no DFU client seems
> to send this. Hence, clear this when selecting the USB alternate
> setting on the USB interface.
> 
> Finally, dfu.c relies on a call to dfu_flush() to clear up the
> internal state of the write transaction. Now that errors in
> dfu_write() are detected, dfu_flush() may no longer be called for
> every transaction. Separate out the cleanup code into a new function,
> and call it whenever dfu_write() fails, as well as from any call to
> dfu_flush().
> 
> Signed-off-by: Stephen Warren <swarren@nvidia.com>

Applied to u-boot-dfu

Thanks for the patch.

-- 
Best regards,

Lukasz Majewski

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

      parent reply	other threads:[~2014-06-20  7:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-11 18:48 [U-Boot] [PATCH] dfu: add write error handling Stephen Warren
2014-06-17  9:54 ` Lukasz Majewski
2014-06-20  7:54 ` Lukasz Majewski [this message]

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=20140620095406.0b85fc0b@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