Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1165774pxb; Sat, 17 Apr 2021 08:32:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOMvF4q42qn/l9q5En28JDhhi/XhvqKU+OzRijwuAqL8cSwpN27EFYxfrOZZB1EBjx1PR8 X-Received: by 2002:a05:6402:278c:: with SMTP id b12mr16207732ede.145.1618673560716; Sat, 17 Apr 2021 08:32:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618673560; cv=none; d=google.com; s=arc-20160816; b=BC0fJ3UuauHgNve3E+78gPHPiRWHJx1vygjTjAONA7q+fMjLRObenh8ka2Q8bCRsvF YGBT2TC5vvwXzSx8zDcJELRQqyMg3oGacNiZQ+/zPYAH7zKqD6mPqRcXNGEtYdCkileq KJ5QilXO0l5pTx+HvuubVSId0TcYwcViwGNWDuqHy9QcVPTF+zhci1UqLegaKGXrWmSw r9/NzA7mHci34ZDRhlHSBVxi0Ey7EFIKVzRfIdNYutOC8X05+ztLAP82XvjLP0nLMw6y VYde1Ui94OvMY4b7w22ry4RjJWiQByZxbOmzIRKGgr54+Q8SoYreykop7za4SCjRbnG9 tZYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=oBGpbT1j7fhn5NsBrspDmtXCVTOr6R1dOV8p//8iRt0=; b=NCzLIgsfVDA3kVq9j8rcgCzfPKIfqOICkWi03x1ewJYX3tXHl9/sl4SVMV9KWu8I+w p/lNf8Rw2G8eZ8zFXobPom05aSxV6GVJwbVWoMnKTW9tCQV4l5B5l9Ct5cuKS69dZP3O kjWk3Hx0s7VtW32RppVd1f+nukiIzvI+3x21ypsO7zBDdUqDwg6UJfWRA7Rnlcyy40+N TdVk7+9TlI03owcvU+wkuz4bBe9Yuq+UUhrbrQ6bb2NDq2oEO+0ri3E5w5wfXOGm82O4 j0P5Oh2iecbBSbaeow1mGxxtwgpZq4KUiT8BS4QHfol85MJXys9whAysBeU4605O4SyA BAzg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p25si7193911edr.266.2021.04.17.08.32.17; Sat, 17 Apr 2021 08:32:40 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236543AbhDQPbc (ORCPT + 99 others); Sat, 17 Apr 2021 11:31:32 -0400 Received: from netrider.rowland.org ([192.131.102.5]:59497 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S236287AbhDQPbc (ORCPT ); Sat, 17 Apr 2021 11:31:32 -0400 Received: (qmail 73758 invoked by uid 1000); 17 Apr 2021 11:31:04 -0400 Date: Sat, 17 Apr 2021 11:31:04 -0400 From: Alan Stern To: liulongfang Cc: gregkh@linuxfoundation.org, mathias.nyman@intel.com, liudongdong3@huawei.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kong.kongxinwei@hisilicon.com, yisen.zhuang@huawei.com Subject: Re: [RFC PATCH] USB:XHCI:skip hub registration Message-ID: <20210417153104.GA73141@rowland.harvard.edu> References: <1618489358-42283-1-git-send-email-liulongfang@huawei.com> <20210415144323.GC1530055@rowland.harvard.edu> <3dad6f4f-6386-427c-c36c-7d26b9a76fa4@huawei.com> <20210416152021.GA42403@rowland.harvard.edu> <547e07d6-ae62-1225-7483-754bf57ed1d2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <547e07d6-ae62-1225-7483-754bf57ed1d2@huawei.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Apr 17, 2021 at 02:48:22PM +0800, liulongfang wrote: > On 2021/4/16 23:20, Alan Stern wrote: > > On Fri, Apr 16, 2021 at 10:03:21AM +0800, liulongfang wrote: > >> The current method is an improved method of the above patch. > >> This patch just make it skip registering USB-3 root hub if that hub has no ports, > > > > No, that isn't what this patch does. > > > > If the root hub wasn't registered, hub_probe wouldn't get called. But > > with your patch, the system tries to register the root hub, and it does > > call hub_probe, and then that function fails with a warning message. > > > > The way to _really_ akip registering the root hub is to change the > > xhci-hcd code. Make it skip calling usb_add_hcd. > > > > If you do not register in the root hub, this will return an error code, What will return an error code? Are you talking about xhci_pci_probe()? You oight to be able to figure out how to make it work. > which will make all the XHCI drivers unregister, causing the USB2.0 controllers > on the xhci to be unavailable. Alan Stern