Patchwork [U-Boot,REFERENCE,DON'T,APPLY,1/3] dfu: Add default value for bwPollTimeout

login
register
mail settings
Submitter stefan@datenfreihafen.org
Date April 3, 2012, 3:04 p.m.
Message ID <1333465497-29909-1-git-send-email-stefan@datenfreihafen.org>
Download mbox | patch
Permalink /patch/150460/
State RFC
Delegated to: Marek Vasut
Headers show

Comments

stefan@datenfreihafen.org - April 3, 2012, 3:04 p.m.
---
 drivers/usb/gadget/dfu.c |   11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)
Marek Vasut - April 6, 2012, 12:18 a.m.
Dear Stefan Schmidt,

Nice stuff, can you CC me when it comes to USB stuff, accidentally I became the 
new maintainer ? ;-)

> ---
>  drivers/usb/gadget/dfu.c |   11 ++++++++++-
>  1 file changed, 10 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c
> index 535e194..7aed344 100644
> --- a/drivers/usb/gadget/dfu.c
> +++ b/drivers/usb/gadget/dfu.c
> @@ -47,6 +47,10 @@
>  #include <malloc.h>
>  #include "dfu.h"
> 
> +#ifndef POLL_TIMEOUT_MILLISECONDS
> +#define POLL_TIMEOUT_MILLISECONDS 5
> +#endif
> +
>  static struct flash_entity *flash_ents;
>  static int num_flash_ents;
> 
> @@ -271,9 +275,14 @@ static void handle_getstatus(struct usb_request *req)
> 
>  	/* send status response */
>  	dstat->bStatus = dev->dfu_status;
> -	/* FIXME: set dstat->bwPollTimeout */
>  	dstat->bState = dev->dfu_state;
>  	dstat->iString = 0;
> +	/* FIXME: Use real values from flash subsystem here instead a hardcoded
> +	 * value */
> +	dstat->bwPollTimeout[0] = POLL_TIMEOUT_MILLISECONDS & 0xff;
> +	dstat->bwPollTimeout[1] = (POLL_TIMEOUT_MILLISECONDS >> 8) & 0xff;
> +	dstat->bwPollTimeout[2] = (POLL_TIMEOUT_MILLISECONDS >> 16) & 0xff;
> +	//req->actual = MIN(sizeof(*dstat), max);

What do you expect from me to tell you about this patch? Or do you expect 
someone else to comment on this?

>  }
> 
>  static void handle_getstate(struct usb_request *req)

Best regards,
Marek Vasut
Mike Frysinger - April 6, 2012, 3:35 a.m.
On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:
> What do you expect from me to tell you about this patch? Or do you expect
> someone else to comment on this?

he mentioned in the summary of the series.  he's run out of time, so he's 
dumping his WIP state in case someone else picks it up.
-mike
Marek Vasut - April 6, 2012, 1:06 p.m.
Dear Mike Frysinger,

> On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:
> > What do you expect from me to tell you about this patch? Or do you expect
> > someone else to comment on this?
> 
> he mentioned in the summary of the series.  he's run out of time, so he's
> dumping his WIP state in case someone else picks it up.

"Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts" this summary? I see, 
didn't notice it, but just read it.

Stefan, thanks for your work, I hope you'll be back eventually :)

> -mike

Best regards,
Marek Vasut
stefan@datenfreihafen.org - April 21, 2012, 2:28 p.m.
Hello.

On Fri, 2012-04-06 at 02:18, Marek Vasut wrote:
> 
> Nice stuff, can you CC me when it comes to USB stuff, accidentally I became the 
> new maintainer ? ;-)

Yeah, forgot about this while I was trying to get at leats my latest
state out of the door. If I will send an updated version I will put
you in CC.

regards
Stefan Schmidt
stefan@datenfreihafen.org - April 21, 2012, 2:30 p.m.
Hello.

On Fri, 2012-04-06 at 15:06, Marek Vasut wrote:
> 
> > On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:
> > > What do you expect from me to tell you about this patch? Or do you expect
> > > someone else to comment on this?
> > 
> > he mentioned in the summary of the series.  he's run out of time, so he's
> > dumping his WIP state in case someone else picks it up.
> 
> "Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts" this summary? I see, 
> didn't notice it, but just read it.
> 
> Stefan, thanks for your work, I hope you'll be back eventually :)

