From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuji Shimada Subject: [PATCH 3/3] ioemu: remove power state transition and xc_deassign_device(). Date: Wed, 22 Apr 2009 11:20:45 +0900 Message-ID: <20090422111735.32AD.27C06F64@necst.nec.co.jp> References: <20090422105816.32A4.27C06F64@necst.nec.co.jp> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20090422105816.32A4.27C06F64@necst.nec.co.jp> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Ian Jackson , Kouya Shimura , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This patch adds two changes to ioemu. - Modify ioemu not to call xc_deassign_device() - Remove power state transition of real device when ioemu initialise PMCSR. Thanks, -- Yuji Shimada Signed-off-by: Yuji Shimada diff --git a/hw/pass-through.c b/hw/pass-through.c index 710acbf..65e7634 100644 --- a/hw/pass-through.c +++ b/hw/pass-through.c @@ -2465,29 +2465,6 @@ static uint32_t pt_pmcsr_reg_init(struct pt_dev *ptdev, ptdev->pm_state->no_soft_reset = (*(uint8_t *)(d->config + real_offset) & (uint8_t)PCI_PM_CTRL_NO_SOFT_RESET); - /* wake up real physical device */ - switch ( pci_read_word(ptdev->pci_dev, real_offset) - & PCI_PM_CTRL_STATE_MASK ) - { - case 0: - break; - case 1: - PT_LOG("Power state transition D1 -> D0active\n"); - pci_write_word(ptdev->pci_dev, real_offset, 0); - break; - case 2: - PT_LOG("Power state transition D2 -> D0active\n"); - pci_write_word(ptdev->pci_dev, real_offset, 0); - usleep(200); - break; - case 3: - PT_LOG("Power state transition D3hot -> D0active\n"); - pci_write_word(ptdev->pci_dev, real_offset, 0); - usleep(10 * 1000); - pt_init_pci_config(ptdev); - break; - } - return reg->init_val; } @@ -3963,13 +3940,6 @@ static int unregister_real_device(int slot) /* unregister real device's MMIO/PIO BARs */ pt_unregister_regions(assigned_device); - /* deassign the dev to dom0 */ - bdf |= (pci_dev->bus & 0xff) << 16; - bdf |= (pci_dev->dev & 0x1f) << 11; - bdf |= (pci_dev->func & 0x1f) << 8; - if ( (rc = xc_deassign_device(xc_handle, domid, bdf)) != 0) - PT_LOG("Error: Revoking the device failed! rc=%d\n", rc); - /* mark this slot as free */ php_dev->valid = 0; php_dev->pt_dev = NULL;