From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55704) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOqi5-0005Qc-LG for qemu-devel@nongnu.org; Thu, 18 Oct 2012 10:04:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TOqhw-0001nM-7w for qemu-devel@nongnu.org; Thu, 18 Oct 2012 10:04:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21091) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TOqhv-0001nI-W2 for qemu-devel@nongnu.org; Thu, 18 Oct 2012 10:04:20 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q9IE4IpP016982 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 18 Oct 2012 10:04:19 -0400 From: Hans de Goede Date: Thu, 18 Oct 2012 16:05:52 +0200 Message-Id: <1350569156-2565-1-git-send-email-hdegoede@redhat.com> Subject: [Qemu-devel] [PATCH 0/4] RFC: usb: split packet result into actual_length + status List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Gerd Hoffmann Cc: qemu-devel@nongnu.org With the ehci and xhci controllers a single packet can be larger then maxpacketsize, making it possible for the result of a single packet to be both having transferred some data as well as the transfer to have an error. An example would be an input transfer from a bulk endpoint successfully receiving 1 or more maxpacketsize packets from the device, followed by a packet signalling halt. In practice this will almost never happen, still I believe it is worth to fix this, as this could happen under normal circumstances if for example a redirected usb mass storage device has shorter then requested scsi cmd or sense data, which is exactly a multiple of maxpacketsize. The former (shorter then requested data) is actually quite normal, but the exact a multiple of maxpacketsize is rather rare, which is why sofar we've not been bitten by this. Also as the patches which modify the hcd / redirect code show, having the length in a seperate field also leads to cleaner code (IMHO). Note: This patch series applies on top of the input pipelining patch series. Regards, Hans