WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH 3/3] ioemu: remove power state transition and xc_deas

To: Ian Jackson <Ian.Jackson@xxxxxxxxxxxxx>, Kouya Shimura <kouya@xxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-devel] [PATCH 3/3] ioemu: remove power state transition and xc_deassign_device().
From: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
Date: Wed, 22 Apr 2009 11:20:45 +0900
Cc:
Delivery-date: Tue, 21 Apr 2009 19:22:04 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090422105816.32A4.27C06F64@xxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20090422105816.32A4.27C06F64@xxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
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 <shimada-yxb@xxxxxxxxxxxxxxx>

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;


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel