From: Michael Brown Date: Tue, 29 Sep 2020 09:16:14 +0000 (+0100) Subject: [usb] Reset control endpoints immediately after failure X-Git-Tag: v1.21.1~97 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f42ba772c8050da266b69504efff8e16f2fda8c2;p=thirdparty%2Fipxe.git [usb] Reset control endpoints immediately after failure The current error handling mechanism defers the endpoint reset until the next use of the endpoint, on the basis that errors are detected during completions and completion handling should not recursively call usb_poll(). In the case of usb_control(), we are already at the level that calls usb_poll() and can therefore safely perform the endpoint reset immediately. This has no impact on functionality, but does make debugging traces easier to read since the reset will appear immediately after the causative error. Signed-off-by: Michael Brown --- diff --git a/src/drivers/bus/usb.c b/src/drivers/bus/usb.c index a7b687528..74f11ecb8 100644 --- a/src/drivers/bus/usb.c +++ b/src/drivers/bus/usb.c @@ -818,6 +818,7 @@ int usb_control ( struct usb_device *usb, unsigned int request, "failed: %s\n", usb->name, request, value, index, strerror ( rc ) ); free_iob ( cmplt ); + usb_endpoint_reset ( ep ); return rc; }