Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752646AbbFLGO4 (ORCPT ); Fri, 12 Jun 2015 02:14:56 -0400 Received: from mga14.intel.com ([192.55.52.115]:29236 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750870AbbFLGOw (ORCPT ); Fri, 12 Jun 2015 02:14:52 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,600,1427785200"; d="scan'208";a="507071747" Message-ID: <557A78DA.3010309@linux.intel.com> Date: Fri, 12 Jun 2015 14:14:50 +0800 From: "Lu, Baolu" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Greg Kroah-Hartman CC: Mathias Nyman , Alan Stern , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] usb: core: lpm: set lpm_capable for root hub device References: <1434072625-7971-1-git-send-email-baolu.lu@linux.intel.com> <20150612043209.GA11094@kroah.com> In-Reply-To: <20150612043209.GA11094@kroah.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2609 Lines: 67 On 06/12/2015 12:32 PM, Greg Kroah-Hartman wrote: > On Fri, Jun 12, 2015 at 09:29:37AM +0800, Lu Baolu wrote: >> Commit 25cd2882e2fc ("usb/xhci: Change how we indicate a host supports >> Link PM.") removed the code to set lpm_capable for USB 3.0 super-speed >> root hub. The intention of that change was to avoid touching usb core >> internal field, a.k.a. lpm_capable, and let usb core to set it by >> checking U1 and U2 exit latency values in the descriptor. >> >> Usb core checks and sets lpm_capable in hub_port_init(). Unfortunately, >> root hub is a special usb device as it has no parent. Hub_port_init() >> will never be called for a root hub device. That means lpm_capable will >> by no means be set for the root hub. As the result, lpm isn't functional >> at all in Linux kernel. >> >> This patch add the code to check and set lpm_capable when registering a >> root hub device. It could be back-ported to kernels as old as v3.15, >> that contains the Commit 25cd2882e2fc ("usb/xhci: Change how we indicate >> a host supports Link PM."). >> >> Cc: stable@vger.kernel.org # 3.15 >> Reported-by: Kevin Strasser >> Signed-off-by: Lu Baolu >> --- >> drivers/usb/core/hcd.c | 6 ++++++ >> drivers/usb/core/hub.c | 2 +- >> drivers/usb/core/usb.h | 1 + >> 3 files changed, 8 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c >> index 45a915c..48b208d 100644 >> --- a/drivers/usb/core/hcd.c >> +++ b/drivers/usb/core/hcd.c >> @@ -1032,6 +1032,12 @@ static int register_root_hub(struct usb_hcd *hcd) >> } >> } >> >> + if (le16_to_cpu(usb_dev->descriptor.bcdUSB) >= 0x0201) { > Why are you treating a binary coded value as a hex number to compare > against? The value of the bcdUSB field is 0xJJMN for version JJ.M.N, where JJ ? major version number, M ? minor version number, N ? sub-minor version number I saw several places in usb core where it is treated as a hex and check the version requirement like this. Do you want me to separate it into three numbers and check major/minor/sub-minor versions separately? Thanks, Baolu > > -- > To unsubscribe from this list: send the line "unsubscribe linux-usb" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/