qemu-ppc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-ppc] [PATCH 6/7] pseries: Clear TCE state when resetting PAPR VIO


From: David Gibson
Subject: [Qemu-ppc] [PATCH 6/7] pseries: Clear TCE state when resetting PAPR VIO devices
Date: Wed, 15 Aug 2012 14:33:47 +1000

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.  This
patch corrects that bug, and also removes some small code duplication in
the reset paths.

Signed-off-by: David Gibson <address@hidden>
---
 hw/spapr_vio.c |    9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/hw/spapr_vio.c b/hw/spapr_vio.c
index 7ca4452..298e239 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,8 @@ 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);
 
     if (pc->reset) {
         pc->reset(dev);
-- 
1.7.10.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]