linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marcel Holtmann <marcel@holtmann.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: kbuild test robot <lkp@intel.com>,
	"open list:BLUETOOTH DRIVERS" <linux-bluetooth@vger.kernel.org>,
	kbuild-all@lists.01.org, Johan Hedberg <johan.hedberg@gmail.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	"Luis Claudio R . Goncalves" <lclaudio@uudg.org>
Subject: Re: [PATCH v2] Bluetooth: Acquire sk_lock.slock without disabling interrupts
Date: Fri, 29 May 2020 13:50:03 +0200	[thread overview]
Message-ID: <C6CE8EBA-73DC-4A8A-9BD2-BC13BBDEC24A@holtmann.org> (raw)
In-Reply-To: <20200528123512.o32lkytxjdpwzi7r@linutronix.de>

Hi Sebastian,

> There was a lockdep which led to commit
>   fad003b6c8e3d ("Bluetooth: Fix inconsistent lock state with RFCOMM")
> 
> Lockdep noticed that `sk->sk_lock.slock' was acquired without disabling
> the softirq while the lock was also used in softirq context.
> Unfortunately the solution back then was to disable interrupts before
> acquiring the lock which however made lockdep happy.
> It would have been enough to simply disable the softirq. Disabling
> interrupts before acquiring a spinlock_t is not allowed on PREEMPT_RT
> because these locks are converted to 'sleeping' spinlocks.
> 
> Use spin_lock_bh() in order to acquire the `sk_lock.slock'.
> 
> Reported-by: Luis Claudio R. Goncalves <lclaudio@uudg.org>
> Reported-by: kbuild test robot <lkp@intel.com> [missing unlock]
> Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> ---
> 
> v1…v2: Unlock on the way out as reported by the lkp bot.
> 
> net/bluetooth/rfcomm/sock.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)

patch has been applied to bluetooth-next tree.

Regards

Marcel


      reply	other threads:[~2020-05-29 11:50 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 19:39 [PATCH] Bluetooth: Acquire sk_lock.slock without disabling interrupts Sebastian Andrzej Siewior
2020-05-28  7:11 ` kbuild test robot
2020-05-28 12:35   ` [PATCH v2] " Sebastian Andrzej Siewior
2020-05-29 11:50     ` Marcel Holtmann [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=C6CE8EBA-73DC-4A8A-9BD2-BC13BBDEC24A@holtmann.org \
    --to=marcel@holtmann.org \
    --cc=bigeasy@linutronix.de \
    --cc=johan.hedberg@gmail.com \
    --cc=kbuild-all@lists.01.org \
    --cc=lclaudio@uudg.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).