Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 494E0ECAAA1 for ; Sun, 30 Oct 2022 22:38:49 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 84EA285467; Sun, 30 Oct 2022 23:38:47 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667169527; bh=Pzo9QKe2LS9yTrCz6Ksn0hG1WwKR6F8ic1OluaCa6RE=; h=From:To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=dXfgMMEH+Ab1qgjrmEfskkGL4whah7mgdeuYOjTAPJNiUcgO5SE0LqJvffw6HBRDn aLUusbzo0o+/ga/yowiffws8hqwmlQPjdZzQOmzeEZvHBHsgOddAjw+oGLNe+ewPEx TSBvDzuZg3JbZ6Bw4I9G+xEH7kmujOY4H6aHKEaq11lLwp/RuJJX1qm342Jcy+cojO WRxXornwtWPYJ8USm1pJQmlqvzaRMG0g0TB6bhHxvf3B3Zx0RbS42y4QOyqvYgAE9U sqOtQDTPohAsMrUQ9cXi5UgzzYr3+P5XayYwCB0sP7HUOnPUW/PfVnAXh/6bi0LOfn b0Dpgqg+V3tHA== Received: from tr.lan (ip-86-49-120-218.bb.vodafone.cz [86.49.120.218]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 8AEAC8544D; Sun, 30 Oct 2022 23:38:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1667169525; bh=Pzo9QKe2LS9yTrCz6Ksn0hG1WwKR6F8ic1OluaCa6RE=; h=From:To:Cc:Subject:Date:From; b=xS1D/tu3ZXNxSyMe4W/Joxh8hWcd5k1xDj5zXI9QRA62Cul+3W4KrJD1s/rSbcXea 3iVc/kECAPOav/RiFiNQ2kHy9rUDHittpb1/7qD6rt+AMU9hHpnDGMk521JscF2Bt1 HIC62rtOHcDI1lkRAPIhGTzas83mfSP6AZGG7Fs7CxO8D8lbqaTr/uZZrLjCxYX3HF AdujWIyT0Pnln2ho4CzTnMCbNQcx5K4nfIPRsyGpkmN+RmlO208uG773H3TaAmPoQv 3ZpFffo5c1eU468qHc/2AfB6rx9ufYUoHr+3Hz6k7Unc0ww8vXNJRVCZEu4NT2inr5 QJtld0XZ+0cvQ== From: Marek Vasut To: u-boot@lists.denx.de Cc: Marek Vasut , Janne Grunau , Mark Kettenis Subject: [PATCH] usb: Add 1ms delay after first Get Descriptor request Date: Sun, 30 Oct 2022 23:38:35 +0100 Message-Id: <20221030223835.422976-1-marex@denx.de> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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 before issuing subsequent requests to avoid probe failure with this device, since it can be used to connect USB keyboards. Signed-off-by: Marek Vasut --- Cc: Janne Grunau Cc: Mark Kettenis --- common/usb.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/common/usb.c b/common/usb.c index 6fcf1e8428e..ae9253dfc0e 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