Time will tell. I still think its a worthwhile feature. I just need to
find some time, motivation and hardware to work on it again. Will take
at leats a couple of months though before I would start anything. Just
relocated to another country and still in need for a flat to rent and
sort out life and work. :)

regards
Stefan Schmidt
Marek Vasut - April 21, 2012, 3:38 p.m.
Dear Stefan Schmidt,

> Hello.
> 
> On Fri, 2012-04-06 at 15:06, Marek Vasut wrote:
> > > On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:
> > > > What do you expect from me to tell you about this patch? Or do you
> > > > expect someone else to comment on this?
> > > 
> > > he mentioned in the summary of the series.  he's run out of time, so
> > > he's dumping his WIP state in case someone else picks it up.
> > 
> > "Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts" this summary? I
> > see, didn't notice it, but just read it.
> > 
> > Stefan, thanks for your work, I hope you'll be back eventually :)
> 
> Time will tell. I still think its a worthwhile feature. I just need to
> find some time, motivation and hardware to work on it again. Will take
> at leats a couple of months though before I would start anything. Just
> relocated to another country and still in need for a flat to rent and
> sort out life and work. :)

Good luck on that :-)

> regards
> Stefan Schmidt

Best regards,
Marek Vasut
Ɓukasz Majewski - April 23, 2012, 7:27 a.m.
Dear Marek, Stefan

> Dear Stefan Schmidt,
> 
> > Hello.
> > 
> > On Fri, 2012-04-06 at 15:06, Marek Vasut wrote:
> > > > On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:
> > > > > What do you expect from me to tell you about this patch? Or
> > > > > do you expect someone else to comment on this?
> > > > 
> > > > he mentioned in the summary of the series.  he's run out of
> > > > time, so he's dumping his WIP state in case someone else picks
> > > > it up.
> > > 
> > > "Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts" this
> > > summary? I see, didn't notice it, but just read it.
> > > 
> > > Stefan, thanks for your work, I hope you'll be back eventually :)
> > 
> > Time will tell. I still think its a worthwhile feature. I just need
> > to find some time, motivation and hardware to work on it again.
> > Will take at leats a couple of months though before I would start
> > anything. Just relocated to another country and still in need for a
> > flat to rent and sort out life and work. :)
> 
> Good luck on that :-)
> 

I'm working on the composite gadget (as Marek know already :-)).
On top of the g_dnl USB composite download driver it is possible to lay
down the DFU function. 

Actualy we (I mean Andrzej Pietrasiewicz and me), have managed to
provide some proof-of-concept DFU code running with g_dnl driver (both
DFU + THOR). Unfortunately this code is not yet "finished" and THOR
protocol support has higher priority now.

When we post DFU patches we will add you guys on the Cc.
Marek Vasut - April 23, 2012, 9:38 a.m.
Dear Lukasz Majewski,

> Dear Marek, Stefan
> 
> > Dear Stefan Schmidt,
> > 
> > > Hello.
> > > 
> > > On Fri, 2012-04-06 at 15:06, Marek Vasut wrote:
> > > > > On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:
> > > > > > What do you expect from me to tell you about this patch? Or
> > > > > > do you expect someone else to comment on this?
> > > > > 
> > > > > he mentioned in the summary of the series.  he's run out of
> > > > > time, so he's dumping his WIP state in case someone else picks
> > > > > it up.
> > > > 
> > > > "Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts" this
> > > > summary? I see, didn't notice it, but just read it.
> > > > 
> > > > Stefan, thanks for your work, I hope you'll be back eventually :)
> > > 
> > > Time will tell. I still think its a worthwhile feature. I just need
> > > to find some time, motivation and hardware to work on it again.
> > > Will take at leats a couple of months though before I would start
> > > anything. Just relocated to another country and still in need for a
> > > flat to rent and sort out life and work. :)
> > 
> > Good luck on that :-)
> 
> I'm working on the composite gadget (as Marek know already :-)).
> On top of the g_dnl USB composite download driver it is possible to lay
> down the DFU function.
> 
> Actualy we (I mean Andrzej Pietrasiewicz and me), have managed to
> provide some proof-of-concept DFU code running with g_dnl driver (both
> DFU + THOR). Unfortunately this code is not yet "finished" and THOR
> protocol support has higher priority now.
> 
> When we post DFU patches we will add you guys on the Cc.

