From: Jan Kiszka <jan.kiszka@siemens.com>
To: qemu-devel <qemu-devel@nongnu.org>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Subject: [Qemu-devel] [PATCH v2 1/2] lsi: Purge request queue on soft reset
Date: Fri, 30 Apr 2010 14:06:12 +0200 [thread overview]
Message-ID: <4BDAC7B4.2040006@siemens.com> (raw)
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)
next reply other threads:[~2010-04-30 12:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-30 12:06 Jan Kiszka [this message]
2010-05-03 17:14 ` [Qemu-devel] [PATCH v2 1/2] lsi: Purge request queue on soft reset Anthony Liguori
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=4BDAC7B4.2040006@siemens.com \
--to=jan.kiszka@siemens.com \
--cc=kraxel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.