Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4818036yba; Wed, 8 May 2019 03:20:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqy/IjBogQzIzVt2iekFZCDq/P4siYdW0wSoOtdYq+rbqcoVrGgAKAFDJlhlgwavbM10sYUE X-Received: by 2002:aa7:91cb:: with SMTP id z11mr49071904pfa.64.1557310814033; Wed, 08 May 2019 03:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1557310814; cv=none; d=google.com; s=arc-20160816; b=wwg61fLE85pu1+1B8cOLGwm7d1b3P0lz1pYLantS4q1PP117rH88RxZv9K5eD3Bjmv GN7DqPjE2aFG296G0ZsoQTnmb/D3hFGPbz67ri7UGUXeRjZZE+NIw+oaMJq0pF7AvT2g Am5U5Z4ybj9+d0Gij+y5tpl6pI7uh9SEeG6+n5kPMOrzShZ3e5JMq3VSba9oECKGBIiO Bo3C7VkCV3hJLOwj1faMZCQpGGjhzcEVpAnni5LAoLy+uNsKmki6tZA6ii+KPsJK03DE ZjFqhheyLB6d/kwm+G/UeW2NySnwmcjtoghGQYBNZU2//iqa1zNkHz9jgt21Im8FVPLw fRlg== 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=pqrNHctYEvvU/ULyIgDiiCQKs9Yh6vsD69wq56oELYQ=; b=hPkGvZxlCDKKdoZPXsQDmZIB7PI5V6cljAulufra4muItHZtZDQSYBDweV3VPLyuZr 25PwbPmxtBh6sDpl43t7L3XDsq53IsYphqKnmuCbI18vEMKNKwaEUWTWVEpcBvq9V4aU WaKBf3T1YBEwvly/tgwuNzQ+Y545FguGsWxl6OCPw4VAOel/+0HeV9du/dyqWI8ZoURo hyjBcv0EnJ/89ngTzOt7iITaVfJIho8An3cNhtkeL6yo8mm94QfzaSkoFGE7SjjyTLmd 6hYQZFDv98XEJeCHV6q6vqenAHLf3xZmtoMIwafNVBZNcQVwriNCh3v/R09k/OaoiII2 09Yw== 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 x3si7491639plb.347.2019.05.08.03.19.58; Wed, 08 May 2019 03:20:14 -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 S1726970AbfEHKSd (ORCPT + 99 others); Wed, 8 May 2019 06:18:33 -0400 Received: from mga02.intel.com ([134.134.136.20]:3477 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726755AbfEHKSc (ORCPT ); Wed, 8 May 2019 06:18:32 -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; 08 May 2019 03:18:31 -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; 08 May 2019 03:18:28 -0700 Subject: Re: [PATCH v4 1/1] usb: xhci: Add Clear_TT_Buffer To: Alan Stern Cc: Jim Lin , 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: <6164e645-dce7-27a8-70b0-5e37a540f288@linux.intel.com> Date: Wed, 8 May 2019 13:21:03 +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 7.5.2019 17.29, Alan Stern wrote: > On Tue, 7 May 2019, Mathias Nyman wrote: > >> 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 > > I see. Thanks for the explanation; it makes sense now. The patch > description should explain this too. > > Wouldn't it be better to add a field containing the device address to > struct usb_device? And also export it, either in sysfs or debugfs? > It seems like the kind of thing that might be important for debugging. > If we did this then the usb_hub_clear_tt_buffer API wouldn't need to be > changed. > Agree, adding address to struct usb_device sounds better. -Mathias