login
Header Space

 
 

Re: [PATCH] evdev: Release eventual input device grabs when getting disconnected

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linus Torvalds <torvalds@...>
Cc: Björn <B.Steinbrink@...>, Dmitry Torokhov <dmitry.torokhov@...>, Arjan van de Ven <arjan@...>, Linux Kernel Mailing List <linux-kernel@...>, Jiri Kosina <jkosina@...>, Greg KH <greg@...>
Date: Monday, March 31, 2008 - 4:21 pm

On Sun, 2008-03-30 at 14:51 -0700, Linus Torvalds wrote:


Odd, I can reproduce trivially on UP. The patch definitely helps.


Unfortunately, I can't even bisect, I just tried compiling 2.6.25-rc1
and it failed to link because of __udivi3, __umodi3 and another one (or
similar). A quick look failed to tell me why I get that with -rc1 and
-rc2 but not -rc7.

Below is a simple test program. Run it on any event device, then rmmod
the module the device belongs to and abort the program with ctrl-c.

johannes

#include <stdlib.h>
#include <unistd.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/input.h>

int main (int argc, char **argv)
{
	int fd;

	if (argc < 2) {
		printf("Usage: grab /dev/input/eventX\n");
		printf("Where X =3D input device number\n");
		exit(1);
	}

	if ((fd =3D open(argv[argc - 1], O_RDONLY)) < 0) {
		perror("grab[open]");
		exit(1);
	}

	if (ioctl(fd, EVIOCGRAB, 1)) {
		perror("grab[EVIOCGRAB]");
		exit(1);
	}

	printf("interrupt to exit\n");

	while (1)
		sleep(1000);
}
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] evdev: Release eventual input device grabs when ..., Johannes Berg, (Mon Mar 31, 4:21 pm)
Re: [PATCH] evdev: Release eventual input device grabs when ..., Benjamin Herrenschmidt, (Mon Mar 31, 7:12 pm)
Re: [PATCH] evdev: Release eventual input device grabs when ..., Benjamin Herrenschmidt, (Mon Mar 31, 9:01 pm)
speck-geostationary