From patchwork Wed Sep 12 13:08:40 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 183362 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id F3CE32C0088 for ; Wed, 12 Sep 2012 23:08:59 +1000 (EST) Received: from localhost ([::1]:34974 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBmgc-0004E4-0F for incoming@patchwork.ozlabs.org; Wed, 12 Sep 2012 09:08:58 -0400 Received: from eggs.gnu.org ([208.118.235.92]:59256) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBmfR-0001bI-4l for qemu-devel@nongnu.org; Wed, 12 Sep 2012 09:07:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TBmfM-0006Oy-7D for qemu-devel@nongnu.org; Wed, 12 Sep 2012 09:07:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:8107) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TBmfL-0006Oo-VO for qemu-devel@nongnu.org; Wed, 12 Sep 2012 09:07:40 -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 q8CD7d1B019257 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 12 Sep 2012 09:07:39 -0400 Received: from shalem.localdomain.com (vpn-8-211.rdu.redhat.com [10.11.8.211]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q8CD7Qin003532; Wed, 12 Sep 2012 09:07:38 -0400 From: Hans de Goede To: Gerd Hoffmann Date: Wed, 12 Sep 2012 15:08:40 +0200 Message-Id: <1347455320-10809-9-git-send-email-hdegoede@redhat.com> In-Reply-To: <1347455320-10809-1-git-send-email-hdegoede@redhat.com> References: <1347455320-10809-1-git-send-email-hdegoede@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.132.183.28 Cc: Hans de Goede , qemu-devel@nongnu.org Subject: [Qemu-devel] [PATCH 9/9] uhci: Don't queue up packets after one with the SPD flag set 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 Don't queue up packets after a packet with the SPD (short packet detect) flag set. Since we won't know if the packet will actually be short until it has completed, and if it is short we should stop the queue. This fixes a miniature photoframe emulating a USB cdrom with the windows software for it not working. Signed-off-by: Hans de Goede --- hw/usb/hcd-uhci.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index c7c8786..cdc8bc3 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -1000,6 +1000,9 @@ static void uhci_fill_queue(UHCIState *s, UHCI_TD *td) } assert(ret == TD_RESULT_ASYNC_START); assert(int_mask == 0); + if (ptd.ctrl & TD_CTRL_SPD) { + break; + } plink = ptd.link; } } @@ -1097,7 +1100,7 @@ static void uhci_process_frame(UHCIState *s) case TD_RESULT_ASYNC_START: trace_usb_uhci_td_async(curr_qh & ~0xf, link & ~0xf); - if (is_valid(td.link)) { + if (is_valid(td.link) && !(td.ctrl & TD_CTRL_SPD)) { uhci_fill_queue(s, &td); } link = curr_qh ? qh.link : td.link;