All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] dfu: Reset timeout in case of DFU request
@ 2020-01-29 15:23 Andy Shevchenko
  2020-01-30  9:27 ` Ferry Toth
  2020-02-17  8:20 ` Andy Shevchenko
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2020-01-29 15:23 UTC (permalink / raw)
  To: u-boot

In case dfu command is being executed with timeout option,
the timer may expire in the middle of DFU operation. If there
is DFU request coming, we may simple reset timeout value
to prevent aborting of ongoing DFU operation.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/usb/gadget/f_dfu.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
index 6756155133..a4a57ba5f5 100644
--- a/drivers/usb/gadget/f_dfu.c
+++ b/drivers/usb/gadget/f_dfu.c
@@ -596,6 +596,11 @@ dfu_handle(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
 	debug("req_type: 0x%x ctrl->bRequest: 0x%x f_dfu->dfu_state: 0x%x\n",
 	       req_type, ctrl->bRequest, f_dfu->dfu_state);
 
+#ifdef CONFIG_DFU_TIMEOUT
+	/* Forbid aborting by timeout. Next dfu command may update this */
+	dfu_set_timeout(0);
+#endif
+
 	if (req_type == USB_TYPE_STANDARD) {
 		if (ctrl->bRequest == USB_REQ_GET_DESCRIPTOR &&
 		    (w_value >> 8) == DFU_DT_FUNC) {
-- 
2.24.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v1] dfu: Reset timeout in case of DFU request
  2020-01-29 15:23 [PATCH v1] dfu: Reset timeout in case of DFU request Andy Shevchenko
@ 2020-01-30  9:27 ` Ferry Toth
  2020-02-10 16:42   ` Andy Shevchenko
  2020-02-17  8:20 ` Andy Shevchenko
  1 sibling, 1 reply; 4+ messages in thread
From: Ferry Toth @ 2020-01-30  9:27 UTC (permalink / raw)
  To: u-boot

Op 29-01-2020 om 16:23 schreef Andy Shevchenko:
> In case dfu command is being executed with timeout option,
> the timer may expire in the middle of DFU operation. If there
> is DFU request coming, we may simple reset timeout value
> to prevent aborting of ongoing DFU operation.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>   drivers/usb/gadget/f_dfu.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
> index 6756155133..a4a57ba5f5 100644
> --- a/drivers/usb/gadget/f_dfu.c
> +++ b/drivers/usb/gadget/f_dfu.c
> @@ -596,6 +596,11 @@ dfu_handle(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
>   	debug("req_type: 0x%x ctrl->bRequest: 0x%x f_dfu->dfu_state: 0x%x\n",
>   	       req_type, ctrl->bRequest, f_dfu->dfu_state);
>   
> +#ifdef CONFIG_DFU_TIMEOUT
> +	/* Forbid aborting by timeout. Next dfu command may update this */
> +	dfu_set_timeout(0);
> +#endif
> +
>   	if (req_type == USB_TYPE_STANDARD) {
>   		if (ctrl->bRequest == USB_REQ_GET_DESCRIPTOR &&
>   		    (w_value >> 8) == DFU_DT_FUNC) {
> 
Tested-by: Ferry Toth <ftoth@exalondelft.nl>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1] dfu: Reset timeout in case of DFU request
  2020-01-30  9:27 ` Ferry Toth
@ 2020-02-10 16:42   ` Andy Shevchenko
  0 siblings, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2020-02-10 16:42 UTC (permalink / raw)
  To: u-boot

On Thu, Jan 30, 2020 at 10:27:20AM +0100, Ferry Toth wrote:
> Op 29-01-2020 om 16:23 schreef Andy Shevchenko:
> > In case dfu command is being executed with timeout option,
> > the timer may expire in the middle of DFU operation. If there
> > is DFU request coming, we may simple reset timeout value
> > to prevent aborting of ongoing DFU operation.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> >   drivers/usb/gadget/f_dfu.c | 5 +++++
> >   1 file changed, 5 insertions(+)
> > 
> > diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
> > index 6756155133..a4a57ba5f5 100644
> > --- a/drivers/usb/gadget/f_dfu.c
> > +++ b/drivers/usb/gadget/f_dfu.c
> > @@ -596,6 +596,11 @@ dfu_handle(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
> >   	debug("req_type: 0x%x ctrl->bRequest: 0x%x f_dfu->dfu_state: 0x%x\n",
> >   	       req_type, ctrl->bRequest, f_dfu->dfu_state);
> > +#ifdef CONFIG_DFU_TIMEOUT
> > +	/* Forbid aborting by timeout. Next dfu command may update this */
> > +	dfu_set_timeout(0);
> > +#endif
> > +
> >   	if (req_type == USB_TYPE_STANDARD) {
> >   		if (ctrl->bRequest == USB_REQ_GET_DESCRIPTOR &&
> >   		    (w_value >> 8) == DFU_DT_FUNC) {
> > 
> Tested-by: Ferry Toth <ftoth@exalondelft.nl>

Thanks, Ferry!

Lukasz, can this be applied for 2020.04 release?

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v1] dfu: Reset timeout in case of DFU request
  2020-01-29 15:23 [PATCH v1] dfu: Reset timeout in case of DFU request Andy Shevchenko
  2020-01-30  9:27 ` Ferry Toth
@ 2020-02-17  8:20 ` Andy Shevchenko
  1 sibling, 0 replies; 4+ messages in thread
From: Andy Shevchenko @ 2020-02-17  8:20 UTC (permalink / raw)
  To: u-boot

On Wed, Jan 29, 2020 at 05:23:14PM +0200, Andy Shevchenko wrote:
> In case dfu command is being executed with timeout option,
> the timer may expire in the middle of DFU operation. If there
> is DFU request coming, we may simple reset timeout value
> to prevent aborting of ongoing DFU operation.
> 

Any news here? Can we get this applied for the 2020.04 release?

> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  drivers/usb/gadget/f_dfu.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/usb/gadget/f_dfu.c b/drivers/usb/gadget/f_dfu.c
> index 6756155133..a4a57ba5f5 100644
> --- a/drivers/usb/gadget/f_dfu.c
> +++ b/drivers/usb/gadget/f_dfu.c
> @@ -596,6 +596,11 @@ dfu_handle(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
>  	debug("req_type: 0x%x ctrl->bRequest: 0x%x f_dfu->dfu_state: 0x%x\n",
>  	       req_type, ctrl->bRequest, f_dfu->dfu_state);
>  
> +#ifdef CONFIG_DFU_TIMEOUT
> +	/* Forbid aborting by timeout. Next dfu command may update this */
> +	dfu_set_timeout(0);
> +#endif
> +
>  	if (req_type == USB_TYPE_STANDARD) {
>  		if (ctrl->bRequest == USB_REQ_GET_DESCRIPTOR &&
>  		    (w_value >> 8) == DFU_DT_FUNC) {
> -- 
> 2.24.1
> 

-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-02-17  8:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-29 15:23 [PATCH v1] dfu: Reset timeout in case of DFU request Andy Shevchenko
2020-01-30  9:27 ` Ferry Toth
2020-02-10 16:42   ` Andy Shevchenko
2020-02-17  8:20 ` Andy Shevchenko

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.