Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp2614744rda; Wed, 25 Oct 2023 07:45:05 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHg+gp8v13J7I3FZDeRwcA1JLL+202EbPwDvtprthCRVFrUrY7cxHO7Rja1cwxeNOxp35Xg X-Received: by 2002:a9d:734b:0:b0:6b9:6a43:1f7c with SMTP id l11-20020a9d734b000000b006b96a431f7cmr15803426otk.26.1698245105444; Wed, 25 Oct 2023 07:45:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698245105; cv=none; d=google.com; s=arc-20160816; b=FZxsfLgu+oc/vM8Z1exFLbaNnk2Ml9gWCO1tciJrVt5fW5NYc3M7NjH99PMkXw+awn i4xLFAUIfeos3l3oiSZSVmDaAW9sqOnDkUhMcXblLBxhlo85D4lCAlR3u5SiYsUKAnlb Q5GAT+v7/N7BvNdF2Lvr/f46rzFpcTB84g63FltkvzBswlhYtRWp4ZlNfKthGM4sz1ga ez3A5DsC5pTjgMtExlheT/atmK2/9Q48/3i35NwTdgExH4B4eu79E52teZuGmgU3E9el vx3uJ+0l0clZN460t4aTeMG2GCv8/wJq46PRrnXHOgDYMSGEJj48yDdfwnwntKyq3W9B L3PQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=JQHOSe7coQ7JzicAouYfwutWRJWT5ADihn6QeyLu+ME=; fh=HTjQkSZd8A8nrxkm1hAUW0qUV/JcDH1pmONSMrFrMtg=; b=axskJS7TEDfZb37hy6GuorVhTzaiAJ59KyBk7c/rdnip75dalgw22l/P6dNTrh4BaS nvQIma4VJUp7Eci4pf/vYWnifV6SSWu6MweXkF2thi9gdNB6JdwIuYJd5qKBhbMV3M0F YiAixhEHn966A1R6TZexLSARJS/7My8U/5pZzRa7TAWEJmxNe2GcwKAEPfjM9mElkaSd epQyjODeKms1k4x+WNW2c651UvCkcXVTRdIBjeJ7MfQ2FLLARZOmDiJJf15+VZ9xD/pR 0V3Cd0fFaVZsxZ9dGVgw/TEGHg+0n8hypurMM+XmDAfA/ZvT54+AsbI6dvTYytHWGznT pMZg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id h186-20020a0dc5c3000000b005a1d7c4e015si12068627ywd.565.2023.10.25.07.45.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 25 Oct 2023 07:45:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=harvard.edu Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 1F66180C3A2B; Wed, 25 Oct 2023 07:45:00 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233628AbjJYOop (ORCPT + 99 others); Wed, 25 Oct 2023 10:44:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232800AbjJYOoo (ORCPT ); Wed, 25 Oct 2023 10:44:44 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 79140B0 for ; Wed, 25 Oct 2023 07:44:42 -0700 (PDT) Received: (qmail 496317 invoked by uid 1000); 25 Oct 2023 10:44:41 -0400 Date: Wed, 25 Oct 2023 10:44:41 -0400 From: Alan Stern To: Hardik Gajjar Cc: gregkh@linuxfoundation.org, mathias.nyman@intel.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, erosca@de.adit-jv.com Subject: Re: [PATCH v5] usb: Reduce 'set_address' command timeout with a new quirk Message-ID: <2345e113-71cd-4cf2-b910-45dd1bca3f13@rowland.harvard.edu> References: <20231025141316.117514-1-hgajjar@de.adit-jv.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231025141316.117514-1-hgajjar@de.adit-jv.com> X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 25 Oct 2023 07:45:00 -0700 (PDT) On Wed, Oct 25, 2023 at 04:13:16PM +0200, Hardik Gajjar wrote: > This patch introduces a new USB quirk, USB_QUIRK_SHORT_DEVICE_ADDR_TIMEOUT, > which modifies the timeout value for the 'set_address' command. The > standard timeout for this command is 5000 ms, as recommended in the USB > 3.2 specification (section 9.2.6.1). > > However, certain scenarios, such as connecting devices through an APTIV hub, > can lead to timeout errors when the device enumerates as full speed initially > and later switches to high speed during chirp negotiation. > > In such cases, USB analyzer logs reveal that the bus suspends for 5 seconds > due to incorrect chirp parsing and resumes only after two consecutive > timeout errors trigger a hub driver reset. > > Packet(54) Dir(?) Full Speed J(997.100 us) Idle( 2.850 us) > _______| Time Stamp(28 . 105 910 682) > _______|_________________________________________________________________Ch0 > Packet(55) Dir(?) Full Speed J(997.118 us) Idle( 2.850 us) > _______| Time Stamp(28 . 106 910 632) > _______|_________________________________________________________________Ch0 > Packet(56) Dir(?) Full Speed J(399.650 us) Idle(222.582 us) > _______| Time Stamp(28 . 107 910 600) > _______|_________________________________________________________________Ch0 > Packet(57) Dir Chirp J( 23.955 ms) Idle(115.169 ms) > _______| Time Stamp(28 . 108 532 832) > _______|_________________________________________________________________Ch0 > Packet(58) Dir(?) Full Speed J (Suspend)( 5.347 sec) Idle( 5.366 us) > _______| Time Stamp(28 . 247 657 600) > _______|_________________________________________________________________Ch0 > > This 5-second delay in device enumeration is undesirable, particularly in > automotive applications where quick enumeration is crucial > (ideally within 3 seconds). > > The newly introduced quirks provide the flexibility to align with a > 3-second time limit, as required in specific contexts like automotive > applications. > > By reducing the 'set_address' command timeout to 500 ms, the > system can respond more swiftly to errors, initiate rapid recovery, and > ensure efficient device enumeration. This change is vital for scenarios > where rapid smartphone enumeration and screen projection are essential. > To use the quirk, please write "vendor_id:product_id:p" to > /sys/bus/usb/drivers/hub/module/parameter/quirks > > For example, > echo "0x2c48:0x0132:p" > /sys/bus/usb/drivers/hub/module/parameter/quirks" > > Signed-off-by: Hardik Gajjar > --- > diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt > index 0a1731a0f0ef..3c03f23bd5d5 100644 > --- a/Documentation/admin-guide/kernel-parameters.txt > +++ b/Documentation/admin-guide/kernel-parameters.txt > @@ -6817,6 +6817,9 @@ > pause after every control message); > o = USB_QUIRK_HUB_SLOW_RESET (Hub needs extra > delay after resetting its port); > + p = USB_QUIRK_SHORT_DEVICE_ADDR_TIMEOUT (Timeout > + of set_address command reducing from > + 5000 ms to 500 ms) As a matter of grammatical style, it would be better to rephrase this as: Reduce timeout of set_address command from 5000 ms to 500 ms Apart from that one little nit, for the usbcore portions of the patch: Reviewed-by: Alan Stern Alan Stern