From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.kapsi.fi ([217.30.184.167]:39621 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751437AbaAMRa3 (ORCPT ); Mon, 13 Jan 2014 12:30:29 -0500 Message-ID: <52D422B0.2020104@iki.fi> Date: Mon, 13 Jan 2014 19:30:24 +0200 From: Antti Palosaari MIME-Version: 1.0 To: Mauro Carvalho Chehab CC: Linux Media Mailing List , Mauro Carvalho Chehab Subject: Re: [PATCH 0/7] Fix remaining issues with em28xx device removal References: <1389567649-26838-1-git-send-email-m.chehab@samsung.com> In-Reply-To: <1389567649-26838-1-git-send-email-m.chehab@samsung.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: On 13.01.2014 01:00, Mauro Carvalho Chehab wrote: > Even after Frank's series, there are several issues with device module > removal. > > This series fix those issues, by use kref to deallocate the common > data (struct em28xx *dev). > > It also fixes a circular deppendency inside em28xx-audio. > > Mauro Carvalho Chehab (7): > em28xx-audio: fix return code on device disconnect > em28xx-audio: simplify error handling > em28xx: Only deallocate struct em28xx after finishing all extensions > em28xx-audio: disconnect before freeing URBs > em28xx-audio: remove a deplock circular dependency > em28xx: print a message at disconnect > em28xx: Fix usb diconnect logic > > drivers/media/usb/em28xx/em28xx-audio.c | 47 ++++++++++++++++++++------------- > drivers/media/usb/em28xx/em28xx-cards.c | 41 +++++++++++++--------------- > drivers/media/usb/em28xx/em28xx-dvb.c | 7 ++++- > drivers/media/usb/em28xx/em28xx-input.c | 10 ++++++- > drivers/media/usb/em28xx/em28xx-video.c | 13 ++++----- > drivers/media/usb/em28xx/em28xx.h | 9 +++++-- > 6 files changed, 76 insertions(+), 51 deletions(-) > Tested-by: Antti Palosaari I tested quite many em28xx devices and it seems to work very well. However, there is that (it looks new) error dump coming after device is unplugged. tammi 13 18:50:56 localhost.localdomain kernel: usb 8-2: USB disconnect, device number 2 tammi 13 18:50:56 localhost.localdomain kernel: em2884 #0: Disconnecting em2884 #0 tammi 13 18:50:56 localhost.localdomain kernel: em2884 #0: Disconnecting video extension tammi 13 18:50:56 localhost.localdomain kernel: em2884 #0: V4L2 device video0 deregistered tammi 13 18:50:56 localhost.localdomain kernel: em2884 #0: Disconnecting audio extension tammi 13 18:50:56 localhost.localdomain kernel: em2884 #0: Disconnecting DVB extension tammi 13 18:50:56 localhost.localdomain kernel: xc5000 6-0061: destroying instance tammi 13 18:50:56 localhost.localdomain kernel: em2884 #0: Disconnecting input extensionINFO: trying to register non-static key. tammi 13 18:50:56 localhost.localdomain kernel: the code is fine but needs lockdep annotation. tammi 13 18:50:56 localhost.localdomain kernel: turning off the locking correctness validator. tammi 13 18:50:56 localhost.localdomain kernel: CPU: 3 PID: 34 Comm: khubd Tainted: G O 3.13.0-rc1+ #79 tammi 13 18:50:56 localhost.localdomain kernel: Hardware name: System manufacturer System Product Name/M5A78L-M/USB3, BIOS 1801 11/12/2013 tammi 13 18:50:56 localhost.localdomain kernel: ffff88030da1a8a0 ffff88030dbb99a8 ffffffff816b8da9 0000000000000002 tammi 13 18:50:56 localhost.localdomain kernel: ffff88030dbb99b8 ffffffff816b285c ffff88030dbb9a28 ffffffff810bb9ae tammi 13 18:50:56 localhost.localdomain kernel: ffffffff810b9bc9 00000007810b648d ffff88030da1a8a0 ffffffff810cbe27 tammi 13 18:50:56 localhost.localdomain kernel: Call Trace: tammi 13 18:50:56 localhost.localdomain kernel: [] dump_stack+0x4d/0x66 tammi 13 18:50:56 localhost.localdomain kernel: [] register_lock_class.part.40+0x38/0x3c tammi 13 18:50:56 localhost.localdomain kernel: [] __lock_acquire+0x9fe/0xc40 tammi 13 18:50:56 localhost.localdomain kernel: [] ? mark_held_locks+0xb9/0x140 tammi 13 18:50:56 localhost.localdomain kernel: [] ? vprintk_emit+0x1d7/0x5e0 tammi 13 18:50:56 localhost.localdomain kernel: [] lock_acquire+0xb0/0x150 tammi 13 18:50:56 localhost.localdomain kernel: [] ? flush_work+0x5/0x60 tammi 13 18:50:56 localhost.localdomain kernel: [] flush_work+0x36/0x60 tammi 13 18:50:56 localhost.localdomain kernel: [] ? flush_work+0x5/0x60 tammi 13 18:50:56 localhost.localdomain kernel: [] __cancel_work_timer+0x8a/0x120 tammi 13 18:50:56 localhost.localdomain kernel: [] cancel_delayed_work_sync+0x13/0x20 tammi 13 18:50:56 localhost.localdomain kernel: [] em28xx_ir_fini+0x48/0xc0 [em28xx_rc] tammi 13 18:50:56 localhost.localdomain kernel: [] em28xx_close_extension+0x3e/0x70 [em28xx] tammi 13 18:50:56 localhost.localdomain kernel: [] em28xx_usb_disconnect+0x60/0x80 [em28xx] tammi 13 18:50:56 localhost.localdomain kernel: [] usb_unbind_interface+0x67/0x1d0 tammi 13 18:50:56 localhost.localdomain kernel: [] __device_release_driver+0x7f/0xf0 tammi 13 18:50:56 localhost.localdomain kernel: [] device_release_driver+0x25/0x40 tammi 13 18:50:56 localhost.localdomain kernel: [] bus_remove_device+0x11c/0x1a0 tammi 13 18:50:56 localhost.localdomain kernel: [] device_del+0x136/0x1d0 tammi 13 18:50:56 localhost.localdomain kernel: [] usb_disable_device+0xb0/0x290 tammi 13 18:50:56 localhost.localdomain kernel: [] usb_disconnect+0xb5/0x1d0 tammi 13 18:50:56 localhost.localdomain kernel: [] hub_port_connect_change+0xd6/0xad0 tammi 13 18:50:56 localhost.localdomain kernel: [] ? usb_control_msg+0xd4/0x110 tammi 13 18:50:56 localhost.localdomain kernel: [] hub_events+0x313/0x9b0 tammi 13 18:50:56 localhost.localdomain kernel: [] hub_thread+0x35/0x190 tammi 13 18:50:56 localhost.localdomain kernel: [] ? abort_exclusive_wait+0xb0/0xb0 tammi 13 18:50:56 localhost.localdomain kernel: [] ? hub_events+0x9b0/0x9b0 tammi 13 18:50:56 localhost.localdomain kernel: [] kthread+0xff/0x120 tammi 13 18:50:56 localhost.localdomain kernel: [] ? kthread_create_on_node+0x250/0x250 tammi 13 18:50:56 localhost.localdomain kernel: [] ret_from_fork+0x7c/0xb0 tammi 13 18:50:56 localhost.localdomain kernel: [] ? kthread_create_on_node+0x250/0x250 tammi 13 18:50:56 localhost.localdomain kernel: em2884 #0: Freeing device regards Antti -- http://palosaari.fi/