Received: from eggs.gnu.org ([2001:4830:134:3::10]:51739) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aagLt-0001Ih-Gs for qemu-devel@nongnu.org; Tue, 01 Mar 2016 04:12:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aagLp-0007XG-Jo for qemu-devel@nongnu.org; Tue, 01 Mar 2016 04:12:21 -0500 Received: from e23smtp01.au.ibm.com ([202.81.31.143]:39658) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aagLp-0007WF-20 for qemu-devel@nongnu.org; Tue, 01 Mar 2016 04:12:17 -0500 Received: from localhost by e23smtp01.au.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 1 Mar 2016 19:12:13 +1000 From: Alexey Kardashevskiy Date: Tue, 1 Mar 2016 20:10:39 +1100 Message-Id: <1456823441-46757-15-git-send-email-aik@ozlabs.ru> In-Reply-To: <1456823441-46757-1-git-send-email-aik@ozlabs.ru> References: <1456823441-46757-1-git-send-email-aik@ozlabs.ru> Subject: [Qemu-devel] [PATCH qemu v13 14/16] spapr_pci: Add and export DMA resetting helper List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Alexey Kardashevskiy , Alex Williamson , qemu-ppc@nongnu.org This will be later used by the "ibm,reset-pe-dma-window" RTAS handler which resets the DMA configuration to the defaults. Signed-off-by: Alexey Kardashevskiy --- hw/ppc/spapr_pci.c | 11 ++++++++--- include/hw/pci-host/spapr.h | 2 ++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c index b0cd148..4c6e687 100644 --- a/hw/ppc/spapr_pci.c +++ b/hw/ppc/spapr_pci.c @@ -1441,10 +1441,8 @@ static int spapr_phb_children_reset(Object *child, void *opaque) return 0; } -static void spapr_phb_reset(DeviceState *qdev) +void spapr_phb_dma_reset(sPAPRPHBState *sphb) { - sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(qdev); - spapr_phb_dma_window_disable(sphb, sphb->dma_liobn); /* Register default 32bit DMA window */ @@ -1452,6 +1450,13 @@ static void spapr_phb_reset(DeviceState *qdev) SPAPR_TCE_PAGE_SHIFT, sphb->dma_win_addr, sphb->dma_win_size); +} + +static void spapr_phb_reset(DeviceState *qdev) +{ + sPAPRPHBState *sphb = SPAPR_PCI_HOST_BRIDGE(qdev); + + spapr_phb_dma_reset(sphb); /* Reset the IOMMU state */ object_child_foreach(OBJECT(qdev), spapr_phb_children_reset, NULL); diff --git a/include/hw/pci-host/spapr.h b/include/hw/pci-host/spapr.h index 03ee006..7848366 100644 --- a/include/hw/pci-host/spapr.h +++ b/include/hw/pci-host/spapr.h @@ -147,4 +147,6 @@ static inline void spapr_phb_vfio_reset(DeviceState *qdev) } #endif +void spapr_phb_dma_reset(sPAPRPHBState *sphb); + #endif /* __HW_SPAPR_PCI_H__ */ -- 2.5.0.rc3