qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] uhci: stop queue filling when we find a in-flight td
@ 2012-03-21 17:36 Gerd Hoffmann
  2012-03-22  8:12 ` Erik Rull
  0 siblings, 1 reply; 2+ messages in thread
From: Gerd Hoffmann @ 2012-03-21 17:36 UTC (permalink / raw)
  To: qemu-devel; +Cc: erik.rull, 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 <kraxel@redhat.com>
---
 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

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] uhci: stop queue filling when we find a in-flight td
  2012-03-21 17:36 [Qemu-devel] [PATCH] uhci: stop queue filling when we find a in-flight td Gerd Hoffmann
@ 2012-03-22  8:12 ` Erik Rull
  0 siblings, 0 replies; 2+ messages in thread
From: Erik Rull @ 2012-03-22  8:12 UTC (permalink / raw)
  To: qemu-devel, Gerd Hoffmann


On March 21, 2012 at 6:36 PM Gerd Hoffmann <kraxel@redhat.com> wrote:

> 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 <kraxel@redhat.com>
> ---
>  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
>
>

Issue fixed - my Windows boots again :-)

Thanks a lot!

Best regards,

Erik

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-03-22  8:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-21 17:36 [Qemu-devel] [PATCH] uhci: stop queue filling when we find a in-flight td Gerd Hoffmann
2012-03-22  8:12 ` Erik Rull

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).