# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1223635946 -3600
# Node ID 365674de23c225fb5bec546d41c074e8634355b0
# Parent 60bd590a0438e55f1bdd08c01cc6a4932a9b922e
xend: Restore bridge control register after secondary bus reset
From: Chris Dalton <cid@xxxxxx>
Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
tools/python/xen/util/pci.py | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff -r 60bd590a0438 -r 365674de23c2 tools/python/xen/util/pci.py
--- a/tools/python/xen/util/pci.py Fri Oct 10 10:18:06 2008 +0100
+++ b/tools/python/xen/util/pci.py Fri Oct 10 11:52:26 2008 +0100
@@ -475,14 +475,17 @@ class PciDevice:
sysfs_mnt = find_sysfs_mnt()
parent_path = sysfs_mnt + SYSFS_PCI_DEVS_PATH + '/' + \
target_bus + SYSFS_PCI_DEV_CONFIG_PATH
- fd = os.open(parent_path, os.O_WRONLY)
+ fd = os.open(parent_path, os.O_RDWR)
+ # Save state of bridge control register - restore after reset
+ os.lseek(fd, PCI_CB_BRIDGE_CONTROL, 0)
+ br_cntl = (struct.unpack('H', os.read(fd, 2)))[0]
# Assert Secondary Bus Reset
os.lseek(fd, PCI_CB_BRIDGE_CONTROL, 0)
os.write(fd, struct.pack('I', PCI_BRIDGE_CTL_BUS_RESET))
time.sleep(0.200)
# De-assert Secondary Bus Reset
- os.lseek(fd, 0x3e, 0)
- os.write(fd, struct.pack('I', 0x00))
+ os.lseek(fd, PCI_CB_BRIDGE_CONTROL, 0)
+ os.write(fd, struct.pack('H', br_cntl))
time.sleep(0.200)
os.close(fd)
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|