qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 1/2] lsi: Purge request queue on soft reset
@ 2010-04-30 12:06 Jan Kiszka
  2010-05-03 17:14 ` Anthony Liguori
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2010-04-30 12:06 UTC (permalink / raw)
  To: qemu-devel; +Cc: Gerd Hoffmann

Avoid keeping zombie requests across controller reset by purging the
queue and also dropping the currently active request.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 hw/lsi53c895a.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/hw/lsi53c895a.c b/hw/lsi53c895a.c
index 98b7f54..ad23ece 100644
--- a/hw/lsi53c895a.c
+++ b/hw/lsi53c895a.c
@@ -283,6 +283,8 @@ static inline int lsi_irq_on_rsl(LSIState *s)
 
 static void lsi_soft_reset(LSIState *s)
 {
+    lsi_request *p;
+
     DPRINTF("Reset\n");
     s->carry = 0;
 
@@ -345,6 +347,15 @@ static void lsi_soft_reset(LSIState *s)
     s->sbc = 0;
     s->csbc = 0;
     s->sbr = 0;
+    while (!QTAILQ_EMPTY(&s->queue)) {
+        p = QTAILQ_FIRST(&s->queue);
+        QTAILQ_REMOVE(&s->queue, p, next);
+        qemu_free(p);
+    }
+    if (s->current) {
+        qemu_free(s->current);
+        s->current = NULL;
+    }
 }
 
 static int lsi_dma_40bit(LSIState *s)

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

end of thread, other threads:[~2010-05-03 17:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-30 12:06 [Qemu-devel] [PATCH v2 1/2] lsi: Purge request queue on soft reset Jan Kiszka
2010-05-03 17:14 ` Anthony Liguori

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