Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp4006107pxb; Tue, 2 Nov 2021 02:21:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwwZpc9AtLwxzmceqczIyKQI6t6h3qZUcukTTWZBmOWQb4yZABZWEBXLgI49ZkomcdTmH8 X-Received: by 2002:a05:6638:1489:: with SMTP id j9mr26704228jak.18.1635844875677; Tue, 02 Nov 2021 02:21:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635844875; cv=none; d=google.com; s=arc-20160816; b=qUwjVh/GaHVxg/jG0Lbh+xw+PgrtbQVFZlTtHuJvgeGXE+K+cs46hz05M1I2E5LUGx Ubig854WbXqPrISXBVLoKYxlCJSPQtUCb9Dd3c3qG8IXWW9VoKDXuqR1fDWvtTbUv6dA EueQKJibSucHDVWzx6DB9n6F4UOcu49st+hWZqs8/OylA9aLWni3YaMGJyXTpZrZjORC arlHPgQcq3jzEHmoug5HJ1xLJIVqrnsXaTni1Vc5V2fn7VyqVmqp/pFRH1tPo47lRsV0 NTAxQvHYoNjc79CHlqFb0IxjG3VSgYf+pFgewZ+Lt0Wgb6F35prcBxEauyajRCSAHCEk 3eAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:subject:from :references:cc:to; bh=zVKw1Pj11eNKGxI4+nB5LZ5lrSm4cVsW1Q+pdvNa/us=; b=NUHxAkthFHyhaUgPYFXcyhOhwD4a/KPGbdM9UrghR+C8NznaEjrA8EnNav3yv0+NCR ITWRSF1+/jmqhJ0ha09Hi1dgIRw/a1LgdwexxRlB41H/0FChfOkrXxZm+Dfw631sIVxB TeYNGueZurdsD4UrYl2+GW70ZqMXbzXkHDkR3HDGpktQEtZn0a76m7VPvUzCHbN263Gi JdSQQkil4LOYyRjy+dROgsqXFBcBo2YzsTbRrUElsQXvwKWVqh+809Y7nQpmqY1xSiOB 6y8OH1/G7m1TakgT1dERPP+LKYOdYbin4Gb+RGLk11mAewQWMF1IirYGcTYUTg/EqaR+ iA1A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id q9si24657899jaj.121.2021.11.02.02.21.03; Tue, 02 Nov 2021 02:21:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S230321AbhKBJVF (ORCPT + 99 others); Tue, 2 Nov 2021 05:21:05 -0400 Received: from mga11.intel.com ([192.55.52.93]:30947 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229577AbhKBJUz (ORCPT ); Tue, 2 Nov 2021 05:20:55 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10155"; a="228668464" X-IronPort-AV: E=Sophos;i="5.87,202,1631602800"; d="scan'208";a="228668464" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Nov 2021 02:03:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,202,1631602800"; d="scan'208";a="638121195" Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.199]) ([10.237.72.199]) by fmsmga001.fm.intel.com with ESMTP; 02 Nov 2021 02:03:45 -0700 To: Alan Stern , Mathias Nyman , "Walt Jr. Brake" Cc: Chunfeng Yun , Greg Kroah-Hartman , Matthias Brugger , Nishad Kamdar , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Eddie Hung References: <1618017645-12259-1-git-send-email-chunfeng.yun@mediatek.com> <5e907ccd-40bb-2ece-fe05-1a65a74f3aa2@gmail.com> <20211101140613.GC1456700@rowland.harvard.edu> From: Mathias Nyman Subject: Re: [PATCH v2] usb: core: reduce power-on-good delay time of root hub Message-ID: <3cf46eaf-5443-30df-6d72-b92a6a518afc@linux.intel.com> Date: Tue, 2 Nov 2021 11:05:10 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Firefox/78.0 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20211101140613.GC1456700@rowland.harvard.edu> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1.11.2021 16.06, Alan Stern wrote: > On Sat, Oct 30, 2021 at 12:49:37PM +0800, Walt Jr. Brake wrote: >> This patch make USB 3.1 device cannot be detected, and I report the bug [1] >> to archlinux three month ago. Yesterday I try to fix it myself, and after I >> revert this patch, compile the kernel and test, it works. >> >> [1] https://bugs.archlinux.org/task/71660?project=1&pagenum=2 >> >> >> diff --git a/drivers/usb/core/hub.h b/drivers/usb/core/hub.h >> index 22ea1f4f2d66..73f4482d833a 100644 >> --- a/drivers/usb/core/hub.h >> +++ b/drivers/usb/core/hub.h >> @@ -148,10 +148,8 @@ static inline unsigned hub_power_on_good_delay(struct >> usb_hub *hub) >>  { >>         unsigned delay = hub->descriptor->bPwrOn2PwrGood * 2; >> >> -       if (!hub->hdev->parent) /* root hub */ >> -               return delay; >> -       else /* Wait at least 100 msec for power to become stable */ >> -               return max(delay, 100U); >> +       /* Wait at least 100 msec for power to become stable */ >> +       return max(delay, 100U); >>  } > > Mathias: > > It looks like the bPwrOn2PwrGood value in xhci-hcd's hub descriptor is > too small for some USB 3.1 devices. > > Can you look into this? > > Alan Stern > At first glance the xhci roothub bPwrOn2PwrGood value looks ok. xhci spec 5.4.8 states software should wait 20ms after asserting PP, before attempting to change the state of the port. xhci driver sets desc->bPwrOn2PwrGood = 10; (2ms interval, so equals 20ms ) We should probably get this working immediately, so maybe revert that patch while looking into the rootcause. Walt Jr. Brake, instead of reverting that patch, could you test if changing the xhci roothub bPwrOn2PwrGood value helps. diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index a3f875eea751..756231a55602 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -257,7 +257,7 @@ static void xhci_common_hub_descriptor(struct xhci_hcd *xhci, { u16 temp; - desc->bPwrOn2PwrGood = 10; /* xhci section 5.4.9 says 20ms max */ + desc->bPwrOn2PwrGood = 50; /* The 20ms in xhci 5.4.8 isn't enough for USB 3.1 */ desc->bHubContrCurrent = 0; desc->bNbrPorts = ports; Thanks -Mathias