]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dwc2: use the nonblock argument in submit_int_msg
authorMichal Suchanek <msuchanek@suse.de>
Sun, 18 Aug 2019 08:55:28 +0000 (10:55 +0200)
committermarex <marex@chi.lan>
Wed, 11 Sep 2019 08:11:29 +0000 (10:11 +0200)
An USB 1.1 keyboard connected to dwc2 through a high-speed hub does not
report status until it changes. With this patch you can enable keyboard
by pressing a key while USB devices are probed. Without a keypress no
state is reported and the probe times out. We don't want to wait for a
keypress or timeout while polling for keypresses so implement an int_msg
nonblock variant that exits early on error.

Signed-off-by: Michal Suchanek <msuchanek@suse.de>
drivers/usb/host/dwc2.c

index bc6166283c63d6150011d215a17a0f7fb49c10db..350d820a6e50b914e564ea180eb804628d327164 100644 (file)
@@ -1123,7 +1123,7 @@ int _submit_int_msg(struct dwc2_priv *priv, struct usb_device *dev,
                        return -ETIMEDOUT;
                }
                ret = _submit_bulk_msg(priv, dev, pipe, buffer, len);
-               if (ret != -EAGAIN)
+               if ((ret != -EAGAIN) || nonblock)
                        return ret;
        }
 }