From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932595AbcGLAln (ORCPT ); Mon, 11 Jul 2016 20:41:43 -0400 Received: from mga09.intel.com ([134.134.136.24]:58997 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932332AbcGLAlm (ORCPT ); Mon, 11 Jul 2016 20:41:42 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.28,348,1464678000"; d="scan'208";a="137536036" Subject: Re: [PATCH] usb:solve resume usb device identification problem To: Pengcheng Li , gregkh@linuxfoundation.org, stern@rowland.harvard.edu, chasemetzger15@gmail.com, mathias.nyman@linux.intel.com, oneukum@suse.com, jun.li@freescale.com References: <1468241823-116879-1-git-send-email-lpc.li@hisilicon.com> Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org From: Lu Baolu Message-ID: <57843CC3.7050204@linux.intel.com> Date: Tue, 12 Jul 2016 08:41:39 +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: <1468241823-116879-1-git-send-email-lpc.li@hisilicon.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, On 07/11/2016 08:57 PM, Pengcheng Li wrote: > A usb device in the connection state. Then host is suspend and resume. > But the usb device could not be at the right speed. We should be reset > the reset. Have you tried applying XHCI_RESET_ON_RESUME quirk to your host controller driver? Is your usb device self powered? Best regards, Lu Baolu > > Signed-off-by: Pengcheng Li > --- > drivers/usb/core/hub.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c > index bee1351..cd71bb3 100644 > --- a/drivers/usb/core/hub.c > +++ b/drivers/usb/core/hub.c > @@ -3455,7 +3455,7 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg) > struct usb_hub *hub = usb_hub_to_struct_hub(udev->parent); > struct usb_port *port_dev = hub->ports[udev->portnum - 1]; > int port1 = udev->portnum; > - int status; > + int status, retval; > u16 portchange, portstatus; > > if (!test_and_set_bit(port1, hub->child_usage_bits)) { > @@ -3512,6 +3512,10 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg) > } > } > > + retval = hub_port_reset(hub, port1, udev, HUB_ROOT_RESET_TIME, false); > + if (retval < 0) > + hub_port_disable(hub, port1, 0); > + > if (udev->persist_enabled) > status = wait_for_connected(udev, hub, &port1, &portchange, > &portstatus);