Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp3440722yba; Tue, 7 May 2019 00:59:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwvgE9mnn4nNZE4H+J/nksMyVsnov8GlgVMKPRwwgmVH9HGu53Hekby/lqHl9DewpAMp/vk X-Received: by 2002:aa7:8ec6:: with SMTP id b6mr11662806pfr.234.1557215949415; Tue, 07 May 2019 00:59:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557215949; cv=none; d=google.com; s=arc-20160816; b=PHQxtnQv29WtOE37OAmYNqNMA9uQHbaL0CmMf6tLcuaY0JLKluXnVz/c7biyj1Ntp5 Xe3Tiynqna5D8w0GOhim1RSWDMbsTY9bWD2pObthUNip/VbjKG5j0co6rCy+iaj27kAI kOL7bp9iNy78eU3wxvTZvg6pLinr0ouftX+0rpoox4mjs6SwYVRRApVT8Bh4vBeZwCd3 riEk6eiNc3FSYcdT+PNsevKlI59b3ND6xEfrJ2pAl9frJvSQImDLqN9dVlLW0t6X7oBy qGaUU7lHLNNvYFptfo7rV2xGjRVZ3DnzjCGpLxZrugYmGe4E8T1UqMc/4de7EOoUSJgs 56Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=pfnA11FRbi/AZCGx6TnOytGsYQzRJP0E+odU6K8RMcM=; b=I527Hiz218wAZU3PRsP9S5amT9NFUzvftp+X8VFepeNmz2Jv0m9jO3LZMXYap9Ywj5 Ue/kpO7Op9cQho6UYKtM/9sVeshoJuceHHB30ULSB+CXEKwdiVgL0hP6sHwufRGztSUV JPYBPif7a+gsO0UjcktxA03asGigXrE/nIYzZtJI0gp5QrFp/33/J1KJ/2JzIu8VDaRi hR5QmVLfVGj/Iof+0oYA3Pxdu1+tfPBdJ/MhKR2fX6tCu2xIUuvxw9PKBqoM4qYjv6YI CBq2Jwk33oNaUKcZWLv0LjmGTRcqaYL2W2+o48Bvz+MAdAQffu4/Rv8h/o/9wZ9KzcQw m/IQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6si8471492pgi.243.2019.05.07.00.58.53; Tue, 07 May 2019 00:59:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726732AbfEGH6F (ORCPT + 99 others); Tue, 7 May 2019 03:58:05 -0400 Received: from mga02.intel.com ([134.134.136.20]:8399 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbfEGH6F (ORCPT ); Tue, 7 May 2019 03:58:05 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 May 2019 00:58:04 -0700 X-ExtLoop1: 1 Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.164]) ([10.237.72.164]) by FMSMGA003.fm.intel.com with ESMTP; 07 May 2019 00:57:59 -0700 Subject: Re: [PATCH v4 1/1] usb: xhci: Add Clear_TT_Buffer To: Alan Stern , Jim Lin Cc: gregkh@linuxfoundation.org, mathias.nyman@intel.com, hminas@synopsys.com, kai.heng.feng@canonical.com, drinkcat@chromium.org, prime.zeng@hisilicon.com, malat@debian.org, nsaenzjulienne@suse.de, jflat@chromium.org, linus.walleij@linaro.org, clabbe@baylibre.com, colin.king@canonical.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: From: Mathias Nyman Message-ID: <9ea9fd3e-cf1a-9015-6d21-377c2fd41e66@linux.intel.com> Date: Tue, 7 May 2019 11:00:34 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 6.5.2019 17.57, Alan Stern wrote: > On Mon, 6 May 2019, Jim Lin wrote: > >> USB 2.0 specification chapter 11.17.5 says "as part of endpoint halt >> processing for full-/low-speed endpoints connected via a TT, the host >> software must use the Clear_TT_Buffer request to the TT to ensure >> that the buffer is not in the busy state". >> >> In our case, a full-speed speaker (ConferenceCam) is behind a high- >> speed hub (ConferenceCam Connect), sometimes once we get STALL on a >> request we may continue to get STALL with the folllowing requests, >> like Set_Interface. >> >> Here we add Clear_TT_Buffer for the following Set_Interface requests >> to get ACK successfully. >> >> Originally usb_hub_clear_tt_buffer uses urb->dev->devnum as device >> address while sending Clear_TT_Buffer command, but this doesn't work >> for XHCI. > > Why doesn't it work for xHCI? Clear-TT-Buffer is part of the USB 2.0 > spec; it should work exactly the same for xHCI as for a USB-2.0 host > controller. > > Alan Stern > For other host controllers udev->devnum is the same as the address of the usb device, chosen and set by usb core. With xHC the controller hardware assigns the address, and won't be the same as devnum. The Clear-TT-Buffer request sent to the hub includes the address of the LS/FS child device in wValue field. usb_hub_clear_tt_buffer() uses udev->devnum to set the address wValue. This won't work for devices connected to xHC -Mathias