From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37207) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2GmQ-0003qV-Ki for qemu-devel@nongnu.org; Fri, 17 Aug 2012 03:15:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T2GmP-0004cu-EU for qemu-devel@nongnu.org; Fri, 17 Aug 2012 03:15:38 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32101) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T2GmP-0004bm-3r for qemu-devel@nongnu.org; Fri, 17 Aug 2012 03:15:37 -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 (8.14.4/8.14.4) with ESMTP id q7H7Fa4c027429 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 17 Aug 2012 03:15:36 -0400 Message-ID: <502DEFD7.7020103@redhat.com> Date: Fri, 17 Aug 2012 09:16:39 +0200 From: Hans de Goede MIME-Version: 1.0 References: <502A78D9.6050003@redhat.com> <502CF9BB.8020107@redhat.com> <502D4961.3060300@redhat.com> <502DE550.90503@redhat.com> <502DED95.8040409@redhat.com> In-Reply-To: <502DED95.8040409@redhat.com> Content-Type: text/plain; charset=UTF-8; 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/17/2012 09:07 AM, Gerd Hoffmann wrote: > Hi, > >> 2) happens when a packet fails, and the queue should be halted, in >> this case > > Should we just cancel all queued packets on endpoint halts then? If the > guest decides to go on we'll easily re-queue everything (with the > existing code). If the guest does something else we don't have to do > anything special. > > Not canceling, then trying to figure what the new state of the already > queued packets is could become tricky ... > Yeah, actually I've come to the same conclusion, after wasting almost a day trying to get things to work the "figure what the new state of the already queued packets is" way, and that indeed is not the way to go! Spo I've just written a patch cancelling all the queued up packets, testing that now :) >> Another problem with failing packets is that hw/usb/core.c will >> happily execute the next packet in the ep queue, even though the spec >> says the ep-queue should be halted, giving the guest a chance to >> cancel transfers after the failed one without them ever executing. >> I've a poc patch fixing this too. > > Indeed, the core should stop processing them. Question is what to do > then. If the host controller cancels all packets anyway we don't have > to do much extra work on the core. Just stop processing on error and > implicitly un-halt the endpoint when the queue becomes empty. Maybe > some extra state tracking and asserts() to catch bugs. Right, also done in my wip patch. I'll go test it, then split it up in multiple patches and then submit. We really should get this in 1.2 btw!