From 5e450ab7039073bd0937871e4841964916d61e2d Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Mon, 31 Oct 2022 05:19:05 +0100 Subject: [PATCH] usb_setup_descriptor: Add 1ms delay in order to unbreak Logitech, Realforce and Keychron keyboards Logitech Unifying Receiver 046d:c52b bcdDevice 12.10 seems sensitive about the first Get Descriptor request. If there are any other requests in the same microframe, the device reports bogus data, first of the descriptor parts is not sent to the host. Wait over one microframe duration here (1mS for USB 1.x , 125uS for USB 2.0) to avoid triggering the issue. Tested-by: Thomas Glanzmann --- common/usb.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/usb.c b/common/usb.c index 6fcf1e8428..ae9253dfc0 100644 --- a/common/usb.c +++ b/common/usb.c @@ -999,6 +999,17 @@ static int usb_setup_descriptor(struct usb_device *dev, bool do_read) err = get_descriptor_len(dev, 64, 8); if (err) return err; + + /* + * Logitech Unifying Receiver 046d:c52b bcdDevice 12.10 seems + * sensitive about the first Get Descriptor request. If there + * are any other requests in the same microframe, the device + * reports bogus data, first of the descriptor parts is not + * sent to the host. Wait over one microframe duration here + * (1mS for USB 1.x , 125uS for USB 2.0) to avoid triggering + * the issue. + */ + mdelay(1); } dev->epmaxpacketin[0] = dev->descriptor.bMaxPacketSize0; -- 2.35.1