qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] xhci: Fix number of streams allocated when using streams
@ 2013-09-16 15:04 Hans de Goede
  2013-09-16 15:23 ` Gerd Hoffmann
  0 siblings, 1 reply; 2+ messages in thread
From: Hans de Goede @ 2013-09-16 15:04 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: Hans de Goede, qemu-devel

According to the xhci spec the total number of streams is
2 ^ (MaxPStreams + 1), and this is also how the Linux xhci driver
uses this field.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 hw/usb/hcd-xhci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index f02231d..69d9144 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -1138,7 +1138,7 @@ static void xhci_reset_streams(XHCIEPContext *epctx)
 static void xhci_alloc_streams(XHCIEPContext *epctx, dma_addr_t base)
 {
     assert(epctx->pstreams == NULL);
-    epctx->nr_pstreams = 2 << epctx->max_pstreams;
+    epctx->nr_pstreams = 2 << (epctx->max_pstreams + 1);
     epctx->pstreams = xhci_alloc_stream_contexts(epctx->nr_pstreams, base);
 }
 
-- 
1.8.3.1

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

* Re: [Qemu-devel] [PATCH] xhci: Fix number of streams allocated when using streams
  2013-09-16 15:04 [Qemu-devel] [PATCH] xhci: Fix number of streams allocated when using streams Hans de Goede
@ 2013-09-16 15:23 ` Gerd Hoffmann
  0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2013-09-16 15:23 UTC (permalink / raw)
  To: Hans de Goede; +Cc: qemu-devel

On Mo, 2013-09-16 at 17:04 +0200, Hans de Goede wrote:
> According to the xhci spec the total number of streams is
> 2 ^ (MaxPStreams + 1), and this is also how the Linux xhci driver
> uses this field.

Added to usb patch queue.

thanks,
  Gerd

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

end of thread, other threads:[~2013-09-16 15:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-16 15:04 [Qemu-devel] [PATCH] xhci: Fix number of streams allocated when using streams Hans de Goede
2013-09-16 15:23 ` Gerd Hoffmann

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).