From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752193AbdJ3IFJ convert rfc822-to-8bit (ORCPT ); Mon, 30 Oct 2017 04:05:09 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:54225 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752136AbdJ3IFG (ORCPT ); Mon, 30 Oct 2017 04:05:06 -0400 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.0 \(3445.1.7\)) Subject: Re: [PATCH] Bluetooth: avoid recursive locking in hci_send_to_channel() From: Marcel Holtmann In-Reply-To: <20170921135123.rgzacdgfonqftlu7@linutronix.de> Date: Mon, 30 Oct 2017 09:05:02 +0100 Cc: Mart van de Wege , Johan Hedberg , "Gustavo F. Padovan" , "open list:BLUETOOTH DRIVERS" , Linux Kernel Mailing List , linux-rt-users@vger.kernel.org, Thomas Gleixner , Peter Zijlstra Content-Transfer-Encoding: 8BIT Message-Id: <19282780-42CE-43C9-928E-73F4135D359A@holtmann.org> References: <86val4928u.fsf@gaheris.avalon.lan> <20170831145211.xlu6cvocqdkzevsl@linutronix.de> <20170921135123.rgzacdgfonqftlu7@linutronix.de> To: Sebastian Andrzej Siewior X-Mailer: Apple Mail (2.3445.1.7) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sebastian, > Mart reported a deadlock in -RT in the call path: > hci_send_monitor_ctrl_event() -> hci_send_to_channel() > > because both functions acquire the same read lock hci_sk_list.lock. This > is also a mainline issue because the qrwlock implementation is writer > fair (the traditional rwlock implementation is reader biased). > > To avoid the deadlock there is now __hci_send_to_channel() which expects > the readlock to be held. > > Cc: Marcel Holtmann > Cc: Johan Hedberg > Fixes: 38ceaa00d02d ("Bluetooth: Add support for sending MGMT commands and events to monitor") > Reported-by: Mart van de Wege > Signed-off-by: Sebastian Andrzej Siewior > --- > net/bluetooth/hci_sock.c | 17 +++++++++++------ > 1 file changed, 11 insertions(+), 6 deletions(-) patch has been applied to bluetooth-next tree. Regards Marcel