staging: comedi: USB devs not working / some comedi core reorganization

Bernd Porr mail at berndporr.me.uk
Fri Dec 20 23:48:31 UTC 2013


Hi all,

here is another patch which fixes a kernel warning where a subdevice is 
released which no longer exists. The subdevice was removed before the 
main comedi device. The functions for the main dev removal and the 
subdevice were in different files/modules, were called from different 
subsystems and I've moved them together to make sure the order is right.

There is still a problem that the subdevices are sometimes not generated 
at boot time (cold boot) but hotplug does. I don't get any error 
messages though so firmware load is probably not the problem. I've put 
loads of the printk in it but then the error disappears (!). Seems to be 
a very tight race condition.

/Bernd


>> There is another issue which has to the with the subdevices. This
>> happens when I unplug the DUX board (all boards cause this):
>>
>> [ 4972.978379] ------------[ cut here ]------------
>> [ 4972.978386] WARNING: CPU: 0 PID: 33 at fs/sysfs/group.c:214
>> sysfs_remove_group+0xc6/0xd0()
>> [ 4972.978389] sysfs group ffffffff81caa2e0 not found for kobject
>> 'comedi0_subd1'
>> [ 4972.978392] Modules linked in: usbdux(O) usbduxsigma(O) comedi_fc(O)
>> comedi(O) radeon bnep rfcomm bluetooth snd_hda_codec_idt snd_hda_intel
>> snd_hda_codec parport_pc ppdev rc_hauppauge snd_bt87x ir_kbd_i2c
>> snd_hwdep tuner snd_pcm msp3400 snd_page_alloc snd_seq_midi bttv
>> snd_seq_midi_event snd_rawmidi pcmcia hid_generic snd_seq pcmcia_core
>> ttm usbhid hid drm_kms_helper snd_seq_device drm btcx_risc snd_timer
>> tveeprom videobuf_dma_sg rc_core snd v4l2_common psmouse videobuf_core
>> gpio_ich videodev dcdbas microcode serio_raw lpc_ich i2c_algo_bit
>> soundcore mac_hid lp parport e100 ahci mii libahci [last unloaded: 
>> comedi]
>> [ 4972.978454] CPU: 0 PID: 33 Comm: khubd Tainted: G        WC O
>> 3.13.0-rc3+ #1
>> [ 4972.978457] Hardware name: Dell Inc.                 Dimension 9100
>>                /0X8582, BIOS A01 05/25/2005
>> [ 4972.978460]  0000000000000009 ffff88005c801a38 ffffffff81721083
>> ffff88005c801a80
>> [ 4972.978466]  ffff88005c801a70 ffffffff810645fd 0000000000000000
>> ffffffff81caa2e0
>> [ 4972.978472]  ffff8800560ed810 ffff88005a615000 0000000000000000
>> ffff88005c801ad0
>> [ 4972.978478] Call Trace:
>> [ 4972.978484]  [<ffffffff81721083>] dump_stack+0x45/0x56
>> [ 4972.978489]  [<ffffffff810645fd>] warn_slowpath_common+0x7d/0xa0
>> [ 4972.978494]  [<ffffffff8106466c>] warn_slowpath_fmt+0x4c/0x50
>> [ 4972.978499]  [<ffffffff8122fb7e>] ? sysfs_get_dirent_ns+0x4e/0x70
>> [ 4972.978504]  [<ffffffff81230e56>] sysfs_remove_group+0xc6/0xd0
>> [ 4972.978509]  [<ffffffff814a5793>] dpm_sysfs_remove+0x43/0x50
>> [ 4972.978513]  [<ffffffff8149b1c5>] device_del+0x45/0x1c0
>> [ 4972.978518]  [<ffffffff8149b35e>] device_unregister+0x1e/0x60
>> [ 4972.978522]  [<ffffffff8149b41c>] device_destroy+0x3c/0x50
>> [ 4972.978530]  [<ffffffffa0221525>]
>> comedi_free_subdevice_minor+0x75/0xa0 [comedi]
>> [ 4972.978539]  [<ffffffffa0221f68>] comedi_device_detach+0x48/0x160
>> [comedi]
>> [ 4972.978546]  [<ffffffffa021e2b3>] comedi_device_cleanup+0x33/0x90
>> [comedi]
>> [ 4972.978552]  [<ffffffffa021e346>] comedi_free_board_dev+0x36/0x50
>> [comedi]
>> [ 4972.978558]  [<ffffffffa02213b0>]
>> comedi_release_hardware_device+0x80/0x90 [comedi]
>> [ 4972.978565]  [<ffffffffa0221a63>] comedi_auto_unconfig+0x13/0x20 
>> [comedi]
>> [ 4972.978572]  [<ffffffffa0223172>] comedi_usb_auto_unconfig+0x12/0x20
>> [comedi]
>> [ 4972.978578]  [<ffffffff815520f4>] usb_unbind_interface+0x64/0x1c0
>> [ 4972.978583]  [<ffffffff8149eedf>] __device_release_driver+0x7f/0xf0
>> [ 4972.978587]  [<ffffffff8149ef73>] device_release_driver+0x23/0x30
>> [ 4972.978592]  [<ffffffff8149e7f8>] bus_remove_device+0x108/0x180
>> [ 4972.978596]  [<ffffffff8149b2a9>] device_del+0x129/0x1c0
>> [ 4972.978601]  [<ffffffff8154faa0>] usb_disable_device+0xb0/0x290
>> [ 4972.978605]  [<ffffffff815442bd>] usb_disconnect+0xad/0x200
>> [ 4972.978609]  [<ffffffff8154763d>] hub_thread+0x70d/0x1750
>> [ 4972.978614]  [<ffffffff8109a4c8>] ? sched_clock_cpu+0xa8/0x100
>> [ 4972.978619]  [<ffffffff810a88c0>] ? prepare_to_wait_event+0x100/0x100
>> [ 4972.978623]  [<ffffffff81546f30>] ? usb_reset_device+0x1d0/0x1d0
>> [ 4972.978627]  [<ffffffff81088152>] kthread+0xd2/0xf0
>> [ 4972.978632]  [<ffffffff81088080>] ? kthread_create_on_node+0x190/0x190
>> [ 4972.978637]  [<ffffffff81731d3c>] ret_from_fork+0x7c/0xb0
>> [ 4972.978641]  [<ffffffff81088080>] ? kthread_create_on_node+0x190/0x190
>> [ 4972.978644] ---[ end trace 69c2b5c4559cdf1b ]---
>>
>> I guess that subdevice no longer exists at this point?
>>
>> /Bernd
> 
> I'm hoping that will be fixed by other changes I made to the comedi core 
> recently that aren't in the RC kernel yet.
> 

-- 
http://www.berndporr.me.uk
http://www.linux-usb-daq.co.uk
http://www.imdb.com/name/nm3293421/
+44 (0)7840 340069
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Moving-un-registering-of-the-subdevices-and-the-main.patch
Type: text/x-patch
Size: 2411 bytes
Desc: not available
URL: <http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/attachments/20131220/b8a647d1/attachment.bin>


More information about the devel mailing list