Received: from eggs.gnu.org ([2001:4830:134:3::10]:56801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPDS4-0002aI-PC for qemu-devel@nongnu.org; Fri, 29 Jan 2016 13:07:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aPDS1-0006NF-Dh for qemu-devel@nongnu.org; Fri, 29 Jan 2016 13:07:20 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40936) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aPDS1-0006MS-8V for qemu-devel@nongnu.org; Fri, 29 Jan 2016 13:07:17 -0500 Date: Fri, 29 Jan 2016 23:37:11 +0530 (IST) From: P J P In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Subject: Re: [Qemu-devel] [PATCH 1/1] redirect: change the state after attach usb 3.0 devices to xhci List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Qixiong Su <916628390@qq.com> Cc: qemu-devel Hello Qixiong, +-- On Fri, 29 Jan 2016, Qixiong Su wrote --+ | QEMU crashes when redirect a usb 3.0 device which attached to a xHCI | controller. The assertion of "dev->state == 3" in "usb_handle_packet" has | failed. You need to follow git commit message syntax. ie. One line commit summary, leave second line blank and then commit log message stating why you are doing the proposed change. Please see: -> http://qemu-project.org/Contribute/SubmitAPatch | diff --git a/hw/usb/redirect.c b/hw/usb/redirect.c | index 44522d9..cd29776 100644 | --- a/hw/usb/redirect.c | +++ b/hw/usb/redirect.c | +static void usbredir_handle_attach(USBDevice *udev) | +{ | + assert(udev != NULL); | + assert(udev->attached); | + assert(udev->state == USB_STATE_ATTACHED); This is done in usb_attach() routine, may not be required here. | + if (udev->speed == USB_SPEED_SUPER && (udev->port->speedmask & USB_SPEED_MASK_SUPER)) { | + udev->state = USB_STATE_DEFAULT; Why conditionally set it to default? -- - P J P 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F