From: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 2/2] Bluetooth: Power the device up after a rfkill unblock
Date: Fri, 24 Aug 2012 10:32:25 -0300 [thread overview]
Message-ID: <20120824133225.GA7128@echo> (raw)
In-Reply-To: <20120824122800.GA27292@x220.ger.corp.intel.com>
Hi Johan,
On 15:28 Fri 24 Aug, Johan Hedberg wrote:
> Hi Vinicius,
>
> On Wed, Aug 22, 2012, Vinicius Costa Gomes wrote:
> > With the HCI_SETUP patches, this is all that is needed to make the
> > case when a adapter is added with Bluetooth blocked in rfkill to work.
> >
> > When rfkill is unblocked, the device will be powered on, and if not
> > needed it will be automatically powered off.
> >
> > Signed-off-by: Vinicius Costa Gomes <vinicius.gomes@openbossa.org>
> > ---
> > net/bluetooth/hci_core.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> > index fa974a1..395dcc6 100644
> > --- a/net/bluetooth/hci_core.c
> > +++ b/net/bluetooth/hci_core.c
> > @@ -1061,8 +1061,10 @@ static int hci_rfkill_set_block(void *data, bool blocked)
> >
> > BT_DBG("%p name %s blocked %d", hdev, hdev->name, blocked);
> >
> > - if (!blocked)
> > + if (!blocked) {
> > + schedule_work(&hdev->power_on);
>
> Don't you need to check for HCI_SETUP before calling schedule_work here?
> It should be possible to have an adapter powered off and toggling rfkill
> back and forth shouldn't cause it to be powered on.
Most probably. Nice catch. Thanks.
I am going to try it and see if it doesn't have any unexpected side effects.
Cheers,
--
Vinicius
next prev parent reply other threads:[~2012-08-24 13:32 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-22 19:33 [PATCH 1/2] Bluetooth: mgmt: Fix sending events with uninitialized data Vinicius Costa Gomes
2012-08-22 19:33 ` [PATCH 2/2] Bluetooth: Power the device up after a rfkill unblock Vinicius Costa Gomes
2012-08-24 12:28 ` Johan Hedberg
2012-08-24 13:32 ` Vinicius Costa Gomes [this message]
2012-08-24 19:58 ` [PATCH] " Vinicius Costa Gomes
2012-08-26 7:28 ` Johan Hedberg
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=20120824133225.GA7128@echo \
--to=vinicius.gomes@openbossa.org \
--cc=linux-bluetooth@vger.kernel.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.