From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758262AbcGKNAU (ORCPT ); Mon, 11 Jul 2016 09:00:20 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:6030 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751093AbcGKNAS (ORCPT ); Mon, 11 Jul 2016 09:00:18 -0400 From: Pengcheng Li To: , , , , , , CC: , , Pengcheng Li Subject: [PATCH] usb:solve resume usb device identification problem Date: Mon, 11 Jul 2016 20:57:03 +0800 Message-ID: <1468241823-116879-1-git-send-email-lpc.li@hisilicon.com> X-Mailer: git-send-email 2.8.2 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.212.83] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090206.57839856.0099,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-06-18 04:22:30, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: e38a3985a19e157a2e774cc370863a2c Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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); -- 2.8.2