dfu: Reset timeout in case of DFU request
PATCH 1/1 dfu: Reset timeout in case of DFU request
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.
--- drivers/usb/gadget/f_dfu.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/usb/gadget/f_dfu.c +5 -0
@@ -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 ) {
Signature · 1 line
2.24.1
PATCH 1/1 dfu: Reset timeout in case of DFU request
Op 29-01-2020 om 16:23 schreef Andy Shevchenko:
Quoted 17 lines
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 <[email protected]>--- drivers/usb/gadget/f_dfu.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/usb/gadget/f_dfu.c +0
-0@@ -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",
drivers/usb/gadget/f_dfu.c dfu_handle(struct usb_function *f, const struct usb_ctrlrequest *ctrl) · line 606
Quoted 10 lines
drivers/usb/gadget/f_dfu.c +5
-0req_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 ) {
PATCH 1/1 dfu: Reset timeout in case of DFU request
Quoted 20 lines · Ferry Toth
Op 29-01-2020 om 16:23 schreef Andy Shevchenko:
Quoted 19 lines
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 <[email protected]>--- drivers/usb/gadget/f_dfu.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/usb/gadget/f_dfu.c +2
-0@@ -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 */
Quoted 8 lines
drivers/usb/gadget/f_dfu.c dfu_handle(struct usb_function *f, const struct usb_ctrlrequest *ctrl)
Quoted 7 lines
drivers/usb/gadget/f_dfu.c +3
-0+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 <[email protected]>
Thanks, Ferry!
Lukasz, can this be applied for 2020.04 release?
Signature · 2 lines
With Best Regards, Andy Shevchenko
PATCH 1/1 dfu: Reset timeout in case of DFU request
In reply to Andy ShevchenkoQuoted 5 lines · 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.
Any news here? Can we get this applied for the 2020.04 release?
Quoted 24 lines
Signed-off-by Andy Shevchenko <[email protected]>--- drivers/usb/gadget/f_dfu.c | 5 +++++ 1 file changed, 5 insertions(+)drivers/usb/gadget/f_dfu.c +5
-0@@ -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 ) {Signature · 1 line
2.24.1
Signature · 2 lines
With Best Regards, Andy Shevchenko