Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp411305pxf; Thu, 25 Mar 2021 07:00:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwetGVUIm/LArqwq48jYd5PKLzCiDfFPkmdNFQVxJN1SKis3x5uxrjiUK/NhDS7MYqWHKt9 X-Received: by 2002:a17:906:4a19:: with SMTP id w25mr9493342eju.180.1616680849433; Thu, 25 Mar 2021 07:00:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616680849; cv=none; d=google.com; s=arc-20160816; b=fUHIkXlCbu71AsAaDzaWfmKwq8n4pXkVZIXJpvaMjxP4u3iNKR6bkE28uizl1wC8Oz a4a1BdFZkY15b6DnWNHnAswErk7WBe550L3rY0dZiJJ/UJ4LRGbnN1C0lKRVEdiuoF47 YQcpoCwB4X0ANyvhxMRKUVTPIBdSQW6Mmu58KUyjxhrY0FuhYS0EpPgs0ZoSULS5wYuU pk5+NK3unoOE5aX/CbkVOIxGFk67BObq296P81AhMV4imsJu/7UYnlERtgUS0T+tTaj8 XiOTo4xjclqiQhD5VCOKHr4zRsSqjk23OhC117llM8LYXse+hi/EeOJCysQGBoSsovgw NTSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=03r2q83Bk8Ah38pdns0DH1orxeh7sVvZcAZMapT60dQ=; b=ljFUEIAm6SkO1B50MyYsyolA9fhmeVD9OHs2MTZ/rLMdXGsP5wQZwkDwN92JwztqUP U+Myu5faJCeRnlcd22rvjqWKmDbj0X+7wPTqJOfsanI+Z/LZBS2QHuQzqcuWBoyqLLlS 0gvAyuAHwyln7LIFIFTGwuCT1ca6SESes8iuag8s1Cm+BM1x1HsLDHYPYes8yVojZs7S 0C5eOKAKaS7ucoNvAC8xkZtEes8ZjAUPixOhKFUgnhhgro04pkT84VVeiHQFlzOHLq/z F+tPQpFETt7pDKSnUd5l4NO4A1sflD4hyOZEM63dJ1G7+weK9B3j2+Ok8Y2iNde7Je5G pU5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X9VZlOe4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk9si4444098ejb.474.2021.03.25.07.00.26; Thu, 25 Mar 2021 07:00:49 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=X9VZlOe4; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231194AbhCYN7Y (ORCPT + 99 others); Thu, 25 Mar 2021 09:59:24 -0400 Received: from mail.kernel.org ([198.145.29.99]:33608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230078AbhCYN7G (ORCPT ); Thu, 25 Mar 2021 09:59:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6BD7B61864; Thu, 25 Mar 2021 13:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1616680746; bh=Ri1S2/i6bHycwLtGjzdDIgYWmQoORdy/z6eA+QQ2RUA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=X9VZlOe47APUGkYj8l4F0hnjoCwWa5cr7Xhh54/2W5Pn5TnGYK3w8rYYAavRmvriH X/eBb+h+8tLm0vEziaPC+UzWADkuwND3ZixtMFaBJ7vmyZRm4MT0Xd3JAN8rdrRNgH V5oD5Up9XVAslhhIU/SqvlSJJf/EwyRv8foelI5g= Date: Thu, 25 Mar 2021 14:59:03 +0100 From: Greg KH To: liulongfang Cc: mathias.nyman@intel.com, stern@rowland.harvard.edu, 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: 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > 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 :) thanks, greg k-h