Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp170752rda; Sat, 21 Oct 2023 03:16:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE+tgOTZ1FC+V0VmMnPFbJBqrIHkD/OgXaTf/PPSnazrGw0toHD39phR/6KpY+e0T/m4Sfi X-Received: by 2002:a17:90b:188d:b0:27d:6d9c:6964 with SMTP id mn13-20020a17090b188d00b0027d6d9c6964mr3955865pjb.26.1697883394766; Sat, 21 Oct 2023 03:16:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697883394; cv=none; d=google.com; s=arc-20160816; b=RwYwvgFXJjJ2B6aUwlHWGu26ZQAzWH4y8bbZ4xWRa0xrZQSR+Cj/i1CCyBCt7UbSNJ gHOLM3n0yP05a/3KllbWnKuagdXCNtbOo31MrRJFdMLgrZfm/CMoD2Oujh3zz6JWocbY qLe0Eiwl+jzwoYybMUw+assXjWly7czkHQzEo81Uuu9YbjPLo6KRlytJzbaIEEzRgpNN p0JU4QgQJQnRFqti0Pmsue/x5P3cwyWWP7CSpTdX3hXp9EWmsC9z+DE0sc2CBKOyPjEq 62JDAHC1Dn+LkWZA6bENxvLGEFqKWjYCmVh8NgO0CQZdxOyFesZJ6CSVhGB7zfyKf/ZY lXUw== 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:dkim-signature; bh=lEJCtbD8Ifz8x3fKpEg99ByAedOUQ1j9HklKq/fJVGo=; fh=jIsCGb2p1WG20KGkRtVxrmxjp74rhaUOeI22XqrpPmw=; b=kFr4j204vu9RxwZUU3Ss1iYxazq6oqQJD3vT6l84h6lDkS77qL092nLirUrLlHtT0j y0GEftpXafpG8cHebzQSTuBDB8W5icBkpA4XYoHQ8F1JZjQ9gYwPes207n6YdKVE+m/g top7ofkwGZC4gkx3Kf6h+lzztmBQKmg9QhXomMCI7Es2PGd7ViC+cxR0ffAhFo221Myp Z3V4N2oGJoL6LKIiybf93xpB01WKD+VFrKL8X55PROQaQVAioTXRm26VXN/VIJfOWZXB fYDXE0qCiIjhLpjuhUwlG3qO253soLSrguKvDiOzHebYQ9/0zWhjB4rFqtDGwGd7AjTD ou2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZNrC8WRT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id pf7-20020a17090b1d8700b0027d158c7bb7si4806629pjb.155.2023.10.21.03.16.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Oct 2023 03:16:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ZNrC8WRT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 3C1478082DDE; Sat, 21 Oct 2023 03:16:30 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230321AbjJUKQQ (ORCPT + 99 others); Sat, 21 Oct 2023 06:16:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230216AbjJUKQP (ORCPT ); Sat, 21 Oct 2023 06:16:15 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1D1810FC for ; Sat, 21 Oct 2023 03:15:38 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2484C433C8; Sat, 21 Oct 2023 10:15:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1697883338; bh=xE0tYUlCrfmA5ifWfxBsHGThFtSt5cm5A10aM2uArNs=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ZNrC8WRT6OA/H2vcGgO2NLbvKH7IiXL6J9wRT+BNNZ2qyFCDI+Fa6vk4Pe8BaCt/6 jiCDihCdWQq2LENnubfRV+HuqBI0jQel8x65j1Fq79hogoQ7yeqwLU6PFWc8vyk4f3 yCITKQ0u4J/rBeG2jDSOSS966GtmGy6nixvMIMo4= Date: Sat, 21 Oct 2023 12:15:35 +0200 From: Greg KH To: Alan Stern Cc: Hardik Gajjar , mathias.nyman@intel.com, yangyingliang@huawei.com, jinpu.wang@ionos.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, erosca@de.adit-jv.com Subject: Re: [PATCH v4] usb: core: hub: Add quirks for reducing device address timeout Message-ID: <2023102105-attribute-pajamas-a0dc@gregkh> References: <2023101155-unframed-satirical-f7ec@gregkh> <20231011164525.97616-1-hgajjar@de.adit-jv.com> <2023101620-shaky-sensitize-9708@gregkh> <20231017161021.GA62775@vmlxhi-118.adit-jv.com> <2023101750-bless-humorous-45c7@gregkh> <6c25beed-06fe-4be0-b51a-18e159d25072@rowland.harvard.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6c25beed-06fe-4be0-b51a-18e159d25072@rowland.harvard.edu> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 agentk.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 (agentk.vger.email [0.0.0.0]); Sat, 21 Oct 2023 03:16:30 -0700 (PDT) On Tue, Oct 17, 2023 at 02:59:54PM -0400, Alan Stern wrote: > On Tue, Oct 17, 2023 at 06:53:44PM +0200, Greg KH wrote: > > On Tue, Oct 17, 2023 at 06:10:21PM +0200, Hardik Gajjar wrote: > > > More logs and detailed in patch V1: > > > https://lore.kernel.org/linux-usb/20230818092353.124658-1-hgajjar@de.adit-jv.com/T/#m452ec9dad94e8181fdb050cd29483dd89437f7c1 > > > > > > > > > Achieving this is impossible in scenarios where the set_address is > > > > > not successful and waits for a timeout. > > > > > > > > Agreed, broken hardware is a pain, but if your device is allowed to take > > > > longer, it can, and will, so you have to support that. > > > > > > > The problem is not caused by the device taking an extended amount of time to > > > process the 'set_address' request. Instead, the issue lies in the absence of > > > any activity on the upstream bus until a timeout occurs. > > > > So, a broken device. Why are you then adding the hub to the quirk list > > and not the broken device? We are used to adding broken devices to > > qurik lists all the time, this shouldn't be new. > > Adding a quirk for the device isn't feasible, because the problem occurs > before the device has been initialized and enumerated. The kernel > doesn't know anything about the device at this point; only that it has > just connected. Ah, ick, you are right, but we do know the "broken hub" id, so that makes a bit more sense. Should this be a hub-only type quirk? > > > This situation arises when the host has already transmitted the 'set_address' command to the hub, > > > assuming that the device operates at full speed. However, the device connected > > > to the hub undergoes a state change from full speed to high-speed during this process. > > > > During which process? While the set-address happens? That feels like a > > hub bug then. > > > > > > > The shortened address device timeout quirks provide the flexibility > > > > > to align with a 3-second time limit in the event of errors. > > > > > By swiftly triggering a failure response and swiftly initiating > > > > > retry procedures, these quirks ensure efficient and rapid recovery, > > > > > particularly in automotive contexts where rapid smartphone enumeration > > > > > and screen projection are vital. > > > > > > > > Screen projection is a requirement that you should not be relying on USB > > > > for as USB has a different set of required timeouts, right? This sounds > > > > like a bad hardware design, if not an impossible one. > > > > > > > > > > Screen projection for us means displaying the connected phone on the screen and > > > launching Carplay and Android Auto for the user. This works perfectly in nearly all > > > cases, except in scenarios like this one where a combination of a special hub and > > > a specific phone model is causing the issue > > > > So which is broken, the hub or phone? > > It sounds like both of them are broken to some extent, although we can't > tell for sure without seeing what's actually happening on the USB bus > (i.e., bus analyzer output): > > The phone seems to take too long to activate its high-speed > terminations and deactivate the full-speed terminations. > > The hub doesn't seem to realize that the phone has disconnected > its full-speed connection and switched to high-speed. > > But without real data, these are just best guesses. Agreed, Hardik, can you look at some bus traces to figure out where the root problem here is? thanks, greg k-h