[PATCH] [xorg/xserver] config: handle device change event properly

Dan Nicholson dbn.lists at gmail.com
Sun Mar 20 19:42:40 PDT 2011


2011/3/18 Erkki Seppälä <erkki.seppala at vincit.fi>:
> wakeup_handler in udev.c wasn't dealing with udev change events.
> There are situations when a device can gain its input capabilities
> after it has been added to the system and therefore the change events
> must be handled as well.
>
> The change is handled as a consecutive device removal and addition.
>
> Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
> Signed-off-by: Stefan Kost <Stefan.Kost at nokia.com>
> ---
>
> Stefan, please ask a proper Reported-by tag for the bug from the
> original reporter.
>
>  config/udev.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/config/udev.c b/config/udev.c
> index a2f5710..c120747 100644
> --- a/config/udev.c
> +++ b/config/udev.c
> @@ -246,6 +246,10 @@ wakeup_handler(pointer data, int err, pointer read_mask)
>                 device_added(udev_device);
>             else if (!strcmp(action, "remove"))
>                 device_removed(udev_device);
> +            else if (!strcmp(action, "change")) {
> +                device_removed(udev_device);
> +                device_added(udev_device);
> +            }
>         }
>         udev_device_unref(udev_device);
>     }

Just wanted to say that I agree that this patch is needed, but it is
an awfully big hammer. It would be nice if we could pass this
information through to the driver, but I'm not sure how that would
work. Anyway,

Reviewed-by: Dan Nicholson <dbn.lists at gmail.com>


More information about the xorg-devel mailing list