qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: qemu-devel@nongnu.org
Subject: [Qemu-devel] [PATCH 3/3] Register usb-uhci reset function.
Date: Wed, 17 Jun 2009 19:32:02 +0300	[thread overview]
Message-ID: <1245256322-30990-3-git-send-email-gleb@redhat.com> (raw)
In-Reply-To: <1245256322-30990-1-git-send-email-gleb@redhat.com>

The device is not reset on system reset currently.
Without this patch RHEL4.8 hangs after reboot if -usbdevice table
is in use.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
---
 hw/usb-uhci.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index 00e740b..ea83bdc 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -319,8 +319,9 @@ static void uhci_update_irq(UHCIState *s)
     qemu_set_irq(s->dev.irq[3], level);
 }
 
-static void uhci_reset(UHCIState *s)
+static void uhci_reset(void *opaque)
 {
+    UHCIState *s = opaque;
     uint8_t *pci_conf;
     int i;
     UHCIPort *port;
@@ -1093,6 +1094,7 @@ void usb_uhci_piix3_init(PCIBus *bus, int devfn)
     }
     s->frame_timer = qemu_new_timer(vm_clock, uhci_frame_timer, s);
 
+    qemu_register_reset(uhci_reset, 0, s);
     uhci_reset(s);
 
     /* Use region 4 for consistency with real hardware.  BSD guests seem
@@ -1127,6 +1129,7 @@ void usb_uhci_piix4_init(PCIBus *bus, int devfn)
     }
     s->frame_timer = qemu_new_timer(vm_clock, uhci_frame_timer, s);
 
+    qemu_register_reset(uhci_reset, 0, s);
     uhci_reset(s);
 
     /* Use region 4 for consistency with real hardware.  BSD guests seem
-- 
1.6.2.1

  parent reply	other threads:[~2009-06-17 16:32 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-17 16:32 [Qemu-devel] [PATCH 1/3] Add pci_bus_reset() function Gleb Natapov
2009-06-17 16:32 ` [Qemu-devel] [PATCH 2/3] Call piix3_reset() on system reset Gleb Natapov
2009-06-17 17:10   ` Blue Swirl
2009-06-18  6:02     ` Gleb Natapov
2009-06-17 16:32 ` Gleb Natapov [this message]
2009-06-17 17:11   ` [Qemu-devel] [PATCH 3/3] Register usb-uhci reset function Blue Swirl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1245256322-30990-3-git-send-email-gleb@redhat.com \
    --to=gleb@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).