Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1254860rdh; Fri, 27 Oct 2023 08:49:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGuhByVaFytRQCRaw/aGATeYhr1aQ1xnREZo1Zc+l4ZudFhyaNKsFvaL10ErdtjPaIN5cHm X-Received: by 2002:a05:6870:11cc:b0:1ea:323e:4f11 with SMTP id 12-20020a05687011cc00b001ea323e4f11mr2752261oav.3.1698421782820; Fri, 27 Oct 2023 08:49:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698421782; cv=none; d=google.com; s=arc-20160816; b=wDZerLc8Nv++r4PyMIXDDU79mcwN2ZoomgxFaBV/cOsg7KajUAbxnEGDSauhcld4mW aodLYVJoH5FmESPJgO7+kGWGsHg/+nCjZZJjKlxdOYL7fPTEUatFvUedqEbaxIR7/aij rFYz6987Tv8d4F7FuFQNNoGDyk+nl9LuiCRbKtJ2ET+4Uj0iTLrpmwCqFeqR+YyhXtTd rACPlIKiQLkcfG/rOcbLTx35wQxY1ARqS2Fq5IscD0J2J9uJ5NWzzhxX+ENQpoP3wUGc O/P8q5ay5mTEcdARWzZZ/OL0dS6bgXclwAmFkn034RUrAvyec5MPY8RUX2Qllpq+Y9nq Dkxw== 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=o1y6YbUIRA1mflJ5OBe1hpWmCvh3TBE9EZncmH/+XAg=; fh=5bZ4ih+3AtnlQpf6OSrZiPrRl1FXXZKlS4McXjplJnY=; b=OMoTN1fc80ZghDOILSd1Ou9cFR9Uq0Im+JBe/e8i3lhrC/52tLsVWUeH/eUJDR6g4x dQC04Wy4FzIHHE84ALGx7h0tAkutdyLSmWvg/rKeiOmw3RDwAQOKWoz+mgQd7Y0G69N0 rnkOzStHosi3lPL+8D7TWelip69Uo42y8+zy97VOY4o8Qb4EP70ZObWSHYKzCHw/mzaR Wi25o5ZdEcfaALW3u8njQSIp+ChiqtHS/aNihtbCxUClTyqnBa/d9nONAESQaWDWQkaZ bsAv2cWPw0+P8qmcX4oo7HPCO+uuPfx4e/VIkYpGSVpctJXxi6qTsBCixjNFogBFTZ8N AsZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id x196-20020a0dd5cd000000b005a7af4fe63dsi2836339ywd.107.2023.10.27.08.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 08:49:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 0769A81AA839; Fri, 27 Oct 2023 08:49:24 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231799AbjJ0PtR (ORCPT + 99 others); Fri, 27 Oct 2023 11:49:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231429AbjJ0PtQ (ORCPT ); Fri, 27 Oct 2023 11:49:16 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 56EFCB8 for ; Fri, 27 Oct 2023 08:49:14 -0700 (PDT) Received: (qmail 573361 invoked by uid 1000); 27 Oct 2023 11:49:13 -0400 Date: Fri, 27 Oct 2023 11:49:13 -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, s.shtylyov@omp.ru Subject: Re: [PATCH v7 2/2] usb: new quirk to reduce the SET_ADDRESS request timeout Message-ID: <7cbc1a70-2dcc-4a2a-99e6-fdd92bd5cc9b@rowland.harvard.edu> References: <20231027152029.104363-1-hgajjar@de.adit-jv.com> <20231027152029.104363-2-hgajjar@de.adit-jv.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231027152029.104363-2-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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 27 Oct 2023 08:49:24 -0700 (PDT) On Fri, Oct 27, 2023 at 05:20:29PM +0200, Hardik Gajjar wrote: > This patch introduces a new USB quirk, > USB_QUIRK_SHORT_SET_ADDRESS_REQ_TIMEOUT, which modifies the timeout value > for the SET_ADDRESS request. The standard timeout for USB request/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 request 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/parameters/quirks" > > Signed-off-by: Hardik Gajjar > --- Reviewed-by: Alan Stern