<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/hid.h, branch v3.10</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.10'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-05-06T11:07:33Z</updated>
<entry>
<title>HID: debug: fix RCU preemption issue</title>
<updated>2013-05-06T11:07:33Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2013-05-06T11:05:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1deb9d341d475ff84262e927d6c0e36fecb9942e'/>
<id>urn:sha1:1deb9d341d475ff84262e927d6c0e36fecb9942e</id>
<content type='text'>
Commit 2353f2bea ("HID: protect hid_debug_list") introduced mutex
locking around debug_list access to prevent SMP races when debugfs
nodes are being operated upon by multiple userspace processess.

mutex is not a proper synchronization primitive though, as the hid-debug
callbacks are being called from atomic contexts.

We also have to be careful about disabling IRQs when taking the lock
to prevent deadlock against IRQ handlers.

Benjamin reports this has also been reported in RH bugzilla as bug #958935.

 ===============================
 [ INFO: suspicious RCU usage. ]
 3.9.0+ #94 Not tainted
 -------------------------------
 include/linux/rcupdate.h:476 Illegal context switch in RCU read-side critical section!

 other info that might help us debug this:

 rcu_scheduler_active = 1, debug_locks = 0
 4 locks held by Xorg/5502:
  #0:  (&amp;evdev-&gt;mutex){+.+...}, at: [&lt;ffffffff81512c3d&gt;] evdev_write+0x6d/0x160
  #1:  (&amp;(&amp;dev-&gt;event_lock)-&gt;rlock#2){-.-...}, at: [&lt;ffffffff8150dd9b&gt;] input_inject_event+0x5b/0x230
  #2:  (rcu_read_lock){.+.+..}, at: [&lt;ffffffff8150dd82&gt;] input_inject_event+0x42/0x230
  #3:  (&amp;(&amp;usbhid-&gt;lock)-&gt;rlock){-.....}, at: [&lt;ffffffff81565289&gt;] usb_hidinput_input_event+0x89/0x120

 stack backtrace:
 CPU: 0 PID: 5502 Comm: Xorg Not tainted 3.9.0+ #94
 Hardware name: Dell Inc. OptiPlex 390/0M5DCD, BIOS A09 07/24/2012
  0000000000000001 ffff8800689c7c38 ffffffff816f249f ffff8800689c7c68
  ffffffff810acb1d 0000000000000000 ffffffff81a03ac7 000000000000019d
  0000000000000000 ffff8800689c7c90 ffffffff8107cda7 0000000000000000
 Call Trace:
  [&lt;ffffffff816f249f&gt;] dump_stack+0x19/0x1b
  [&lt;ffffffff810acb1d&gt;] lockdep_rcu_suspicious+0xfd/0x130
  [&lt;ffffffff8107cda7&gt;] __might_sleep+0xc7/0x230
  [&lt;ffffffff816f7770&gt;] mutex_lock_nested+0x40/0x3a0
  [&lt;ffffffff81312ac4&gt;] ? vsnprintf+0x354/0x640
  [&lt;ffffffff81553cc4&gt;] hid_debug_event+0x34/0x100
  [&lt;ffffffff81554197&gt;] hid_dump_input+0x67/0xa0
  [&lt;ffffffff81556430&gt;] hid_set_field+0x50/0x120
  [&lt;ffffffff8156529a&gt;] usb_hidinput_input_event+0x9a/0x120
  [&lt;ffffffff8150d89e&gt;] input_handle_event+0x8e/0x530
  [&lt;ffffffff8150df10&gt;] input_inject_event+0x1d0/0x230
  [&lt;ffffffff8150dd82&gt;] ? input_inject_event+0x42/0x230
  [&lt;ffffffff81512cae&gt;] evdev_write+0xde/0x160
  [&lt;ffffffff81185038&gt;] vfs_write+0xc8/0x1f0
  [&lt;ffffffff81185535&gt;] SyS_write+0x55/0xa0
  [&lt;ffffffff81704482&gt;] system_call_fastpath+0x16/0x1b
 BUG: sleeping function called from invalid context at kernel/mutex.c:413
 in_atomic(): 1, irqs_disabled(): 1, pid: 5502, name: Xorg
 INFO: lockdep is turned off.
 irq event stamp: 1098574
 hardirqs last  enabled at (1098573): [&lt;ffffffff816fb53f&gt;] _raw_spin_unlock_irqrestore+0x3f/0x70
 hardirqs last disabled at (1098574): [&lt;ffffffff816faaf5&gt;] _raw_spin_lock_irqsave+0x25/0xa0
 softirqs last  enabled at (1098306): [&lt;ffffffff8104971f&gt;] __do_softirq+0x18f/0x3c0
 softirqs last disabled at (1097867): [&lt;ffffffff81049ad5&gt;] irq_exit+0xa5/0xb0
 CPU: 0 PID: 5502 Comm: Xorg Not tainted 3.9.0+ #94
 Hardware name: Dell Inc. OptiPlex 390/0M5DCD, BIOS A09 07/24/2012
  ffffffff81a03ac7 ffff8800689c7c68 ffffffff816f249f ffff8800689c7c90
  ffffffff8107ce60 0000000000000000 ffff8800689c7fd8 ffff88006a62c800
  ffff8800689c7d10 ffffffff816f7770 ffff8800689c7d00 ffffffff81312ac4
 Call Trace:
  [&lt;ffffffff816f249f&gt;] dump_stack+0x19/0x1b
  [&lt;ffffffff8107ce60&gt;] __might_sleep+0x180/0x230
  [&lt;ffffffff816f7770&gt;] mutex_lock_nested+0x40/0x3a0
  [&lt;ffffffff81312ac4&gt;] ? vsnprintf+0x354/0x640
  [&lt;ffffffff81553cc4&gt;] hid_debug_event+0x34/0x100
  [&lt;ffffffff81554197&gt;] hid_dump_input+0x67/0xa0
  [&lt;ffffffff81556430&gt;] hid_set_field+0x50/0x120
  [&lt;ffffffff8156529a&gt;] usb_hidinput_input_event+0x9a/0x120
  [&lt;ffffffff8150d89e&gt;] input_handle_event+0x8e/0x530
  [&lt;ffffffff8150df10&gt;] input_inject_event+0x1d0/0x230
  [&lt;ffffffff8150dd82&gt;] ? input_inject_event+0x42/0x230
  [&lt;ffffffff81512cae&gt;] evdev_write+0xde/0x160
  [&lt;ffffffff81185038&gt;] vfs_write+0xc8/0x1f0
  [&lt;ffffffff81185535&gt;] SyS_write+0x55/0xa0
  [&lt;ffffffff81704482&gt;] system_call_fastpath+0x16/0x1b

