All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: Daniel Drake <dsd@laptop.org>
Cc: marcel@holtmann.org, bzhao@marvell.com, johan.hedberg@gmail.com,
	linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Bluetooth: btmrvl: fix thread stopping race
Date: Thu, 13 Jun 2013 11:32:47 +0100	[thread overview]
Message-ID: <20130613103247.GB16835@joana> (raw)
In-Reply-To: <20130611194020.9EFBEFAACD@dev.laptop.org>

Hi Daniel,

* Daniel Drake <dsd@laptop.org> [2013-06-11 15:40:20 -0400]:

> There is currently a race condition in the btmrvl_remove_card() which
> is causing hangs on suspend for OLPC. When the race occurs,
> kthread_stop() never returns.
> 
> The problem is that btmrvl_service_main_thread() calls kthread_should_stop()
> and then does a fair number of things before restarting the loop and
> sleeping.
> 
> If the thread gets stopped after kthread_should_stop() is checked, but
> before the sleep happens, the thread will go to sleep and won't necessarily
> be woken up.
> 
> Move the kthread_should_stop() check into a race-free place.
> 
> Signed-off-by: Daniel Drake <dsd@laptop.org>
> ---
>  drivers/bluetooth/btmrvl_main.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)

Patch has been applied to bluetooth.git. Thanks.

	Gustavo

      reply	other threads:[~2013-06-13 10:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-11 19:40 [PATCH] Bluetooth: btmrvl: fix thread stopping race Daniel Drake
2013-06-13 10:32 ` Gustavo Padovan [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=20130613103247.GB16835@joana \
    --to=gustavo@padovan.org \
    --cc=bzhao@marvell.com \
    --cc=dsd@laptop.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=marcel@holtmann.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.