From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:50101) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAPT7-0005Ar-KF for qemu-devel@nongnu.org; Wed, 21 Mar 2012 13:37:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SAPT5-0001Cc-4n for qemu-devel@nongnu.org; Wed, 21 Mar 2012 13:37:05 -0400 Received: from mx1.redhat.com ([209.132.183.28]:20557) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SAPT4-0001AR-T2 for qemu-devel@nongnu.org; Wed, 21 Mar 2012 13:37:03 -0400 From: Gerd Hoffmann Date: Wed, 21 Mar 2012 18:36:58 +0100 Message-Id: <1332351418-32233-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH] uhci: stop queue filling when we find a in-flight td List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: erik.rull@rdsoftware.de, Gerd Hoffmann Not only QHs can form rings, but TDs too. With the new queuing/pipelining support we are following TD chains and can actually walk in circles. An assert() prevents us from entering an endless loop then. Fix is easy: Just stop queuing when we figure the TD we are about to queue up is in flight already. Signed-off-by: Gerd Hoffmann --- hw/usb/hcd-uhci.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/hw/usb/hcd-uhci.c b/hw/usb/hcd-uhci.c index e55dad9..2be564b 100644 --- a/hw/usb/hcd-uhci.c +++ b/hw/usb/hcd-uhci.c @@ -965,6 +965,9 @@ static void uhci_fill_queue(UHCIState *s, UHCI_TD *td) } trace_usb_uhci_td_queue(plink & ~0xf, ptd.ctrl, ptd.token); ret = uhci_handle_td(s, plink, &ptd, &int_mask); + if (ret == TD_RESULT_ASYNC_CONT) { + break; + } assert(ret == TD_RESULT_ASYNC_START); assert(int_mask == 0); plink = ptd.link; -- 1.7.1