<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/hid/hid-debug.c, branch v3.12.10</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/hid/hid-debug.c?h=v3.12.10</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/hid/hid-debug.c?h=v3.12.10'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<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.amat.us/linux/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>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.amat.us/linux/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: debug: break out hid_dump_report() into hid-debug</title>
<updated>2013-04-30T08:09:06Z</updated>
<author>
<name>Benjamin Tissoires</name>
<email>benjamin.tissoires@redhat.com</email>
</author>
<published>2013-04-17T17:38:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a5f04b9df1113e0c16271afe5e43028f0d763f13'/>
<id>urn:sha1:a5f04b9df1113e0c16271afe5e43028f0d763f13</id>
<content type='text'>
No semantic changes, but hid_dump_report should be in hid-debug.c, not
in hid-core.c

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: hid-debug: Show rdesc for unclaimed devices</title>
<updated>2012-08-27T15:01:21Z</updated>
<author>
<name>Henrik Rydberg</name>
<email>rydberg@bitmath.se</email>
</author>
<published>2012-08-21T18:22:44Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8db089d1b08209c04cd130e49fa4796b5513ce7f'/>
<id>urn:sha1:8db089d1b08209c04cd130e49fa4796b5513ce7f</id>
<content type='text'>
Since commit a7197c2e, the raw report descriptor is available also for
unclaimed devices. This patchs make it show in the rdesc debugfs node.

Signed-off-by: Henrik Rydberg &lt;rydberg@euromail.se&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>Merge branches 'hyperv', 'multitouch', 'roccat', 'upstream', 'upstream-fixes', 'wacom' and 'wiimote' into for-linus</title>
<updated>2012-01-05T14:51:02Z</updated>
<author>
<name>Jiri Kosina</name>
<email>jkosina@suse.cz</email>
</author>
<published>2012-01-05T14:51:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=e0273728564a395a13cfed70e34da4f2613d2d44'/>
<id>urn:sha1:e0273728564a395a13cfed70e34da4f2613d2d44</id>
<content type='text'>
</content>
</entry>
<entry>
<title>HID: debugfs: decode Generic Device Controls Usage Page</title>
<updated>2011-11-19T11:19:00Z</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@goop.org</email>
</author>
<published>2011-11-19T11:19:00Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1f59169e191c62e66dda86ac2bc953c915c8dddf'/>
<id>urn:sha1:1f59169e191c62e66dda86ac2bc953c915c8dddf</id>
<content type='text'>
The USB HID Usage Tables spec defines page 6 for Generic Device Controls, the
most useful of which (to me) is Battery Strength.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>hid: Fix up files needing export.h for EXPORT_SYMBOL</title>
<updated>2011-10-31T23:31:18Z</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-05-27T14:25:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ec37d321b96621906337c4279c490e1b5893ecae'/>
<id>urn:sha1:ec37d321b96621906337c4279c490e1b5893ecae</id>
<content type='text'>
With module.h being implicitly everywhere via device.h, the absence
of explicitly including something for EXPORT_SYMBOL went unnoticed.
Since we are heading to fix things up and clean module.h from the
device.h file, we need to explicitly include these files now.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
</entry>
<entry>
<title>HID: hid-debug: Show application usage for each collection.</title>
<updated>2011-08-16T09:37:29Z</updated>
<author>
<name>Jeff Brown</name>
<email>jeffbrown@android.com</email>
</author>
<published>2011-08-15T23:39:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=54d3339ac127bbf1efd3ae5a1f520a6c302c952a'/>
<id>urn:sha1:54d3339ac127bbf1efd3ae5a1f520a6c302c952a</id>
<content type='text'>
Signed-off-by: jeffbrown@android.com
Reviewed-by: Benjamin Tissoires &lt;benjamin.tissoires@logitech.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>Fix common misspellings</title>
<updated>2011-03-31T14:26:23Z</updated>
<author>
<name>Lucas De Marchi</name>
<email>lucas.demarchi@profusion.mobi</email>
</author>
<published>2011-03-31T01:57:33Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=25985edcedea6396277003854657b5f3cb31a628'/>
<id>urn:sha1:25985edcedea6396277003854657b5f3cb31a628</id>
<content type='text'>
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi &lt;lucas.demarchi@profusion.mobi&gt;
</content>
</entry>
<entry>
<title>HID: Add and use hid_&lt;level&gt;: dev_&lt;level&gt; equivalents</title>
<updated>2010-12-10T14:10:38Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2010-12-10T03:29:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4291ee305e9bb0699504a66f0e2b7aefcf0512a5'/>
<id>urn:sha1:4291ee305e9bb0699504a66f0e2b7aefcf0512a5</id>
<content type='text'>
Neaten current uses of dev_&lt;level&gt; by adding and using
hid specific hid_&lt;level&gt; macros.

Convert existing uses of dev_&lt;level&gt; uses to hid_&lt;level&gt;.
Convert hid-pidff printk uses to hid_&lt;level&gt;.

Remove err_hid and use hid_err instead.

Add missing newlines to logging messages where necessary.
Coalesce format strings.

Add and use pr_fmt(fmt) KBUILD_MODNAME ": " fmt

Other miscellaneous changes:

Add const struct hid_device * argument to hid-core functions
extract() and implement() so hid_&lt;level&gt; can be used by them.
Fix bad indentation in hid-core hid_input_field function
that calls extract() function above.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
</feed>
