From patchwork Fri Jul 17 11:29:50 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 497090 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id CE12A1409F8 for ; Fri, 17 Jul 2015 21:30:44 +1000 (AEST) Received: from localhost ([::1]:44167 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZG3qk-0006WB-Ly for incoming@patchwork.ozlabs.org; Fri, 17 Jul 2015 07:30:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58446) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZG3q7-0005PG-UB for qemu-devel@nongnu.org; Fri, 17 Jul 2015 07:30:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZG3q4-0005Uv-PP for qemu-devel@nongnu.org; Fri, 17 Jul 2015 07:30:03 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36507) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZG3q4-0005Ti-KN for qemu-devel@nongnu.org; Fri, 17 Jul 2015 07:30:00 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 2380B19CF21; Fri, 17 Jul 2015 11:29:58 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-26.ams2.redhat.com [10.36.116.26]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t6HBTv3x021765; Fri, 17 Jul 2015 07:29:57 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id CED5981BC8; Fri, 17 Jul 2015 13:29:56 +0200 (CEST) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 17 Jul 2015 13:29:50 +0200 Message-Id: <1437132593-6611-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1437132593-6611-1-git-send-email-kraxel@redhat.com> References: <1437132593-6611-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann , Lin Ma Subject: [Qemu-devel] [PULL 1/4] Re-attach usb device to kernel while usb_host_open fails X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Lin Ma Signed-off-by: Lin Ma Reviewed-by: Gonglei Signed-off-by: Gerd Hoffmann --- hw/usb/host-libusb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hw/usb/host-libusb.c b/hw/usb/host-libusb.c index bc2944c..11429f5 100644 --- a/hw/usb/host-libusb.c +++ b/hw/usb/host-libusb.c @@ -889,6 +889,9 @@ static int usb_host_open(USBHostDevice *s, libusb_device *dev) fail: trace_usb_host_open_failure(bus_num, addr); if (s->dh != NULL) { + usb_host_release_interfaces(s); + libusb_reset_device(s->dh); + usb_host_attach_kernel(s); libusb_close(s->dh); s->dh = NULL; s->dev = NULL;