From: David Gibson <david@gibson.dropbear.id.au>
To: agraf@suse.de
Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org,
David Gibson <david@gibson.dropbear.id.au>
Subject: [Qemu-devel] [PATCH 5/7] pseries: Clear TCE and signal state when resetting PAPR VIO devices
Date: Mon, 10 Sep 2012 16:38:49 +1000 [thread overview]
Message-ID: <1347259132-31184-6-git-send-email-david@gibson.dropbear.id.au> (raw)
In-Reply-To: <1347259132-31184-1-git-send-email-david@gibson.dropbear.id.au>
When we reset the system, the reset method for VIO bus devices resets
the state of their request queue (if present) as it should. However
it was not resetting the state of their TCE table (DMA translation) if
present. It was also not resetting the state of the per-device signal
mask set with H_VIO_SIGNAL. This patch corrects both bugs, and also
removes some small code duplication in the reset paths.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
hw/spapr_vio.c | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/hw/spapr_vio.c b/hw/spapr_vio.c
index 7ca4452..752836e 100644
--- a/hw/spapr_vio.c
+++ b/hw/spapr_vio.c
@@ -324,9 +324,7 @@ static void spapr_vio_quiesce_one(VIOsPAPRDevice *dev)
}
dev->dma = spapr_tce_new_dma_context(liobn, pc->rtce_window_size);
- dev->crq.qladdr = 0;
- dev->crq.qsize = 0;
- dev->crq.qnext = 0;
+ free_crq(dev);
}
static void rtas_set_tce_bypass(sPAPREnvironment *spapr, uint32_t token,
@@ -409,9 +407,10 @@ static void spapr_vio_busdev_reset(DeviceState *qdev)
VIOsPAPRDevice *dev = DO_UPCAST(VIOsPAPRDevice, qdev, qdev);
VIOsPAPRDeviceClass *pc = VIO_SPAPR_DEVICE_GET_CLASS(dev);
- if (dev->crq.qsize) {
- free_crq(dev);
- }
+ /* Shut down the request queue and TCEs if necessary */
+ spapr_vio_quiesce_one(dev);
+
+ dev->signal_state = 0;
if (pc->reset) {
pc->reset(dev);
--
1.7.10.4
next prev parent reply other threads:[~2012-09-10 6:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-10 6:38 [Qemu-devel] [0/7] System reset fixes for pseries David Gibson
2012-09-10 6:38 ` [Qemu-devel] [PATCH 1/7] ppc: Make kvm_arch_put_registers() put *all* the registers David Gibson
2012-09-10 6:38 ` [Qemu-devel] [PATCH 2/7] pseries: Fix and cleanup CPU initialization and reset David Gibson
2012-09-10 13:45 ` Andreas Färber
2012-09-10 23:45 ` [Qemu-devel] [Qemu-ppc] " David Gibson
2012-09-10 6:38 ` [Qemu-devel] [PATCH 3/7] pseries: Use new method to correct reset sequence David Gibson
2012-09-10 13:47 ` Andreas Färber
2012-09-10 6:38 ` [Qemu-devel] [PATCH 4/7] pseries: Add support for new KVM hash table control call David Gibson
2012-09-10 6:38 ` David Gibson [this message]
2012-09-10 6:38 ` [Qemu-devel] [PATCH 6/7] pseries: Reset emulated PCI TCE tables on system reset David Gibson
2012-09-10 6:38 ` [Qemu-devel] [PATCH 7/7] pseries: Fix XICS reset David Gibson
2012-09-12 5:58 ` [Qemu-devel] [Qemu-ppc] " David Gibson
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=1347259132-31184-6-git-send-email-david@gibson.dropbear.id.au \
--to=david@gibson.dropbear.id.au \
--cc=agraf@suse.de \
--cc=qemu-devel@nongnu.org \
--cc=qemu-ppc@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).