From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751485AbdALKI0 (ORCPT ); Thu, 12 Jan 2017 05:08:26 -0500 Received: from mga01.intel.com ([192.55.52.88]:29827 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbdALKIX (ORCPT ); Thu, 12 Jan 2017 05:08:23 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,349,1477983600"; d="scan'208";a="1082110320" Subject: Re: [PATCH 1/1] usb: xhci: set RWE only for remote wakeup capable devices To: Mathias Nyman References: <1484211225-18018-1-git-send-email-baolu.lu@linux.intel.com> Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org From: Lu Baolu Message-ID: <5877558E.2050103@linux.intel.com> Date: Thu, 12 Jan 2017 18:08:14 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: <1484211225-18018-1-git-send-email-baolu.lu@linux.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Mathias, On 01/12/2017 04:53 PM, Lu Baolu wrote: > Xhci spec requires in section 4.23.5.1.1.1 that the RWE bit of USB2 > PORTPMSC register should only set for remote wakeup capble devices. > > This was suggested by Mathias in the following discussion thread. > http://marc.info/?l=linux-usb&m=148154757829677&w=2 > > Suggested-by: Mathias Nyman > Signed-off-by: Lu Baolu > --- > drivers/usb/host/xhci.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c > index 0c8deb9..d887e09 100644 > --- a/drivers/usb/host/xhci.c > +++ b/drivers/usb/host/xhci.c > @@ -4191,7 +4191,9 @@ int xhci_set_usb2_hardware_lpm(struct usb_hcd *hcd, > } > > pm_val &= ~PORT_HIRD_MASK; > - pm_val |= PORT_HIRD(hird) | PORT_RWE | PORT_L1DS(udev->slot_id); > + pm_val |= PORT_HIRD(hird) | PORT_L1DS(udev->slot_id); > + if (udev->do_remote_wakeup) This is not the right thing to check remote wakeup capability of a device. I will rework it and submit v2. Please just ignore this one. Sorry about this. Best regards, Lu Baolu > + pm_val |= PORT_RWE; > writel(pm_val, pm_addr); > pm_val = readl(pm_addr); > pm_val |= PORT_HLE;