From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: MIME-Version: 1.0 In-Reply-To: <4B4C3BCF.8030501@xenontk.org> References: <4B4C3BCF.8030501@xenontk.org> Date: Tue, 12 Jan 2010 13:58:26 +0200 Message-ID: <2d5a2c101001120358g6f2a320cm358c71d910933296@mail.gmail.com> Subject: Re: BUG: Commit 9e726b17 (Bluetooth: Fix rejected connection not disconnecting ACL link) causes trace From: Luiz Augusto von Dentz To: davidjon@xenontk.org Cc: marcel@holtmann.org, linux-bluetooth@vger.kernel.org Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi, On Tue, Jan 12, 2010 at 11:07 AM, David John wrote: > Hi, > > The commit 9e726b17 (Bluetooth: Fix rejected connection not > disconnecting ACL link) causes the following trace: > > BUG: sleeping function called from invalid context at net/core/sock.c:1897 > in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper > Pid: 0, comm: swapper Tainted: P           2.6.32 #31 > Call Trace: >    [] __might_sleep+0xf8/0xfa >  [] lock_sock_nested+0x29/0xc4 >  [] lock_sock+0xb/0xd [l2cap] >  [] l2cap_sock_shutdown+0x1c/0x76 [l2cap] >  [] ? clockevents_program_event+0x75/0x7e >  [] ? tick_dev_program_event+0x37/0xa5 >  [] l2cap_sock_release+0x27/0x67 [l2cap] >  [] sock_release+0x1a/0x67 >  [] rfcomm_session_del+0x34/0x53 [rfcomm] >  [] rfcomm_session_put+0x14/0x16 [rfcomm] >  [] rfcomm_session_timeout+0xe/0x1a [rfcomm] >  [] run_timer_softirq+0x1e2/0x29a >  [] ? rfcomm_session_timeout+0x0/0x1a [rfcomm] >  [] __do_softirq+0xfe/0x1c5 >  [] ? timer_interrupt+0x1a/0x21 >  [] call_softirq+0x1c/0x28 >  [] do_softirq+0x33/0x6b >  [] irq_exit+0x36/0x85 >  [] do_IRQ+0xa6/0xbd >  [] ret_from_intr+0x0/0xa >    [] ? acpi_idle_enter_bm+0x269/0x294 >  [] ? acpi_idle_enter_bm+0x25f/0x294 >  [] ? cpuidle_idle_call+0x97/0x107 >  [] ? cpu_idle+0x53/0xaa >  [] ? rest_init+0x7a/0x7c >  [] ? start_kernel+0x389/0x394 >  [] ? x86_64_start_reservations+0xac/0xb0 >  [] ? x86_64_start_kernel+0xe4/0xeb > > since lock_sock is called from the timer function rfcomm_session_timeout. So it is not possible while in timer context? I guess not. @Marcel: Any idea how we can possibly fix this? iirc we do a similar thing for rfcomm_dlc_timeout, but that doesn't cause a sleep so I guess we need a different approach for rfcomm_session_timeout. -- Luiz Augusto von Dentz Engenheiro de Computação