Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp531085ybj; Thu, 7 May 2020 01:23:42 -0700 (PDT) X-Google-Smtp-Source: APiQypItwTTIE+z5uZ72zONBW0AIXtgyPL7mYKn+cm/UP7kTI4BTElwVdd4jTyp28CWDT/s7t/m+ X-Received: by 2002:a17:907:2101:: with SMTP id qn1mr11283602ejb.207.1588839822339; Thu, 07 May 2020 01:23:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588839822; cv=none; d=google.com; s=arc-20160816; b=WHZjCweVpCJOVQZDiltd1BJvBWDrOoSerkVYNNo/z3B6cgljQHFMDSHPhrHrfNANga cwNTdTQI39AxyLacgr6OyuC5nymvO852Yfgk2PyK9UGHjnkCi6MBeB+36wXpXg2qEBUZ HKe9BaOTwwebA6lLdv1UyXeLmR3BkarYGlcKpStOFvEd33NoNuT4EDG2Evc2z2x7Pv/J xs/C60Owwt1mnWygvg8pHkF1tYPSvi5g7kIngcdealb46vbkUt6aQT75aEZ+bRX9ljkD 6BQ8hJjSkkC84H/JPGRjaj08LbMyrXy7DkPQ7Vcmmdg5SDBZrgCMTlxoSpGoDq8XcrW4 PE6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8j+aSU/zj0QX/yWGjonif37B2wm9UKq01BXsRuUXWGU=; b=uiR2QZxyoqq4fb7ugZQTcgQFYq0EILV1rYEjpKNsvhFZq/oYCB0lD2LDsrxnzoMtHX Pc76SfO2QLNLPYnAbPlMBOkP73lT1zAeGWL/LjlQic3Lp/TQlyikM3+XlQy2AXPV7vvB 86DGCp2pWchbRpgRsCJUAYY+3HXHVNCqfEeC/xHaR7ixhfshI/keqNq6InNUzDc4TrRv +sSOxkFHWMmiMTxSZ3S4tklA9ct9YrDb3Tn+X7q+u0WpVMpJiHQta69uvubib4hMJcnY PyccW9rBNQQ3MBfWvEzedro5e4oKZa2wYKL1fqw0jrSIxleYFH/9EfN+3pxYfZ0Hee30 ttog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=rQRc2oUZ; 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 t26si2818861edf.183.2020.05.07.01.23.18; Thu, 07 May 2020 01:23: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; dkim=pass header.i=@kernel.org header.s=default header.b=rQRc2oUZ; 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 S1725949AbgEGIVv (ORCPT + 99 others); Thu, 7 May 2020 04:21:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:38174 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725802AbgEGIVv (ORCPT ); Thu, 7 May 2020 04:21:51 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C55EF20753; Thu, 7 May 2020 08:21:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588839711; bh=vMCMu1ZCij3S9DyMwgnao9k5Ht7YBq0MBKru0DL71EE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rQRc2oUZTxHgceObRHepfY7ZL1NkskHEgkxWT1JVIPYzz28iJkoGurZrGCCDSTSca 6nQqtCQksniF8DruFX442Ytn8ByfwjFiOU0PSknuxvLNOqnu1emWrFoKejCI3JF/Dk pmjoSGJ1n9y6TrJeIIewyUTSUMCyFoMfCp8TN7BQ= Date: Thu, 7 May 2020 10:21:49 +0200 From: Greg Kroah-Hartman To: Kai-Heng Feng Cc: mathias.nyman@intel.com, "open list:USB XHCI DRIVER" , open list Subject: Re: [PATCH] xhci: Make debug message consistent with bus and port number Message-ID: <20200507082149.GE1024567@kroah.com> References: <20200507061755.13280-1-kai.heng.feng@canonical.com> <20200507064510.GA787064@kroah.com> <20200507073119.GA876666@kroah.com> <90D5B23E-B037-49D2-BD44-7F9B0B2FC155@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <90D5B23E-B037-49D2-BD44-7F9B0B2FC155@canonical.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 07, 2020 at 03:58:36PM +0800, Kai-Heng Feng wrote: > > > > On May 7, 2020, at 15:31, Greg Kroah-Hartman wrote: > > > > On Thu, May 07, 2020 at 03:15:01PM +0800, Kai-Heng Feng wrote: > >> > >> > >>> On May 7, 2020, at 14:45, Greg Kroah-Hartman wrote: > >>> > >>> On Thu, May 07, 2020 at 02:17:55PM +0800, Kai-Heng Feng wrote: > >>>> Current xhci debug message doesn't always output bus number, so it's > >>>> hard to figure out it's from USB2 or USB3 root hub. > >>>> > >>>> In addition to that, some port numbers are offset to 0 and others are > >>>> offset to 1. Use the latter to match the USB core. > >>>> > >>>> So use "bus number - port index + 1" to make debug message consistent. > >>>> > >>>> Signed-off-by: Kai-Heng Feng > >>>> --- > >>>> drivers/usb/host/xhci-hub.c | 41 +++++++++++++++++++++---------------- > >>>> 1 file changed, 23 insertions(+), 18 deletions(-) > >>>> > >>>> diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c > >>>> index f37316d2c8fa..83088c262cc4 100644 > >>>> --- a/drivers/usb/host/xhci-hub.c > >>>> +++ b/drivers/usb/host/xhci-hub.c > >>>> @@ -1241,7 +1241,8 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, > >>>> temp = readl(ports[wIndex]->addr); > >>>> /* Disable port */ > >>>> if (link_state == USB_SS_PORT_LS_SS_DISABLED) { > >>>> - xhci_dbg(xhci, "Disable port %d\n", wIndex); > >>>> + xhci_dbg(xhci, "Disable port %d-%d\n", > >>>> + hcd->self.busnum, wIndex + 1); > >>> > >>> Shouldn't xhci_dbg() show the bus number already? > >> > >> It's the PCI bus number, different to USB2/USB3 root hub bus number... > > > > But if this is using dev_dbg(), and it is, then you know how to look > > that up by seeing where that device is in sysfs at that point in time. > > > > So why add this again? > > xHCI has two HCD, one for USB2 and one for USB3. > If both of their port with same number are in use, for instance, port 1, then they are port 1-1 and port 2-1. > Right now the debug message only show "Port 1", we still can't find the corresponding port via sysfs with insufficient info. Look at the full kernel log line, the xhci hcd device should be showing you unique information. If not, something else is wrong. What does a full line look like today for you? thanks, greg k-h