[PATCH] xf86/platform: scan pci after probing devices

Dave Airlie airlied at gmail.com
Sun Sep 9 21:48:37 PDT 2012


From: Dave Airlie <airlied at redhat.com>

This solves a race if we are trying to dynamically power off
secondary GPUs. Its not the greatest fix ever but it probably
as good as we can do for now.

The GPU probing causes the devices to be powered up, then when
we scan the PCI bus we get the correct information from the kernel,
rather than a bunch of 0xff due to the device being powered off.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 hw/xfree86/common/xf86platformBus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 502d3c4..5e05791 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -213,11 +213,12 @@ xf86platformProbe(void)
     int i;
     Bool pci = TRUE;
 
+    config_odev_probe(&xf86PlatformDeviceProbe);
+
     if (!xf86scanpci()) {
         pci = FALSE;
     }
 
-    config_odev_probe(&xf86PlatformDeviceProbe);
     for (i = 0; i < xf86_num_platform_devices; i++) {
         char *busid = xf86_get_platform_attrib(i, ODEV_ATTRIB_BUSID);
 
-- 
1.7.12



More information about the xorg-devel mailing list