Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp445558pxf; Thu, 25 Mar 2021 07:33:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzl6NVLq7UCyWeQYfLJvCJnYLnUyvHutssQ7v8Ukq+sGIuA6qvzFnnqkIRfJScsFJirIbCo X-Received: by 2002:aa7:ce1a:: with SMTP id d26mr9375249edv.206.1616682822572; Thu, 25 Mar 2021 07:33:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616682822; cv=none; d=google.com; s=arc-20160816; b=NZ9XjN6wnT9qVZVdvCiuh4J4jP4eVIjFIWCDgDCt0ZZhCsKLfAQw6kXZvRMYo9+pXF SUd7b00gFslRAKl1Gyf0l8b9s6Lw7eeaWAj+qyrdd9RgO5qWLvwGpwhRuGtaC7uD36Wa c03D9yLtQTwfWxB0IZHa3XrwjfRfZQzIxc3hSrRgJGwAptzJiU+CRWHyvBTECOTd7G4X Dzz0JSYbLki3XD0XZVru9p3qt+YRng1TWySB1pDH5CZIAIkzgIL3+ycOkLbAgIS91PXd bj7++ulftl9idI99+/mUiaVH6GlMLS8K9SFuEVXe7Yciasi91n/DsKl+q0WS0/OyQVUc e5FA== 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=v/S8jRrTyevziPGqtDLFVF9H8MxvG8JPodQeXDXtkEM=; b=tW+pywtnbc+MHJ7HsnQ+eia1zuvTe1xqKPlSZSw2c8gRZeD3C+/mn6NnjUGBGLNR7H o/L+rgEqjvQ0E9W/RmbqoQpLIrRo44O+Jv6pT5aSWIcTDEDM7vi3H1QilShTidV1V1f+ Tjl3GeWbfjWlkecxHVIYuGPyPd7Nh4sN16cfsh7eLcWX/6DuTTP6c7l0gJ5V2LAofxBK RohgzQ5+q2C+WHSlGTaLPwBH28+DxAGr0BDIbIGmv1nQcIEv811msbIaFkJJfnVkQWBI iUU7tzBwGntwkowdTh0FFmaYJB7phxA0LD2R3oMgad2UJ5HQvqP/RVaWw7S3ETf8Z0T4 aYYA== 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 m13si4135208edc.258.2021.03.25.07.33.18; Thu, 25 Mar 2021 07:33:42 -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 S231330AbhCYObU (ORCPT + 99 others); Thu, 25 Mar 2021 10:31:20 -0400 Received: from netrider.rowland.org ([192.131.102.5]:57591 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S231349AbhCYObG (ORCPT ); Thu, 25 Mar 2021 10:31:06 -0400 Received: (qmail 788278 invoked by uid 1000); 25 Mar 2021 10:31:04 -0400 Date: Thu, 25 Mar 2021 10:31:04 -0400 From: Alan Stern To: Greg KH Cc: liulongfang , mathias.nyman@intel.com, linux-usb@vger.kernel.org, yisen.zhuang@huawei.com, tanxiaofei@huawei.com, liudongdong3@huawei.com, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH] USB:XHCI:Adjust the log level of hub Message-ID: <20210325143104.GA785961@rowland.harvard.edu> References: <1616666652-37920-1-git-send-email-liulongfang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 25, 2021 at 02:59:03PM +0100, Greg KH wrote: > On Thu, Mar 25, 2021 at 09:33:53PM +0800, liulongfang wrote: > > On 2021/3/25 18:31, Greg KH wrote: > > > On Thu, Mar 25, 2021 at 06:04:12PM +0800, Longfang Liu wrote: > > >> When the number of ports of the hub is not between 1 and Maxports, > > >> it will only exit the registration of the hub on the current controller, > > >> but it will not affect the function of the controller itself. Its other > > >> hubs can operate normally, so the log level here can be changed from > > >> error to information. > > >> > > >> Signed-off-by: Longfang Liu > > >> --- > > >> drivers/usb/core/hub.c | 10 ++++------ > > >> 1 file changed, 4 insertions(+), 6 deletions(-) > > >> > > >> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > > >> index b1e14be..70294ad 100644 > > >> --- a/drivers/usb/core/hub.c > > >> +++ b/drivers/usb/core/hub.c > > >> @@ -1409,13 +1409,11 @@ static int hub_configure(struct usb_hub *hub, > > >> maxchild = min_t(unsigned, maxchild, USB_SS_MAXPORTS); > > >> > > >> if (hub->descriptor->bNbrPorts > maxchild) { > > >> - message = "hub has too many ports!"; > > >> - ret = -ENODEV; > > >> - goto fail; > > >> + dev_info(hub_dev, "hub has too many ports!\n"); > > > > > > Is this an error? If so, report it as such, not as "information". > > > > > >> + return -ENODEV; > > >> } else if (hub->descriptor->bNbrPorts == 0) { > > >> - message = "hub doesn't have any ports!"; > > >> - ret = -ENODEV; > > >> - goto fail; > > >> + dev_info(hub_dev, "hub doesn't have any ports!\n"); > > > > > > Same here. > > > > > > What problem are you trying to solve here? > > > > > > What hub do you have that has no ports, or too many, that you think > > > should still be able to work properly? > > > > > > thanks, > > > > > > greg k-h > > > . > > On our test platform, the xhci usb3 hub has no port. > > Sounds like a broken device, why not fix that? If this device is used only for testing and not for production, who cares how severe the log message is? > > when initializing the usb3 hub, an error will be reported > > because the port is 0, but in fact it will not affect > > the use of usb2, and the usb2 hub is working normally. > > But you can not have a USB3 hub with no ports, isn't that against > against the USB spec? How does this device pass the USB-IF > certification? > > > thanks, therefore, in order to reduce the severity of the log, > > we hope to lower the level of this log. > > You did not reduce the severity at all, everyone can still see it. > > Please try fixing your hardware : Alternatively, you could change the xhci-hcd driver. Make it skip registering the USB-3 root hub if that hub has no ports. But don't change these log messages. They describe real errors, so they should be actual error messages. Alan Stern