[PATCH] xfree86: Revert workaround for drm race condition.

Bryce Harrington bryce at canonical.com
Wed Apr 10 23:09:34 PDT 2013


On Wed, Apr 10, 2013 at 11:05:40PM -0700, Bryce Harrington wrote:
> Revert 70739e817b2d64bc020ea491f23a3574bdb6155e and mostly revert
> c31eac647a9ecf0fb20dc98266cadf0ba923ba14.
> 
> Further investigation shows the encountered race condition is between
> lightdm and plymouth-splash, as implemented in the Ubuntu distribution
> within the limitations of upstart's job coordination logic, and can (and
> should) be fixed within those limiations.  Not in xserver itself.
> 
> This leaves some of the diagnostic improvements from the recent patch
> series, in case others run into a similar situation.

This is the effective diff from the prior state of the affected file.

Essentially, it now prints the error code and closes the fd on exit.

Bryce

diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c
index 76f5583..33a953c 100644
--- a/hw/xfree86/os-support/linux/lnx_platform.c
+++ b/hw/xfree86/os-support/linux/lnx_platform.c
@@ -7,6 +7,8 @@
 #include <xf86drm.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <errno.h>
+#include <string.h>
 
 /* Linux platform device support */
 #include "xf86_OSproc.h"
@@ -23,6 +25,7 @@ get_drm_info(struct OdevAttributes *attribs, char *path)
     drmSetVersion sv;
     char *buf;
     int fd;
+    int err = 0;
 
     fd = open(path, O_RDWR, O_CLOEXEC);
     if (fd == -1)
@@ -32,9 +35,11 @@ get_drm_info(struct OdevAttributes *attribs, char *path)
     sv.drm_di_minor = 4;
     sv.drm_dd_major = -1;       /* Don't care */
     sv.drm_dd_minor = -1;       /* Don't care */
-    if (drmSetInterfaceVersion(fd, &sv)) {
-        ErrorF("setversion 1.4 failed\n");
-        return FALSE;
+
+    err = drmSetInterfaceVersion(fd, &sv);
+    if (err) {
+        ErrorF("setversion 1.4 failed: %s\n", strerror(-err));
+	goto out;
     }
 
     xf86_add_platform_device(attribs);
@@ -43,8 +48,9 @@ get_drm_info(struct OdevAttributes *attribs, char *path)
     xf86_add_platform_device_attrib(xf86_num_platform_devices - 1,
                                     ODEV_ATTRIB_BUSID, buf);
     drmFreeBusid(buf);
+out:
     close(fd);
-    return TRUE;
+    return (err == 0);
 }
 
 Bool


More information about the xorg-devel mailing list