deadlock between device sysfs removal and userspace access sysfs

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

   I'm seeing what appears to be a deadlock between khubd disconnecting a
malfunctioning USB device (due to EMI likely) and a userspace app querying
a sysfs attribute for the device at the same time.

  This is with Linux 2.6.29.1 - I'm building 2.6.37 to test now but
I'm wondering
if someone has seen something like this before and can point me at patches.
I found:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e16362a0c8d90e9adbfe477acbe32b021823fb22

  which seems relevant, but is already applied to our tree.

  Here is the SysRq-w (blocked tasks) output:

Jan 28 15:08:00 localhost kernel: [53940.956991] SysRq : Show Blocked State
Jan 28 15:08:00 localhost kernel: [53940.957027]   task
PC stack   pid father
Jan 28 15:08:00 localhost kernel: [53940.957065] khubd         D
00002fcf  5348    27      2
Jan 28 15:08:00 localhost kernel: [53940.957111]  f6b49d94 00000046
fa11db42 00002fcf 00000000 f6aac3a0 c09525c4 c0a0a7cc
Jan 28 15:08:00 localhost kernel: [53940.957177]  c0a0d880 c0a0d880
c0a0d880 00000046 f6b466e0 f6b46948 c9d06880 00000000
Jan 28 15:08:00 localhost kernel: [53940.957238]  fa15c269 00002fcf
f6b49d60 f5da979c f70184c0 00000246 f6b49d78 f6b46948
Jan 28 15:08:00 localhost kernel: [53940.957300] Call Trace:
Jan 28 15:08:00 localhost kernel: [53940.957340]  [<c07a1166>]
schedule_timeout+0x1c/0xc3
Jan 28 15:08:00 localhost kernel: [53940.957371]  [<c04262c3>] ?
get_parent_ip+0x10/0x36
Jan 28 15:08:00 localhost kernel: [53940.957396]  [<c07a5472>] ?
sub_preempt_count+0x94/0xa3
Jan 28 15:08:00 localhost kernel: [53940.957422]  [<c07a0685>]
wait_for_common+0xa1/0xee
Jan 28 15:08:00 localhost kernel: [53940.957448]  [<c0428ef5>] ?
default_wake_function+0x0/0x12
Jan 28 15:08:00 localhost kernel: [53940.957475]  [<c07a0765>]
wait_for_completion+0x17/0x19
Jan 28 15:08:00 localhost kernel: [53940.957504]  [<c04da08d>]
sysfs_addrm_finish+0x19d/0x1c9
Jan 28 15:08:00 localhost kernel: [53940.957532]  [<c04d8c16>]
sysfs_hash_and_remove+0x42/0x55
Jan 28 15:08:00 localhost kernel: [53940.957559]  [<c04daf82>]
sysfs_remove_group+0x7e/0xad
Jan 28 15:08:00 localhost kernel: [53940.957587]  [<c0619cf6>]
device_remove_attrs+0x3a/0x9a
Jan 28 15:08:00 localhost kernel: [53940.957611]  [<c0619e49>]
device_del+0xf3/0x151
Jan 28 15:08:00 localhost kernel: [53940.957634]  [<c069f246>]
usb_disable_device+0x72/0xd0
Jan 28 15:08:00 localhost kernel: [53940.957658]  [<c069b33c>]
usb_disconnect+0x7b/0xe3
Jan 28 15:08:00 localhost kernel: [53940.957679]  [<c069c092>]
hub_thread+0x55a/0xe08
Jan 28 15:08:00 localhost kernel: [53940.957704]  [<c044058a>] ?
autoremove_wake_function+0x0/0x38
Jan 28 15:08:00 localhost kernel: [53940.957726]  [<c069bb38>] ?
hub_thread+0x0/0xe08
Jan 28 15:08:00 localhost kernel: [53940.957747]  [<c044026c>] kthread+0x40/0x66
Jan 28 15:08:00 localhost kernel: [53940.957766]  [<c044022c>] ?
kthread+0x0/0x66
Jan 28 15:08:00 localhost kernel: [53940.957788]  [<c0403cd7>]
kernel_thread_helper+0x7/0x10
Jan 28 15:08:00 localhost kernel: [53940.957860] qt_gui        D
00002fcf  5032  8745   6257
Jan 28 15:08:00 localhost kernel: [53940.957896]  f2801e98 00200046
f8e74ff6 00002fcf 00000000 f3e300a0 c0d952af c0a0a7cc
Jan 28 15:08:00 localhost kernel: [53940.957949]  c0a0d880 c0a0d880
c0a0d880 00200246 f5d2a0a0 f5d2a308 c9d06880 00000000
Jan 28 15:08:00 localhost kernel: [53940.958001]  f8f94847 00002fcf
f2801e64 c04262c3 00000001 c9aca21c f2801e74 f5d2a308
Jan 28 15:08:00 localhost kernel: [53940.958054] Call Trace:
Jan 28 15:08:00 localhost kernel: [53940.958074]  [<c04262c3>] ?
get_parent_ip+0x10/0x36
Jan 28 15:08:00 localhost kernel: [53940.958095]  [<c07a5472>] ?
sub_preempt_count+0x94/0xa3
Jan 28 15:08:00 localhost kernel: [53940.958117]  [<c041b517>] ?
kunmap_atomic+0x52/0x68
Jan 28 15:08:00 localhost kernel: [53940.958138]  [<c07a1166>]
schedule_timeout+0x1c/0xc3
Jan 28 15:08:00 localhost kernel: [53940.958159]  [<c04262c3>] ?
get_parent_ip+0x10/0x36
Jan 28 15:08:01 localhost kernel: [53940.958178]  [<c07a5472>] ?
sub_preempt_count+0x94/0xa3
Jan 28 15:08:01 localhost kernel: [53940.958199]  [<c07a1e5e>]
__down_common+0x83/0xc0
Jan 28 15:08:01 localhost kernel: [53940.958220]  [<c07a1efa>] __down+0x17/0x19
Jan 28 15:08:01 localhost kernel: [53940.958241]  [<c04440d9>] down+0x27/0x36
Jan 28 15:08:01 localhost kernel: [53940.958262]  [<c06a37b1>]
show_supports_autosuspend+0x20/0x57
Jan 28 15:08:01 localhost kernel: [53940.958283]  [<c06a3791>] ?
show_supports_autosuspend+0x0/0x57
Jan 28 15:08:01 localhost kernel: [53940.958305]  [<c0619805>]
dev_attr_show+0x1e/0x3b
Jan 28 15:08:01 localhost kernel: [53940.958325]  [<c04d939a>]
sysfs_read_file+0x97/0xf4
Jan 28 15:08:01 localhost kernel: [53940.958346]  [<c04d9303>] ?
sysfs_read_file+0x0/0xf4
Jan 28 15:08:01 localhost kernel: [53940.958367]  [<c049e7c4>]
vfs_read+0x7e/0xaf
Jan 28 15:08:01 localhost kernel: [53940.958386]  [<c049e898>]
sys_read+0x40/0x65
Jan 28 15:08:01 localhost kernel: [53940.958406]  [<c0403402>]
syscall_call+0x7/0xb

qt_gui is a QT console application.

As I noted, I'm going to rerun with 2.6.37, and gather more info
(enable lockdep, etc),
but I'm hoping someone has fixed this already (we need to stick with
2.6.29.1 for various
reasons) and there are patches available.

Thanks,
Pete
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux