Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp517790ybj; Thu, 7 May 2020 01:02:19 -0700 (PDT) X-Google-Smtp-Source: APiQypJYDaIvC2gmqkX04Y9arXF0ZcqlWBQ16QLQPNztdpAcV3Otur0/Vhjp+85qujuePAWCAgPo X-Received: by 2002:a19:505b:: with SMTP id z27mr7485945lfj.123.1588838537938; Thu, 07 May 2020 01:02:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588838537; cv=none; d=google.com; s=arc-20160816; b=HVu9SEuRq0wF5HZqJpRQQ9bi/ayJEsphPGyxdlWpF9cMhoxi+N/Z+UBTV2DlG8D6De 1z9vmweDQAmoPc67d7ICIG3Vlmmd/flfYmBQTfvz1JVRGeqWLPmgzX5kW/cNZDTYS8iH lzNM2d2BTHA7YNjOkwT0irEMufTxQTmf+mSv+XT29p078ebvmXL2u0byk9QZ3p7UNZ3O qKiKurqkBCfZO+FXajI4rVTFN+FiF1K2NJPZo2BmQFwumlATa9p4kWDrMl2iKhdDapm8 T2fCRxzoDFut9/2b70dfnH2ayN1N3ZAn+klrgEaDVwu5f2zRbJc+Hv86GOLUURZjXWZC ZzYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=K+VDSZXub+BuTFUQ07QTs/wVqnWWhwLdrY0vupPeOF4=; b=YXyLsq8b2Rv3gCjL8KafoG5hXc/P4POUM6nuElUT55uD4V7k0dVColRh6RzxvUpZUM 6W1K2D1EtqsFJm8O9yryqyZTJAhpFBRuTz6gUvKhvhgZmN/RBnqRHZyUi1Nbyf/n5Gg1 qVYmAV46rds0rRlxmJXPq8+Wj7V8v/96gpaRjchSOA8rnN2q9jOSnbKmsodL4eZ7DcAE dYfaqe6a6GOQmyN9cPIBm9nLuUJDpLG2gKkP2HEWlNscZzgx62dHVha8RM7ueNbpgigK GzuWTdBhyWn8DV9rBeusn5ZpjUI+Z6T1rxrT/bsnFvnO0tM/R20gQz512zn/Tt9zDxs0 Smrg== 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=canonical.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l4si699418edn.560.2020.05.07.01.01.54; Thu, 07 May 2020 01:02:17 -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=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725914AbgEGIA3 convert rfc822-to-8bit (ORCPT + 99 others); Thu, 7 May 2020 04:00:29 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:41498 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725834AbgEGIA3 (ORCPT ); Thu, 7 May 2020 04:00:29 -0400 Received: from mail-pf1-f199.google.com ([209.85.210.199]) by youngberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1jWbQW-0006UL-VF for linux-kernel@vger.kernel.org; Thu, 07 May 2020 07:58:41 +0000 Received: by mail-pf1-f199.google.com with SMTP id 84so4741686pfx.20 for ; Thu, 07 May 2020 00:58:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=DNIHL4BvETSILFTzOQbZtGVTq1Rk6A0XJOGe7AjQ57M=; b=a7J3j7Btxf1yDO4X3uWnbk09F5ax6efwGlsR/JffrWXURPClFLzyQxZa3vTSJo9+UY 4/8Sr3d+0YjmNE2gyKu3Tu6XYQt7iekrlcZERrLYYWmX82M9nTz+Ll/JnXhmHFWXDE5s WVg8JEdefz6NDyZQ6e0BYwvi1xuD1qaGV1UKERRdhxYdYoO1jMcHIiLV2Hbik0LRUpdh 3S19P6vlfh67bOvoPiESn2Xgm1gBKtuXMhg3vB/RITDFBMbVyK+hft2aTD0NH9VpvIar dhiFuNBbdBYzL+24LTmjd8/15Kss9zkssL/Ry3c17aT5AYBvS26FATpz3McKrMFuqYSF EQ5g== X-Gm-Message-State: AGi0Pua3pXRqpBNhWocSJHENtKN1eM8pBneP7mMLKRfveaJrzG+K9MVD QNikPIIZnvEvUrSfVFOfMxmYtBz3YyNxF0BfprPV7LN6/3iB6d06G6mYQVTtlB0zIPIf+Ncb9aj 3DgvtckgJQ7dyJkWHUa0MOd10XrkbF2o7NaYU1jKelg== X-Received: by 2002:a63:d00d:: with SMTP id z13mr462905pgf.54.1588838319574; Thu, 07 May 2020 00:58:39 -0700 (PDT) X-Received: by 2002:a63:d00d:: with SMTP id z13mr462879pgf.54.1588838319157; Thu, 07 May 2020 00:58:39 -0700 (PDT) Received: from [192.168.1.208] (220-133-187-190.HINET-IP.hinet.net. [220.133.187.190]) by smtp.gmail.com with ESMTPSA id p64sm6983683pjp.7.2020.05.07.00.58.37 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 07 May 2020 00:58:38 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH] xhci: Make debug message consistent with bus and port number From: Kai-Heng Feng In-Reply-To: <20200507073119.GA876666@kroah.com> Date: Thu, 7 May 2020 15:58:36 +0800 Cc: mathias.nyman@intel.com, "open list:USB XHCI DRIVER" , open list Content-Transfer-Encoding: 8BIT Message-Id: <90D5B23E-B037-49D2-BD44-7F9B0B2FC155@canonical.com> References: <20200507061755.13280-1-kai.heng.feng@canonical.com> <20200507064510.GA787064@kroah.com> <20200507073119.GA876666@kroah.com> To: Greg Kroah-Hartman X-Mailer: Apple Mail (2.3608.80.23.2.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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. > >>> If not, please fix >>> that up there instead of having to add it to all messages "by hand". >> >> Not all xhci debug messages need roothub number in it. > > Why pick these random ones? What makes these different? It's not random. We do it when there's a port in message. Being able to know the exact port like "port 1-1" or "port 2-1", instead of just "port 1", can be really helpful. Kai-Heng > > Either all or none, be consistant please. > > greg k-h