Reported-by: majianpeng &lt;majianpeng@gmail.com&gt;
Reported-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
Reviewed-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>Merge branch 'for-3.10/mt-hybrid-finger-pen' into for-linus</title>
<updated>2013-04-30T08:17:48Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2013-04-30T08:17:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=72c16d9a5c303dce928a52a8861fe7a2a25f849a'/>
<id>urn:sha1:72c16d9a5c303dce928a52a8861fe7a2a25f849a</id>
<content type='text'>
Conflicts:
	drivers/hid/hid-multitouch.c
</content>
</entry>
<entry>
<title>Merge branches 'for-3.10/appleir', 'for-3.10/hid-debug', 'for-3.10/hid-driver-transport-cleanups', 'for-3.10/i2c-hid' and 'for-3.10/logitech' into for-linus</title>
<updated>2013-04-30T08:12:44Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2013-04-30T08:12:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4f5a81042909fed6977881f22c024aa3582cfcca'/>
<id>urn:sha1:4f5a81042909fed6977881f22c024aa3582cfcca</id>
<content type='text'>
</content>
</entry>
<entry>
<title>HID: protect hid_debug_list</title>
<updated>2013-04-30T08:09:31Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2013-04-16T22:40:09Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=2353f2bea307390e015493118e425152b8a5a431'/>
<id>urn:sha1:2353f2bea307390e015493118e425152b8a5a431</id>
<content type='text'>
Accesses to hid_device-&gt;hid_debug_list are not serialized properly, which
could result in SMP concurrency issues when HID debugfs events are accessesed
by multiple userspace processess.

Serialize all the list operations by a mutex.

Spotted by Al Viro.

Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: input: don't register unmapped input devices</title>
<updated>2013-03-27T13:02:45Z</updated>
<author>
<name>Benjamin Tissoires</name>
<email>benjamin.tissoires@redhat.com</email>
</author>
<published>2013-03-22T17:38:28Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=4f22decf9b6329acfe59091c5cba6b378b9b31db'/>
<id>urn:sha1:4f22decf9b6329acfe59091c5cba6b378b9b31db</id>
<content type='text'>
There is no need to register an input device containing no events.
This allows drivers using the quirk MULTI_INPUT to register one input
per report effectively used.

For backward compatibility, we need to add a quirk to request
this behavior.

