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] Register usb-uhci reset function.
Date: Tue, 16 Jun 2009 15:47:02 +0300	[thread overview]
Message-ID: <20090616124702.GS19508@redhat.com> (raw)

Update irq line on reset. Reseting irq line is required because
racing irq from pci device will call piix3_set_irq(). piix3_set_irq()
will remember current level in pci_irq_levels[]. The PIC line will be
triggered if one of pci_irq_levels[] is set (depends on piix3 config).
If for instance pci_irq_levels[0] and pci_irq_levels[1] are mapped to
the same PIC irq and during reset pci_irq_levels[1] == 1, but device
that drives pci_irq_levels[0] is initialized first the device driver
will not be able to lower irq line.

Without this patch RHEL4.8 hangs after reboot because usb interrupt
does not go away.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
diff --git a/hw/usb-uhci.c b/hw/usb-uhci.c
index 689d40a..2db9850 100644
--- a/hw/usb-uhci.c
+++ b/hw/usb-uhci.c
@@ -346,6 +346,7 @@ static void uhci_reset(UHCIState *s)
     }
 
     uhci_async_cancel_all(s);
+    uhci_update_irq(s);
 }
 
 static void uhci_save(QEMUFile *f, void *opaque)
@@ -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
--
			Gleb.

             reply	other threads:[~2009-06-16 12:47 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-16 12:47 Gleb Natapov [this message]
2009-06-16 17:14 ` [Qemu-devel] [PATCH] Register usb-uhci reset function Paul Brook
2009-06-16 17:37   ` Gleb Natapov
2009-06-16 18:41     ` Paul Brook
2009-06-16 19:11       ` Gleb Natapov
2009-06-16 19:38         ` Paul Brook
2009-06-16 22:57           ` Zachary Amsden
2009-06-17  8:12           ` Gleb Natapov
2009-06-16 18:02   ` Blue Swirl
2009-06-16 19:19 ` Anthony Liguori
2009-06-16 19:26   ` Gleb Natapov
2009-06-17  9:07 ` Filip Navara
2009-06-17  9:43   ` Gleb Natapov
2009-06-17 10:17     ` Filip Navara
2009-06-17 11:06       ` Gleb Natapov
2009-06-17 11:25         ` Dor Laor
2009-06-17 11:39           ` Gleb Natapov
2009-06-17 11:50             ` Filip Navara
2009-06-17 11:36         ` Filip Navara
2009-06-17 12:12           ` Gleb Natapov
2009-06-17 13:03             ` Filip Navara

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=20090616124702.GS19508@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).