From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Mon, 3 Sep 2012 15:34:11 +0300 From: Andrei Emeltchenko To: Gustavo Padovan , Szymon Janc , linux-bluetooth@vger.kernel.org Subject: Re: [PATCH] Bluetooth: Use GFP_KERNEL in read_index_list Message-ID: <20120903123404.GA2789@aemeltch-MOBL1> References: <1346396746-3479-1-git-send-email-szymon.janc@tieto.com> <20120831175458.GA5599@joana> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: <20120831175458.GA5599@joana> Sender: linux-bluetooth-owner@vger.kernel.org List-ID: Hi all, On Fri, Aug 31, 2012 at 10:54:58AM -0700, Gustavo Padovan wrote: > Hi Szymon, > > * Szymon Janc [2012-08-31 09:05:46 +0200]: > > > read_index_list is executed by user thread running in kernel-mode > > thus is allowed to sleep. > > > > Signed-off-by: Szymon Janc > > --- > > net/bluetooth/mgmt.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > Patch has been applied to bluetooth-next. Thanks. Was this tested? Gustavo please remove this patch from the tree untill this issue is fixed. [ 141.009142] BUG: sleeping function called from invalid context at mm/slub.c:943 [ 141.009156] in_atomic(): 1, irqs_disabled(): 0, pid: 2476, name: bluetoothd [ 141.009159] 2 locks held by bluetoothd/2476: [ 141.009161] #0: (sk_lock-AF_BLUETOOTH-BTPROTO_HCI){+.+.+.}, at: [] hci_sock_sendmsg+0x5a/0x310 [bluetooth] [ 141.009182] #1: (hci_dev_list_lock){++++.+}, at: [] read_index_list+0x2e/0x150 [bluetooth] [ 141.009200] Pid: 2476, comm: bluetoothd Tainted: G O 3.5.0+ #56 [ 141.009202] Call Trace: [ 141.009208] [] __might_sleep+0xe9/0x120 [ 141.009213] [] __kmalloc+0x1a9/0x240 [ 141.009224] [] ? read_index_list+0x64/0x150 [bluetooth] [ 141.009234] [] read_index_list+0x64/0x150 [bluetooth] [ 141.009244] [] mgmt_control+0x22c/0x350 [bluetooth] [ 141.009248] [] ? trace_hardirqs_on+0xb/0x10 [ 141.009252] [] ? local_bh_enable+0x68/0xd0 [ 141.009264] [] ? hci_sock_sendmsg+0x5a/0x310 [bluetooth] [ 141.009297] [] hci_sock_sendmsg+0xc3/0x310 [bluetooth] [ 141.009302] [] ? sock_update_classid+0x7d/0x120 [ 141.009306] [] ? sock_update_classid+0xa8/0x120 [ 141.009311] [] sock_aio_write+0xfb/0x120 [ 141.009315] [] ? sys_sendto+0x10e/0x150 [ 141.009320] [] do_sync_write+0xb4/0xf0 [ 141.009326] [] ? might_fault+0x50/0xa0 [ 141.009330] [] ? rw_verify_area+0x6c/0x120 [ 141.009334] [] vfs_write+0x151/0x160 [ 141.009337] [] ? sys_socketcall+0x182/0x2e0 [ 141.009341] [] sys_write+0x3d/0x70 [ 141.009345] [] sysenter_do_call+0x12/0x38 Best regards Andrei Emeltchenko