Signed-off-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: ll_driver: Extend the interface with idle requests</title>
<updated>2013-03-07T14:58:17Z</updated>
<author>
<name>Benjamin Tissoires</name>
<email>benjamin.tissoires@redhat.com</email>
</author>
<published>2013-02-27T15:38:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9684819b5a29e62acd8265a92d8f3454de9bb71e'/>
<id>urn:sha1:9684819b5a29e62acd8265a92d8f3454de9bb71e</id>
<content type='text'>
Some drivers send the idle command directly to underlying device,
creating an unwanted dependency on the underlying transport layer.
This patch adds hid_hw_idle() to the interface, thereby removing
usbhid from the lion share of the drivers.

Signed-off-by: Benjamin Tissoires &lt;benjamin.tissoires@redhat.com&gt;
Reviewed-by: David Herrmann &lt;dh.herrmann@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: Separate struct hid_device's driver_lock into two locks.</title>
<updated>2013-03-01T13:13:07Z</updated>
<author>
<name>Andrew de los Reyes</name>
<email>adlr@chromium.org</email>
</author>
<published>2013-02-18T17:20:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c849a6143bec520aff2a6646518b0d041402428b'/>
<id>urn:sha1:c849a6143bec520aff2a6646518b0d041402428b</id>
<content type='text'>
This patch separates struct hid_device's driver_lock into two. The
goal is to allow hid device drivers to receive input during their
probe() or remove() function calls. This is necessary because some
drivers need to communicate with the device to determine parameters
needed during probe (e.g., size of a multi-touch surface), and if
possible, may perfer to communicate with a device on host-initiated
disconnect (e.g., to put it into a low-power state).

Historically, three functions used driver_lock:

- hid_device_probe: blocks to acquire lock
- hid_device_remove: blocks to acquire lock
- hid_input_report: if locked returns -EBUSY, else acquires lock

This patch adds another lock (driver_input_lock) which is used to
block input from occurring. The lock behavior is now:

- hid_device_probe: blocks to acq. driver_lock, then driver_input_lock
- hid_device_remove: blocks to acq. driver_lock, then driver_input_lock
- hid_input_report: if driver_input_lock locked returns -EBUSY, else
  acquires driver_input_lock

This patch also adds two helper functions to be called during probe()
or remove(): hid_device_io_start() and hid_device_io_stop(). These
functions lock and unlock, respectively, driver_input_lock; they also
make a note of whether they did so that hid-core knows if a driver has
changed the lock state.

This patch results in no behavior change for existing devices and
drivers. However, during a probe() or remove() function call in a
driver, that driver may now selectively call hid_device_io_start() to
let input events come through, then optionally call
hid_device_io_stop() to stop them.

Signed-off-by: Andrew de los Reyes &lt;adlr@chromium.org&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: Extend the interface with wait io request</title>
<updated>2013-02-25T12:26:39Z</updated>
<author>
<name>Henrik Rydberg</name>
<email>rydberg@euromail.se</email>
</author>
<published>2013-02-25T10:31:44Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=3373443befa73ee60e4275e7699b26058b01455a'/>
<id>urn:sha1:3373443befa73ee60e4275e7699b26058b01455a</id>
<content type='text'>
Some drivers need to wait for an io from the underlying device, creating
an unwanted dependency on the underlying transport layer. This patch adds
wait() to the interface, thereby removing usbhid from the lion share of
the drivers.

Signed-off-by: Henrik Rydberg &lt;rydberg@euromail.se&gt;
Signed-off-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
Reviewed-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>HID: Extend the interface with report requests</title>
<updated>2013-02-25T12:26:39Z</updated>
<author>
<name>Henrik Rydberg</name>
<email>rydberg@euromail.se</email>
</author>
<published>2013-02-25T10:31:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e90a6df80dc45ab53d2f4f4db297434e48c0208e'/>
<id>urn:sha1:e90a6df80dc45ab53d2f4f4db297434e48c0208e</id>
<content type='text'>
Some drivers send reports directly to underlying device, creating an
unwanted dependency on the underlying transport layer. This patch adds
hid_hw_request() to the interface, thereby removing usbhid from the
lion share of the drivers.

Signed-off-by: Henrik Rydberg &lt;rydberg@euromail.se&gt;
Signed-off-by: Benjamin Tissoires &lt;benjamin.tissoires@gmail.com&gt;
Reviewed-by: Mika Westerberg &lt;mika.westerberg@linux.intel.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>Merge branches 'for-3.9/logitech', 'for-3.9/multitouch', 'for-3.9/ntrig', 'for-3.9/thingm' and 'for-3.9/upstream' into for-linus</title>
<updated>2013-02-21T09:45:01Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2013-02-21T09:45:01Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=73759518d6d6b56e398791b7522328baf4181a82'/>
<id>urn:sha1:73759518d6d6b56e398791b7522328baf4181a82</id>
<content type='text'>
</content>
</entry>
</feed>
