From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:38787) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1bfR-00047M-RD for qemu-devel@nongnu.org; Wed, 15 Aug 2012 07:21:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T1bfQ-0004rr-Mg for qemu-devel@nongnu.org; Wed, 15 Aug 2012 07:21:41 -0400 Received: from mx1.redhat.com ([209.132.183.28]:15195) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T1bfQ-0004rn-EQ for qemu-devel@nongnu.org; Wed, 15 Aug 2012 07:21:40 -0400 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q7FBLdBD032385 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 15 Aug 2012 07:21:39 -0400 Message-ID: <502B8682.2050109@redhat.com> Date: Wed, 15 Aug 2012 13:22:42 +0200 From: Hans de Goede MIME-Version: 1.0 References: <502A78D9.6050003@redhat.com> In-Reply-To: <502A78D9.6050003@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] 2 issues with qemu-master / 1.2 ehci code List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: "qemu-devel@nongnu.org" Hi, On 08/14/2012 06:12 PM, Hans de Goede wrote: > Hi, > > While testing qemu-master I've encountered 2 problems caused by the ehci changes > made since 1.1: > > 1) Newly plugged in devices don't get recognized by the guest > This seems to be a case of no interrupt getting generated while it should, doing lsusb in a linux > guest makes the device show up (after the lsusb, so its there in a second lsusb run) I've been looking into this one and I think I know what is going on, the problem is caused by the "ehci: implement Interrupt Threshold Control support" patch: http://www.kraxel.org/cgit/qemu/commit/?h=usb.57&id=7efc17af9a08839a05771541959696875e06cf99 What happens is that since neither the async, nor the periodic schedule are enabled the frame-timer is not running, and during the attaching of the device the Port Change Events (PCD) status bit should get raised multiple times due to port resets, etc. But after the first call to commit_irq, usbsts_frindex contains frindex + 1 (in case of a linux guest), so commit_irq turns into a nop and the guest never sees any of the PCD interrupts other then the first. Part of the problem is that the Interrupt Threshold Control support patch delays all interrupts, which it should not, according to the EHCI spec section 4.15 (ehci-r10.pdf page 115), the following irqs should not be delayed: Port Change Events (PCD), Frame List Rollover (FLR), and Host System Error (HSE). So we need to change the code to not delay these. Once that is done I expect the attach problem I've been seeing to magically go away. I'll go work on a patch for this after lunch. > 2) I'm hitting: > qemu-system-x86_64: /home/hans/projects/qemu/hw/usb/hcd-ehci.c:2075: ehci_state_executing: Assertion `p->qtdaddr == q->qtdaddr' failed. > When trying to redirect a microsoft lifecam, since this is a device with multiple interfaces > (both uvc and usb-audio) I think it may be a case of multiple control requests getting submitted at the same time, > but that is just a wild guess. > I've not made any progress with this one yet. kraxel, any chance you could join #spice on gimpnet so we can discuss this one interactively ? (note I'm of to lunch for an hour first) Regards, Hans