Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6193875ybl; Mon, 23 Dec 2019 01:38:19 -0800 (PST) X-Google-Smtp-Source: APXvYqwEKqnnuAiJNqM8T9XscTxuhnkxLU6fFLIX7DRoKTEmPH1kii3cLvPzNmqc/orkkw4ImV6e X-Received: by 2002:a05:6830:1cd3:: with SMTP id p19mr15459688otg.70.1577093899583; Mon, 23 Dec 2019 01:38:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577093899; cv=none; d=google.com; s=arc-20160816; b=O0lO3HH3dIz+XqKaH01+P0KLsMwn/RPqRgiCT3XNX2jiy8R8hcpEyyvC888gL3n3Se VI7waH2D6iNfkrOKFWrQzTLOl+7+0dN6nzosMgEHD4b9BlO/nGIrvayI8to50nljNftF 3BenCkEemaHd82ri0jSIQtunarbe7K7aRVVgFeAGvwGzqksak/OHU2oeiIV5azo7LI7u rMASI6pwrq5HvQ/piGDjBoO0HADTtyT6N5/9Z9inqIYwATQ7EIKHXTP+A4FZdhDsrbk0 PnoyoCg1/OfZ5ftu2IXPq/YoJF34NiV8NJPTBsaX/NsybreeRiytyzd0mrXk29flszJb Tidg== 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=XT87GgmLF6eqk4oOVtFGpdZuObXppbjUX8LUwa/YDxA=; b=HQr8+mRNDOmGGqnEXhZjpAJqEp3sip33WuEgEUB6RUev3U1VpcxMpooBDNFyo9ehSP AGK4Xgi+97mXmbLoKDD/mBfPDh+NNmsWJN3rf2W+Ni+jUCuV5sDr1Hemm81ajr4s3Zwp E9mEfTPIsXmRpM9mpISkwOzeiDCFV4YGozxZIUwUYdr2nRFhQHxZnbN1m7uJ7JsL20p/ vfbQ1vf+c2nWp81KhyEMcUbLU07tD8A4Oy9uj22Ia1MMaec0F5cQc55s7NImkkKCmAYX cmW+Vq83oPSV+WgWijLSPfpK7xq9NW1uoFPjEuFjlX8dedHWWsOqMSQqjQRXCO4+d2WN c+7A== 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 e6si10014915otq.217.2019.12.23.01.38.07; Mon, 23 Dec 2019 01:38:19 -0800 (PST) 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 S1726691AbfLWJhY (ORCPT + 99 others); Mon, 23 Dec 2019 04:37:24 -0500 Received: from mga18.intel.com ([134.134.136.126]:35890 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726177AbfLWJhY (ORCPT ); Mon, 23 Dec 2019 04:37:24 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 23 Dec 2019 01:37:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.69,347,1571727600"; d="scan'208";a="299630945" Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.170]) ([10.237.72.170]) by orsmga001.jf.intel.com with ESMTP; 23 Dec 2019 01:37:21 -0800 Subject: Re: USB devices on Dell TB16 dock stop working after resuming To: Paul Menzel , Mika Westerberg Cc: Mario Limonciello , Andreas Noever , Michael Jamet , Yehezkel Bernat , Christian Kellner , linux-kernel@vger.kernel.org, Anthony Wong References: <20191104154446.GH2552@lahna.fi.intel.com> <20191104162103.GI2552@lahna.fi.intel.com> <20191120105048.GY11621@lahna.fi.intel.com> <20191122105012.GD11621@lahna.fi.intel.com> <20191122112921.GF11621@lahna.fi.intel.com> <20191122114108.GG11621@lahna.fi.intel.com> <4b25e707-d2b5-11d1-4b16-48122828fde7@linux.intel.com> From: Mathias Nyman Message-ID: <87670037-8af5-c209-cbf8-70042e0a8fc5@linux.intel.com> Date: Mon, 23 Dec 2019 11:39:16 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20.12.2019 16.25, Paul Menzel wrote: > Dear Mathias, > > > On 2019-11-26 13:44, Mathias Nyman wrote: >> On 26.11.2019 13.33, Paul Menzel wrote: > >>> On 2019-11-25 10:20, Mathias Nyman wrote: >>>> On 22.11.2019 13.41, Mika Westerberg wrote: >>>>> On Fri, Nov 22, 2019 at 12:33:44PM +0100, Paul Menzel wrote: >>> >>>>>> On 2019-11-22 12:29, Mika Westerberg wrote: >>>>>>> On Fri, Nov 22, 2019 at 12:05:13PM +0100, Paul Menzel wrote: >>>>>> >>>>>>>> On 2019-11-22 11:50, Mika Westerberg wrote: >>>>>>>>> On Wed, Nov 20, 2019 at 12:50:53PM +0200, Mika Westerberg wrote: >>>>>>>>>> On Tue, Nov 19, 2019 at 05:55:43PM +0100, Paul Menzel wrote: >>>>>>>> >>>>>>>>>>> On 2019-11-04 17:21, Mika Westerberg wrote: >>>>>>>>>>>> On Mon, Nov 04, 2019 at 05:11:10PM +0100, Paul Menzel wrote: >>>>>>>>>>> >>>>>>>>>>>>> On 2019-11-04 16:49, Mario.Limonciello@dell.com wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>>> From: Mika Westerberg >>>>>>>>>>>>>>> Sent: Monday, November 4, 2019 9:45 AM >>>>>>>>>>>>> >>>>>>>>>>>>>>> On Mon, Nov 04, 2019 at 04:44:40PM +0200, Mika Westerberg wrote: >>>>>>>>>>>>>>>> On Mon, Nov 04, 2019 at 04:25:03PM +0200, Mika Westerberg wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>>>>> On Mon, Nov 04, 2019 at 02:13:13PM +0100, Paul Menzel wrote: >>>>>>>>>>>>> >>>>>>>>>>>>>>>>>> On the Dell XPS 13 9380 with Debian Sid/unstable with Linux 5.3.7 >>>>>>>>>>>>>>>>>> suspending the system, and resuming with Dell’s Thunderbolt TB16 >>>>>>>>>>>>>>>>>> dock connected, the USB input devices, keyboard and mouse, >>>>>>>>>>>>>>>>>> connected to the TB16 stop working. They work for a few seconds >>>>>>>>>>>>>>>>>> (mouse cursor can be moved), but then stop working. The laptop >>>>>>>>>>>>>>>>>> keyboard and touchpad still works fine. All firmware is up-to-date >>>>>>>>>>>>>>>>>> according to `fwupdmgr`. >>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>> What are the exact steps to reproduce? Just "echo mem > >>>>>>>>>>>>>>>>> /sys/power/state" and then resume by pressing power button? >>>>>>>>>>>>> >>>>>>>>>>>>> GNOME Shell 3.34.1+git20191024-1 is used, and the user just closes the >>>>>>>>>>>>> display. So more than `echo mem > /sys/power/state` is done. What >>>>>>>>>>>>> distribution do you use? >>>>>>>>>>>> >>>>>>>>>>>> I have buildroot based "distro" so there is no UI running. >>>>>>>>>>> >>>>>>>>>>> Hmm, this is quite different from the “normal” use-case of the these devices. >>>>>>>>>>> That way you won’t hit the bugs of the normal users. ;-) >>>>>>>>>> >>>>>>>>>> Well, I can install some distro to that thing also :) I suppose Debian >>>>>>>>>> 10.2 does have this issue, no? >>>>>>>>>> >>>>>>>>>>>>>>>> I tried v5.4-rc6 on my 9380 with TB16 dock connected and did a couple of >>>>>>>>>>>>>>>> suspend/resume cycles (to s2idle) but I don't see any issues. >>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>> I may have older/different firmware than you, though. >>>>>>>>>>>>>>> >>>>>>>>>>>>>>> Upgraded BIOS to 1.8.0 and TBT NVM to v44 but still can't reproduce this >>>>>>>>>>>>>>> on my system :/ >>>>>>>>>>>>> >>>>>>>>>>>>> The user reported the issue with the previous firmwares 1.x and TBT NVM v40. >>>>>>>>>>>>> Updating to the recent version (I got the logs with) did not fix the issue. >>>>>>>>>>>> >>>>>>>>>>>> I also tried v40 (that was originally on that system) but I was not able >>>>>>>>>>>> to reproduce it. >>>>>>>>>>>> >>>>>>>>>>>> Do you know if the user changed any BIOS settings? >>>>>>>>>>> >>>>>>>>>>> We had to disable the Thunderbolt security settings as otherwise the USB >>>>>>>>>>> devices wouldn’t work at cold boot either. >>>>>>>>>> >>>>>>>>>> That does not sound right at all. There is the preboot ACL that allows >>>>>>>>>> you to use TBT dock aready on boot. Bolt takes care of this. >>>>>>>>>> >>>>>>>>>> Are you talking about USB devices connected to the TB16 dock? >>>>>>>>>> >>>>>>>>>> Also are you connecting the TB16 dock to the Thunderbolt ports (left >>>>>>>>>> side of the system marked with small lightning logo) or to the normal >>>>>>>>>> Type-C ports (right side)? >>>>>>>>>> >>>>>>>>>>> So, I built Linux 5.4-rc8 (`make bindeb-pkg -j8`), but unfortunately the >>>>>>>>>>> error is still there. Sometimes, re-plugging the dock helped, and sometimes >>>>>>>>>>> it did not. >>>>>>>>>>> >>>>>>>>>>> Please find the logs attached. The strange thing is, the Linux kernel detects >>>>>>>>>>> the devices and I do not see any disconnect events. But, `lsusb` does not list >>>>>>>>>>> the keyboard and the mouse. Is that expected. >>>>>>>>>> >>>>>>>>>> I'm bit confused. Can you describe the exact steps what you do (so I can >>>>>>>>>> replicate them). >>>>>>>>> >>>>>>>>> I managed to reproduce following scenario. >>>>>>>>> >>>>>>>>> 1. Boot the system up to UI >>>>>>>>> 2. Connect TB16 dock (and see that it gets authorized by bolt) >>>>>>>>> 3. Connect keyboard and mouse to the TB16 dock >>>>>>>>> 4. Both mouse and keyboard are functional >>>>>>>>> 5. Enter s2idle by closing laptop lid >>>>>>>>> 6. Exit s2idle by opening the laptop lid >>>>>>>>> 7. After ~10 seconds or so the mouse or keyboard or both do not work >>>>>>>>>      anymore. They do not respond but they are still "present". >>>>>>>>> >>>>>>>>> The above does not happen always but from time to time. >>>>>>>>> >>>>>>>>> Is this the scenario you see as well? >>>>>>>> >>>>>>>> Yes, it is. Though I’d say it’s only five seconds or so. >>>>>>>> >>>>>>>>> This is on Ubuntu 19.10 with the 5.3 stock kernel. >>>>>>>> >>>>>>>> “stock” in upstream’s or Ubuntu’s? >>>>>>> >>>>>>> It is Ubuntu's. >>>>>>> >>>>>>>>> I can get them work again by unplugging them and plugging back (leaving >>>>>>>>> the TBT16 dock connected). Also if you run lspci when the problem >>>>>>>>> occurs it still shows the dock so PCIe link stays up. >>>>>>>> >>>>>>>> Re-connecting the USB devices does not help here, but I still suspect it’s >>>>>>>> the same issue. >>>>>>> >>>>>>> Yeah, sounds like so. Did you try to connect the device (mouse, >>>>>>> keyboard) to another USB port? >>>>>> >>>>>> I do not think I did, but I can’t remember. Next week would be the next chance >>>>>> to test this. >>>>>> >>>>>>>> Yesterday, I had my hand on a Dell XPS 13 7390 (10th Intel generation) and >>>>>>>> tried it with the shipped Ubuntu 18.04 LTS. There, the problem was not >>>>>>>> always reproducible, but it still happened. Sometimes, only one of the USB >>>>>>>> device (either keyboard or mouse) stopped working. >>>>>>> >>>>>>> I suppose this is also with the TB16 dock connected, correct? >>>>>> >>>>>> Correct. >>>>>> >>>>>> Can I ask again, how the USB devices connected to the dock can be listed on >>>>>> the command line? lsusb needs to be adapted for that or is a different >>>>>> mechanism needed? >>>>> >>>>> The TB16 dock has ASMEDIA xHCI controller, which is PCIe device so you >>>>> can see it by running lsusb and looking at the devices under that >>>>> controller. I think maybe 'lsusb -t' is helpful. >>>>> >>>>> The xHCI controller itself you can see by running lspci. >>>> >>>> I got traces from the ASMedia xHC controller in the TB16 dock. >>> >>> Nice. Thank you for looking into that. How can these traces be captured? >> >> The Linux tracepoints added to the xhci driver can be enabled by: >> >> mount -t debugfs none /sys/kernel/debug >> echo 81920 > /sys/kernel/debug/tracing/buffer_size_kb >> echo 1 > /sys/kernel/debug/tracing/events/xhci-hcd/enable >> < Trigger the issue > >> >> Copy traces found in /sys/kernel/debug/tracing/trace >> >> Trace file grows fast. > >>>> There are issues with split transactions between the ASMedia host and the 7 port >>>> High speed hub built in to the dock. >>>> >>>> host reports a split transaction error for mouse or keyboard full-speed/low-speed >>>> interrupt transactions. Endpoint doesn't recover after resetting it. >>>> >>>> Split transaction allows full- and low-speed devices to be attached to high-speed >>>> hubs, and are used only between the host and the HS hub. A transaction translator (TT) >>>> in the HS hub will translate the high-speed split transactions on its upstream port to >>>> low/full speed transactions on the downstream port. >>>> >>>> I'll see if there are any xHC parameters driver is setting that trigger these >>>> split transaction errors to trigger more easy. >>> >>> I always wonder how Microsoft Windows driver do it. >>> >>> Mario, should I contact the Dell support regarding this issue? > Sorry for bothering, but were you able to find some workaround for this issue? > Unfortunately no, I couldn't find any workaround. xhci slot and endpoint context values for both the HS hub, and the full/low speed device seem correct. I was able to reproduce the issue with an external HS hub as well, so this issue appears to be more related to ASMedia host than the built in HS hub in TB16 -Mathias