[PATCH] config/udev: do not remove devices on add udev events

Maarten Lankhorst maarten.lankhorst at canonical.com
Tue Nov 26 01:56:57 PST 2013


"udevadm trigger --action=add" can cause devices to be unloaded,
which breaks when X.org is already started during early init.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=72021
Signed-off-by: Maarten Lankhorst <maarten.lankhorst at canonical.com>
---
diff --git a/config/udev.c b/config/udev.c
index 454838f..74ac998 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -300,10 +300,9 @@ wakeup_handler(pointer data, int err, pointer read_mask)
             return;
         action = udev_device_get_action(udev_device);
         if (action) {
-            if (!strcmp(action, "add")) {
-                device_removed(udev_device);
+            if (!strcmp(action, "add"))
                 device_added(udev_device);
-            } else if (!strcmp(action, "change")) {
+            else if (!strcmp(action, "change")) {
                 /* ignore change for the drm devices */
                 if (strcmp(udev_device_get_subsystem(udev_device), "drm")) {
                     device_removed(udev_device);
diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c
index 76f5583..c125e35 100644
--- a/hw/xfree86/os-support/linux/lnx_platform.c
+++ b/hw/xfree86/os-support/linux/lnx_platform.c
@@ -126,6 +126,8 @@ xf86PlatformDeviceProbe(struct OdevAttributes *attribs)
     return;
 
 out_free:
+    LogMessage(X_INFO, "config/udev: Ignoring already known drm device (%s)\n",
+               path);
     config_odev_free_attribute_list(attribs);
 }
 



More information about the xorg-devel mailing list