I hope to review your stuff ASAP

Best regards,
Marek Vasut
stefan@datenfreihafen.org - April 24, 2012, 7:40 p.m.
Hello.

On Mon, 2012-04-23 at 09:27, Lukasz Majewski wrote:
> > > 
> > > On Fri, 2012-04-06 at 15:06, Marek Vasut wrote:
> > > > > On Thursday 05 April 2012 20:18:16 Marek Vasut wrote:
> > > > > > What do you expect from me to tell you about this patch? Or
> > > > > > do you expect someone else to comment on this?
> > > > > 
> > > > > he mentioned in the summary of the series.  he's run out of
> > > > > time, so he's dumping his WIP state in case someone else picks
> > > > > it up.
> > > > 
> > > > "Re: [U-Boot] [PATCH 2/4] dfu: generic backend parts" this
> > > > summary? I see, didn't notice it, but just read it.
> > > > 
> > > > Stefan, thanks for your work, I hope you'll be back eventually :)
> > > 
> > > Time will tell. I still think its a worthwhile feature. I just need
> > > to find some time, motivation and hardware to work on it again.
> > > Will take at leats a couple of months though before I would start
> > > anything. Just relocated to another country and still in need for a
> > > flat to rent and sort out life and work. :)
> > 
> > Good luck on that :-)
> > 
> 
> I'm working on the composite gadget (as Marek know already :-)).
> On top of the g_dnl USB composite download driver it is possible to lay
> down the DFU function. 

Yeah, I have seen this patches. That is all fine with me. I'm not
bound to my patches at all. Having DFU in u-boot mainline is the goal.
:)

One of the problems I had was that I did not have hardware with a UDC
driver that is compatible with new gadget layer from the kernel ported
to u-boot. I agree that its the way to go to have composite and more
but it is quite hard to test against when only some drivers are
supporting it. The Beagleboard I used for most of the tests was still
using the musb driver with some glue and does not support it for
example.

That should not be a problem on your side as all Samsung UDCs are
written for the new gadget framework anyway.

> Actualy we (I mean Andrzej Pietrasiewicz and me), have managed to
> provide some proof-of-concept DFU code running with g_dnl driver (both
> DFU + THOR). Unfortunately this code is not yet "finished" and THOR
> protocol support has higher priority now.
> 
> When we post DFU patches we will add you guys on the Cc.

Thanks.

regards
Stefan Schmidt

Patch

diff --git a/drivers/usb/gadget/dfu.c b/drivers/usb/gadget/dfu.c
index 535e194..7aed344 100644
--- a/drivers/usb/gadget/dfu.c
+++ b/drivers/usb/gadget/dfu.c
@@ -47,6 +47,10 @@ 
 #include <malloc.h>
 #include "dfu.h"
 
+#ifndef POLL_TIMEOUT_MILLISECONDS
+#define POLL_TIMEOUT_MILLISECONDS 5
+#endif
+
 static struct flash_entity *flash_ents;
 static int num_flash_ents;
 
@@ -271,9 +275,14 @@  static void handle_getstatus(struct usb_request *req)
 
 	/* send status response */
 	dstat->bStatus = dev->dfu_status;
-	/* FIXME: set dstat->bwPollTimeout */
 	dstat->bState = dev->dfu_state;
 	dstat->iString = 0;
+	/* FIXME: Use real values from flash subsystem here instead a hardcoded
+	 * value */
+	dstat->bwPollTimeout[0] = POLL_TIMEOUT_MILLISECONDS & 0xff;
+	dstat->bwPollTimeout[1] = (POLL_TIMEOUT_MILLISECONDS >> 8) & 0xff;
+	dstat->bwPollTimeout[2] = (POLL_TIMEOUT_MILLISECONDS >> 16) & 0xff;
+	//req->actual = MIN(sizeof(*dstat), max);
 }
 
 static void handle_getstate(struct usb_request *req)