Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp6666009ybl; Mon, 23 Dec 2019 09:33:55 -0800 (PST) X-Google-Smtp-Source: APXvYqxN5FiwLNagC7u6pfeqCE3evY5SeItz795PBYAk172lNh+ztsJjIfkMcozSroRXjCowBXTH X-Received: by 2002:aca:c692:: with SMTP id w140mr54171oif.139.1577122435518; Mon, 23 Dec 2019 09:33:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577122435; cv=none; d=google.com; s=arc-20160816; b=HylQvdEr2GeBhuoc192s0aUu9Pp3Ryn/UXOtfwkbh5MKzXRLnU2y/1+ObQ1WOHz8H+ FkTj4Ph+RhZx6zzmbwazzQc/2ee+eLIgRi8rq13OwmsDCP/kKuXc8VCIjh4R5Z0TDoSG i68sVv5ymi+dhY3dxX5aA1DyduS/j09ZCpouRdrfhxdXG1NNK4uXvoTj0zDmtyE0sosX 2rH026Jx3M1ES8s4VTb4GA7KqxovAnw9ZWaFWS64nmoCZ+qXMxl4D+DxbZZgZLRIWqXq LQZbbvLrI6jNjsf1cxsjSTEOhvbeX0jfOZ8FgL/NfHl7bo2fuoqzZhQJ2E5jQCGSebLG t1sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=YHdy2LWecIdbJ9IXRBR1/Ofo5+tH7RhPHWrZ2BupTO8=; b=AmDRtm6E5I1lYUriyudzxf9VKXpKhcFpNn7jNTqi/sakkd3+GSPgvG+wTT9VUHXurt nzdkvB9NIlhu9uzmYIR2/CvIua2CpZqf64l50fPAdkGq6i0yI+MtosL9XGgPzEtgrqsb Y1GqYhy+ZSItnJUsAk6gdFS02m1lIUvimN/tvUJIVU6bEqBBfOv2641OQWXde07xhVH/ 3BafieE4I8dmFfElo3hjYgg6eq9hlNVruRlSiqNCz1AiINmOJW9o4Nlm92k8uni2LHbi Le2rRtiGiOtjayHF+LYJFYMoDCiTQpqbVwFYdwz8g6DUpGlaftcFx6azlVcWEPhTYpNj q1/A== 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i198si10012306oib.111.2019.12.23.09.33.44; Mon, 23 Dec 2019 09:33:55 -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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726899AbfLWRcI convert rfc822-to-8bit (ORCPT + 99 others); Mon, 23 Dec 2019 12:32:08 -0500 Received: from youngberry.canonical.com ([91.189.89.112]:37208 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726754AbfLWRcH (ORCPT ); Mon, 23 Dec 2019 12:32:07 -0500 Received: from mail-pj1-f72.google.com ([209.85.216.72]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1ijRYr-0006RN-Ql for linux-kernel@vger.kernel.org; Mon, 23 Dec 2019 17:32:06 +0000 Received: by mail-pj1-f72.google.com with SMTP id ie20so57806pjb.8 for ; Mon, 23 Dec 2019 09:32:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=DxkImzWVfef1xCpc56sb8FA6DnZxPPdiLSLtxzu4Snk=; b=tyHl7/R72EwARDKU87M1B8JGCTWdol0Ei/1g+mONNKDWMhHArtd06JKkkdOUNPnsAc 72Cl1v6THEElmAeB9HQyMLQACZVdPeymkrrwntvj8s7nGGQkukdp7eoYhB5LNd+To6z8 eFKOSM3VBousJrYAaY2VfT7uW7HbDxLjXesre0mRpqNADWMQ73PYX5g6r53pQQAbi0by rZ2U1UtZc7lb2tZ9jHFLURBJDQW0yO+7OGQyPfKZJy5aJPVQj4wt1guzeOzduGwpziRx lX9XhzxY3qpgoI97+N8beKZjKXrB70lUj3/eSrOW95s9gAco6A5eXhYTQwkhI5y5n0tu Mlnw== X-Gm-Message-State: APjAAAVTA+t/x+cjCto7KSKcxC5ViK/UiuveTQrKBOvR8oGjvQ1clwZ7 FYvDG9CIuUYL+VialeLOxviTQWhor8g3dJBDGmjnSrI3xatR6cbbaLK1QCLZ7qkqTrW0PmquY02 vlTVSie6uvoo6SM/1rSB3sD3AeymnUid9ORjoBbj8/w== X-Received: by 2002:a17:90a:8902:: with SMTP id u2mr167891pjn.85.1577122324525; Mon, 23 Dec 2019 09:32:04 -0800 (PST) X-Received: by 2002:a17:90a:8902:: with SMTP id u2mr167845pjn.85.1577122324151; Mon, 23 Dec 2019 09:32:04 -0800 (PST) Received: from 2001-b011-380f-35a3-a059-d6a4-0e9a-8360.dynamic-ip6.hinet.net (2001-b011-380f-35a3-a059-d6a4-0e9a-8360.dynamic-ip6.hinet.net. [2001:b011:380f:35a3:a059:d6a4:e9a:8360]) by smtp.gmail.com with ESMTPSA id e10sm26233451pfj.7.2019.12.23.09.32.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Dec 2019 09:32:03 -0800 (PST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.40.2.2.4\)) Subject: Re: [PATCH v2 2/2] USB: core: Attempt power cycle port when it's in eSS.Disabled state From: Kai-Heng Feng In-Reply-To: Date: Tue, 24 Dec 2019 01:32:00 +0800 Cc: Alan Stern , Mathias Nyman , Greg KH , USB list , Kernel development list Content-Transfer-Encoding: 8BIT Message-Id: <9883D946-77E0-4645-89FB-0B61D9E84178@canonical.com> References: To: Mathias Nyman X-Mailer: Apple Mail (2.3608.40.2.2.4) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Dec 17, 2019, at 19:16, Mathias Nyman wrote: > > On 11.12.2019 17.08, Alan Stern wrote: >> On Wed, 11 Dec 2019, Kai-Heng Feng wrote: >>> >>> >>>> On Nov 30, 2019, at 01:41, Kai-Heng Feng wrote: >>>> >>>> On Dell TB16, Realtek USB ethernet (r8152) connects to an SMSC hub which >>>> then connects to ASMedia xHCI's root hub: >>>> >>>> /: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/2p, 5000M >>>> |__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/7p, 5000M >>>> |__ Port 2: Dev 3, If 0, Class=Vendor Specific Class, Driver=r8152, 5000M >>>> >>>> Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub >>>> Bus 004 Device 002: ID 0424:5537 Standard Microsystems Corp. USB5537B >>>> Bus 004 Device 003: ID 0bda:8153 Realtek Semiconductor Corp. RTL8153 Gigabit Ethernet Adapter >>>> >>>> The SMSC hub may disconnect after system resume from suspend. When this >>>> happens, the reset resume attempt fails, and the last resort to disable >>>> the port and see something comes up later, also fails. >>>> >>>> When the issue occurs, the link state stays in eSS.Disabled state >>>> despite the warm reset attempts. Accoding to spec this can be caused by >>>> invalid VBus, after some expiremets, the SMSC hub can be brought back >>>> after a powercycle. > > Could you open up a bit more how this happens, mainly codepaths how the > USB3 port ends up in eSS.Disabled state It happens right after hub_resume(), the first get_port_status(): Dec 23 09:46:58 u-XPS-13-9370 kernel: usb usb4: usb resume Dec 23 09:46:58 u-XPS-13-9370 kernel: hub 4-0:1.0: hub_resume Dec 23 09:46:58 u-XPS-13-9370 kernel: xhci_hcd 0000:3f:00.0: Get port status 4-1 read: 0x280, return 0x280 Dec 23 09:46:58 u-XPS-13-9370 kernel: usb usb4-port1: status 0280 change 0000 Dec 23 09:46:58 u-XPS-13-9370 kernel: xhci_hcd 0000:3f:00.0: Get port status 4-2 read: 0x2a0, return 0x2a0 Dec 23 09:46:58 u-XPS-13-9370 kernel: xhci_hcd 0000:3f:00.0: Get port status 4-1 read: 0x280, return 0x280 Dec 23 09:46:58 u-XPS-13-9370 kernel: xhci_hcd 0000:3f:00.0: Get port status 4-1 read: 0x280, return 0x280 Dec 23 09:46:58 u-XPS-13-9370 kernel: xhci_hcd 0000:3f:00.0: Get port status 4-1 read: 0x280, return 0x280 And it keeps getting 0x280. It should mean PP = 1 and PLS = 4, so it's in Disabled state. > > There might be something else wrong here. > My impression is that port should only end up in eSS.Disabled when directed > to with a Set_Port_Feature(PORT_LINK_STATE, eSS.Disabled) Request. > After this we shouldn't attempt warm resets, they won't work for USB3 ports in > ss.Disabled state. Do you suggest that we should power cycle the port in xHCI instead of USB core? Kai-Heng > > -Mathias