public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <lukma@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 0/2] Series to clean handle_XXX() in f_dfu.c
Date: Tue, 21 Feb 2017 23:36:16 +0100	[thread overview]
Message-ID: <20170221233616.7afe9f76@jawa> (raw)
In-Reply-To: <1481910092-13844-1-git-send-email-patrick.delaunay73@gmail.com>

Hi Patrick,

> 
> 1/ DFU_GETSTATE response error
> 
> when the DFU device state is requested using libusb with DFU_GETSTATUS
> a error is generated : LIBUSB_ERROR_IO
> 
> I see the issue with my programmer tools based on dfu with libusb
> and I don't understood the actual code in U-Boot
> (req->actual is updated but not req->lenght ?)
> 
> With the proposed patch, I aligned the code on the GETSTATUS behavior:
> the correct lenght is provided in req->lenght as the other answer
> and the issue is solved.
> 
> PS: the issue not see with dfu-util as the existing function
>     dfu_get_state() is never called in main (with dfu-util 0.9)
> 
>     But I can reproduce the same issue with patched version of
> dfu-util to add call to this function, on the dfu-util master branch
> 
> diff --git a/src/main.c b/src/main.c
> index 7f31d4c..d99ace9 100644
> --- a/src/main.c
> +++ b/src/main.c
> @@ -535,6 +535,13 @@ dfustate:
>         }
> 
>  status_again:
> +       printf("Determining device state: ");
> +       ret = dfu_get_state(dfu_root->dev_handle,
> dfu_root->interface);
> +       if (ret < 0) {
> +               errx(EX_IOERR, "error get_state: %s",
> libusb_error_name(ret));
> +       }
> +       printf("state = %s\n", dfu_state_to_string(ret));
> +
>         printf("Determining device status: ");
>         ret = dfu_get_status(dfu_root, &status );
>         if (ret < 0) {
> 
> 
> 2/ harmonize handle_getstatus() with other function
> 
> => add return value with size of the buffer as
>    - handle_getstate() add in part 1
>    or existing functions
>    - handle_dnload()
>    - handle_upload()
> 
> 
> 
> Patrick Delaunay (2):
>   usb: gadget: dfu: correct size for USB_REQ_DFU_GETSTATE result
>   usb: gadget: dfu: add result for handle_getstatus()

First of all thank you very much for fixing several DFU issues.

Secondly, please find my deepest apologies for such long delay. It
will NOT happen again.
 
Your patches have been added to -dfu tree. I will send PR tomorrow.

I've also added following patch:
http://patchwork.ozlabs.org/patch/704131/

For all of them:

Acked-by: Lukasz Majewski <lukma@denx.de>
Tested-by: Lukasz Majewski <lukma@denx.de>

Test HW: BBB (am335x)
Test SW: test/py/dfu


> 
>  drivers/usb/gadget/f_dfu.c | 56
> ++++++++++++++++++++--------------------------
> drivers/usb/gadget/f_dfu.h |  1 - 2 files changed, 24 insertions(+),
> 33 deletions(-)
> 




Best regards,

Lukasz Majewski

--

DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de

      parent reply	other threads:[~2017-02-21 22:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-16 17:41 [U-Boot] [PATCH 0/2] Series to clean handle_XXX() in f_dfu.c Patrick Delaunay
2016-12-16 17:41 ` [U-Boot] [PATCH 1/2] usb: gadget: dfu: correct size for USB_REQ_DFU_GETSTATE result Patrick Delaunay
2016-12-16 17:41 ` [U-Boot] [PATCH 2/2] usb: gadget: dfu: add result for handle_getstatus() Patrick Delaunay
2017-02-21 22:36 ` 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=20170221233616.7afe9f76@jawa \
    --to=lukma@denx.de \
    --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