All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH BlueZ] policy: Change AutoEnable default to true
Date: Tue, 19 Apr 2022 10:52:15 -0700	[thread overview]
Message-ID: <CABBYNZKt+rT5nR2yJeGOTa8wOK84qCVE-6C8X3rQPdqWxBfYmQ@mail.gmail.com> (raw)
In-Reply-To: <61417C2F-0009-4123-8F1C-DACC4A46073D@holtmann.org>

Hi Marcel,

On Tue, Apr 19, 2022 at 1:48 AM Marcel Holtmann <marcel@holtmann.org> wrote:
>
> Hi Luiz,
>
> > This changes the default of AutoEnable to true so controllers are power
> > up by default.
> >
> > Fixes: https://github.com/bluez/bluez/issues/328
> > ---
> > plugins/policy.c | 6 +++++-
> > src/main.conf    | 4 ++--
> > 2 files changed, 7 insertions(+), 3 deletions(-)
> >
> > diff --git a/plugins/policy.c b/plugins/policy.c
> > index 48f5db7d3..0bbdbfc88 100644
> > --- a/plugins/policy.c
> > +++ b/plugins/policy.c
> > @@ -892,7 +892,11 @@ static int policy_init(void)
> >       }
> >
> >       auto_enable = g_key_file_get_boolean(conf, "Policy", "AutoEnable",
> > -                                                                     NULL);
> > +                                                             &gerr);
> > +     if (gerr) {
> > +             g_clear_error(&gerr);
> > +             auto_enable = true;
> > +     }
> >
> >       resume_delay = g_key_file_get_integer(
> >                       conf, "Policy", "ResumeDelay", &gerr);
> > diff --git a/src/main.conf b/src/main.conf
> > index 401796235..91b98b8c4 100644
> > --- a/src/main.conf
> > +++ b/src/main.conf
> > @@ -276,8 +276,8 @@
> >
> > # AutoEnable defines option to enable all controllers when they are found.
> > # This includes adapters present on start as well as adapters that are plugged
> > -# in later on. Defaults to 'false'.
> > -#AutoEnable=false
> > +# in later on. Defaults to 'true'.
> > +#AutoEnable=true
>
> so this is problematic since all wireless technology daemon where design to not automatically activate their hardware. It needed a system above like ConnMan, NetworkManager or even the UI to start the operation.
>
> It is especially tricky since bluetoothd doesn’t remember the last state. So if you power off, then restart, it is on again the next time around. Not something you might have wanted. Using false here is the right choice as a default.
>
> If you install systemd-rfkill and want to auto-power once soft-rfkill is released and systemd-rfkill remembers the state persistently, then you need to install your main.conf with AutoEnable=true. That is a distro choice.

The argument was that nowadays most systems ship with systemd-rfkill
so having AutoEnable=true is much more common than the old default,
perhaps we could detect if the system has systemd-rfkill than we
default to AutoEnable=true automatically, does this sound better to
you?

> Regards
>
> Marcel
>


-- 
Luiz Augusto von Dentz

      reply	other threads:[~2022-04-19 17:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13 22:24 [PATCH BlueZ] policy: Change AutoEnable default to true Luiz Augusto von Dentz
2022-04-15  6:45 ` [BlueZ] " bluez.test.bot
2022-04-19  0:00 ` [PATCH BlueZ] " patchwork-bot+bluetooth
2022-04-19  8:48 ` Marcel Holtmann
2022-04-19 17:52   ` Luiz Augusto von Dentz [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=CABBYNZKt+rT5nR2yJeGOTa8wOK84qCVE-6C8X3rQPdqWxBfYmQ@mail.gmail.com \
    --to=luiz.dentz@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.