qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 0/2] usb-hub: clear PORT_STAT_SUSPEND on wakeup
@ 2017-05-11 12:53 Ladi Prosek
  2017-05-11 12:53 ` [Qemu-devel] [PATCH 1/2] xhci: fix logging Ladi Prosek
  2017-05-11 12:53 ` [Qemu-devel] [PATCH 2/2] usb-hub: clear PORT_STAT_SUSPEND on wakeup Ladi Prosek
  0 siblings, 2 replies; 3+ messages in thread
From: Ladi Prosek @ 2017-05-11 12:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: kraxel

Two small usb patches. Patch 2 fixes a problem with xhci on Windows,
patch 1 addresses a minor code issue I found when debugging it.

Ladi Prosek (2):
      xhci: fix logging
      usb-hub: clear PORT_STAT_SUSPEND on wakeup

 hw/usb/dev-hub.c  | 1 +
 hw/usb/hcd-xhci.c | 7 ++-----
 2 files changed, 3 insertions(+), 5 deletions(-)

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

* [Qemu-devel] [PATCH 1/2] xhci: fix logging
  2017-05-11 12:53 [Qemu-devel] [PATCH 0/2] usb-hub: clear PORT_STAT_SUSPEND on wakeup Ladi Prosek
@ 2017-05-11 12:53 ` Ladi Prosek
  2017-05-11 12:53 ` [Qemu-devel] [PATCH 2/2] usb-hub: clear PORT_STAT_SUSPEND on wakeup Ladi Prosek
  1 sibling, 0 replies; 3+ messages in thread
From: Ladi Prosek @ 2017-05-11 12:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: kraxel

slotid and epid were deleted from XHCITransfer in commit d6fcb29.
Also deleting one unused forward declaration.

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
---
 hw/usb/hcd-xhci.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index a2d3143..d3d47bf 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -1790,9 +1790,6 @@ static void xhci_stall_ep(XHCITransfer *xfer)
     }
 }
 
-static int xhci_submit(XHCIState *xhci, XHCITransfer *xfer,
-                       XHCIEPContext *epctx);
-
 static int xhci_setup_packet(XHCITransfer *xfer)
 {
     USBEndpoint *ep;
@@ -1806,7 +1803,7 @@ static int xhci_setup_packet(XHCITransfer *xfer)
         ep = xhci_epid_to_usbep(xfer->epctx);
         if (!ep) {
             DPRINTF("xhci: slot %d has no device\n",
-                    xfer->slotid);
+                    xfer->epctx->slotid);
             return -1;
         }
     }
@@ -1980,7 +1977,7 @@ static int xhci_submit(XHCIState *xhci, XHCITransfer *xfer, XHCIEPContext *epctx
 {
     uint64_t mfindex;
 
-    DPRINTF("xhci_submit(slotid=%d,epid=%d)\n", xfer->slotid, xfer->epid);
+    DPRINTF("xhci_submit(slotid=%d,epid=%d)\n", epctx->slotid, epctx->epid);
 
     xfer->in_xfer = epctx->type>>2;
 
-- 
2.9.3

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

* [Qemu-devel] [PATCH 2/2] usb-hub: clear PORT_STAT_SUSPEND on wakeup
  2017-05-11 12:53 [Qemu-devel] [PATCH 0/2] usb-hub: clear PORT_STAT_SUSPEND on wakeup Ladi Prosek
  2017-05-11 12:53 ` [Qemu-devel] [PATCH 1/2] xhci: fix logging Ladi Prosek
@ 2017-05-11 12:53 ` Ladi Prosek
  1 sibling, 0 replies; 3+ messages in thread
From: Ladi Prosek @ 2017-05-11 12:53 UTC (permalink / raw)
  To: qemu-devel; +Cc: kraxel

The spec says:

  Suspend: (PORT_SUSPEND) This field indicates whether or not the device
  on this port is suspended. Setting this field causes the device to
  suspend by not propagating bus traffic downstream. This field may be
  reset by a request or by resume signaling from the device attached to
  the port.

I can't find any specific statement like "the PORT_SUSPEND field is reset
automatically on remote wakeup", but without this patch, the only way to
reset it is via the ClearPortFeature request so the ".. or by resume
signaling from the device" clause is clearly not implemented on the remote
wakeup path.

The default xhci Windows driver does not issue the ClearPortFeature request
and suspended devices attached to a hub don't properly get out of the
suspended state. Interestingly, the default uhci Windows driver *does*
issue the ClearPortFeature request and does not exhibit this problem.

Signed-off-by: Ladi Prosek <lprosek@redhat.com>
---
 hw/usb/dev-hub.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/usb/dev-hub.c b/hw/usb/dev-hub.c
index 9fe7333..47b7519 100644
--- a/hw/usb/dev-hub.c
+++ b/hw/usb/dev-hub.c
@@ -208,6 +208,7 @@ static void usb_hub_wakeup(USBPort *port1)
     USBHubPort *port = &s->ports[port1->index];
 
     if (port->wPortStatus & PORT_STAT_SUSPEND) {
+        port->wPortStatus &= ~PORT_STAT_SUSPEND;
         port->wPortChange |= PORT_STAT_C_SUSPEND;
         usb_wakeup(s->intr, 0);
     }
-- 
2.9.3

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

end of thread, other threads:[~2017-05-11 12:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-11 12:53 [Qemu-devel] [PATCH 0/2] usb-hub: clear PORT_STAT_SUSPEND on wakeup Ladi Prosek
2017-05-11 12:53 ` [Qemu-devel] [PATCH 1/2] xhci: fix logging Ladi Prosek
2017-05-11 12:53 ` [Qemu-devel] [PATCH 2/2] usb-hub: clear PORT_STAT_SUSPEND on wakeup Ladi Prosek

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