linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/3] input: Dynamic Minor Numbers
@ 2012-09-20 17:52 David Herrmann
  2012-09-20 17:52 ` [PATCH v2 1/3] input: add dynamic-minor allocation helpers David Herrmann
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: David Herrmann @ 2012-09-20 17:52 UTC (permalink / raw)
  To: linux-input
  Cc: Dmitry Torokhov, linux-kernel, Bernie Thompson, David Herrmann

Hi

This is version 2 of the Dynamic Minor Numbers support for input devices.
Version 1 can be found here:
  http://thread.gmane.org/gmane.linux.kernel.input/26842

For historical reasons, each input-handler (like evdev, joydev etc.) gets 32
minor numbers assigned statically. That means, if we have more than 32 input
devices, then there will not be any /dev/input/eventX device that user-space can
use to access the device.
While 32 devices were enough for a long time, multi-seat machines currently
cannot create more than 8 seats due to this restriction (assuming 3 devices per
seat plus some static devices).

This patchset allows input-handlers to allocate dynamic minor numbers if they
run out of static numbers. Patch #1 adds the infrastructure to the input core,
patch #2 makes sure we allow enough devices so we actually have room for dynamic
minor numbers and patch #3 converts evdev to use it.

Unused static minors numbers are never used for the dynamic minor numbers pool.
So existing user-space does not break. But old user-space (not using udev) will
not be able to use the new devices.
Existing user-space with udev support will be able to use it, but the xserver
currently crashes when more than 40 devices are added (which is unrelated to
this patch).

If you want to test it, you can use this tool which creates dummy input devices
via uinput:
  https://gist.github.com/3756232

Example output for 'ls -la /dev/input':
https://gist.github.com/3755663

I fixed minor coding-style issues since version 1 and a NULL-dereference in
input_minor_alloc().

Regards
David

David Herrmann (3):
  input: add dynamic-minor allocation helpers
  input: increase INPUT_DEVICES to 512 to allow dynamic minors
  input: evdev: use dynamic-minors if running out of static minors

 drivers/input/evdev.c |  95 +++++++++++++++-------------
 drivers/input/input.c | 167 +++++++++++++++++++++++++++++++++++++++++++++++++-
 include/linux/input.h |   5 ++
 3 files changed, 222 insertions(+), 45 deletions(-)

-- 
1.7.12


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2012-09-25  8:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-20 17:52 [PATCH v2 0/3] input: Dynamic Minor Numbers David Herrmann
2012-09-20 17:52 ` [PATCH v2 1/3] input: add dynamic-minor allocation helpers David Herrmann
2012-09-20 17:52 ` [PATCH v2 2/3] input: increase INPUT_DEVICES to 512 to allow dynamic minors David Herrmann
2012-09-20 17:52 ` [PATCH v2 3/3] input: evdev: use dynamic-minors if running out of static minors David Herrmann
2012-09-21  8:07 ` [PATCH v2 0/3] input: Dynamic Minor Numbers Dmitry Torokhov
2012-09-21  9:22   ` David Herrmann
2012-09-21 19:18     ` David Herrmann
2012-09-21 20:51       ` Dmitry Torokhov
2012-09-21 21:32         ` David Herrmann
2012-09-25  8:55   ` David Herrmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).