[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 02/17] xhci: add support for suspend/resume
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH 02/17] xhci: add support for suspend/resume |
Date: |
Fri, 29 Nov 2013 09:06:06 +0100 |
The OS can ask the xhci controller to save and restore its
internal state, which is used by the OS when the system is
suspended and resumed.
This patch handles writes to the save + restore bits in the
command register. Only thing it does is updating the
restore error bit in the status register to signal an error
on restore. The guest OS should do a full reinitialization
after resume then.
This is the minimal patch which gets S3 going with xhci.
Implementing full save/restore support is TBD.
https://bugzilla.redhat.com/show_bug.cgi?id=1012365
Signed-off-by: Gerd Hoffmann <address@hidden>
---
hw/usb/hcd-xhci.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/usb/hcd-xhci.c b/hw/usb/hcd-xhci.c
index c3377ee..220e99d 100644
--- a/hw/usb/hcd-xhci.c
+++ b/hw/usb/hcd-xhci.c
@@ -3025,6 +3025,14 @@ static void xhci_oper_write(void *ptr, hwaddr reg,
} else if (!(val & USBCMD_RS) && (xhci->usbcmd & USBCMD_RS)) {
xhci_stop(xhci);
}
+ if (val & USBCMD_CSS) {
+ /* save state */
+ xhci->usbsts &= ~USBSTS_SRE;
+ }
+ if (val & USBCMD_CRS) {
+ /* restore state */
+ xhci->usbsts |= USBSTS_SRE;
+ }
xhci->usbcmd = val & 0xc0f;
xhci_mfwrap_update(xhci);
if (val & USBCMD_HCRST) {
--
1.8.3.1
- [Qemu-devel] [PULL 00/17] usb patch queue, Gerd Hoffmann, 2013/11/29
- [Qemu-devel] [PATCH 02/17] xhci: add support for suspend/resume,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH 01/17] xhci: Add a few missing checks for disconnected devices, Gerd Hoffmann, 2013/11/29
- [Qemu-devel] [PATCH 13/17] ehci: implement port wakeup, Gerd Hoffmann, 2013/11/29
- [Qemu-devel] [PATCH 11/17] usb: Add usb_device_alloc/free_streams, Gerd Hoffmann, 2013/11/29
- [Qemu-devel] [PATCH 12/17] xhci: Call usb_device_alloc/free_streams, Gerd Hoffmann, 2013/11/29
- [Qemu-devel] [PATCH 17/17] usb: move usb_{hi, lo} helpers to header file., Gerd Hoffmann, 2013/11/29
- [Qemu-devel] [PATCH 07/17] uas: Bounds check tags when using streams, Gerd Hoffmann, 2013/11/29
- [Qemu-devel] [PATCH 14/17] Revert "usb-tablet: Don't claim wakeup capability for USB-2 version", Gerd Hoffmann, 2013/11/29
- [Qemu-devel] [PATCH 06/17] uas: Streams are numbered 1-y, rather then 0-x, Gerd Hoffmann, 2013/11/29
- [Qemu-devel] [PATCH 15/17] trace-events: Clean up after removal of old usb-host code, Gerd Hoffmann, 2013/11/29
- [Qemu-devel] [PATCH 08/17] uas: Fix response iu struct definition, Gerd Hoffmann, 2013/11/29