linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
Cc: linux-kernel@vger.kernel.org,
	Marcel Holtmann <marcel@holtmann.org>,
	Johan Hedberg <johan.hedberg@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v1] bluetooth: Fix the bluetooth icon status after running hciconfig hci0 up
Date: Fri, 30 Sep 2022 12:57:10 -0700	[thread overview]
Message-ID: <CABBYNZJZcgQ+VsPu68-14=EQGxxZ1VpHth37uO_NnGm+SsOnbw@mail.gmail.com> (raw)
In-Reply-To: <20220930140655.2723164-1-ajye_huang@compal.corp-partner.google.com>

Hi Ajye,

On Fri, Sep 30, 2022 at 7:07 AM Ajye Huang
<ajye_huang@compal.corp-partner.google.com> wrote:
>
> When "hciconfig hci0 up" command is used to bluetooth ON, but
> the bluetooth UI icon in settings still not be turned ON.
>
> Refer to commit 2ff13894cfb8 ("Bluetooth: Perform HCI update for power on synchronously")
> Add back mgmt_power_on(hdev, ret) into function hci_dev_do_open(struct hci_dev *hdev)
> in hci_core.c
>
> Signed-off-by: Ajye Huang <ajye_huang@compal.corp-partner.google.com>
> ---
>  net/bluetooth/hci_core.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
> index 0540555b3704..5061845c8fc2 100644
> --- a/net/bluetooth/hci_core.c
> +++ b/net/bluetooth/hci_core.c
> @@ -481,6 +481,7 @@ static int hci_dev_do_open(struct hci_dev *hdev)
>         hci_req_sync_lock(hdev);
>
>         ret = hci_dev_open_sync(hdev);
> +       mgmt_power_on(hdev, ret);
>
>         hci_req_sync_unlock(hdev);
>         return ret;
> --
> 2.25.1


I believe the culprit is actually the following change:

git show cf75ad8b41d2a:

@@ -1489,8 +1488,7 @@ static int hci_dev_do_open(struct hci_dev *hdev)
                    !hci_dev_test_flag(hdev, HCI_USER_CHANNEL) &&
                    hci_dev_test_flag(hdev, HCI_MGMT) &&
                    hdev->dev_type == HCI_PRIMARY) {
-                       ret = __hci_req_hci_power_on(hdev);
-                       mgmt_power_on(hdev, ret);
+                       ret = hci_powered_update_sync(hdev);

So we should probably restore mgmt_power_on above.

-- 
Luiz Augusto von Dentz

  parent reply	other threads:[~2022-09-30 19:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-30 14:06 [PATCH v1] bluetooth: Fix the bluetooth icon status after running hciconfig hci0 up Ajye Huang
2022-09-30 14:44 ` [v1] " bluez.test.bot
2022-09-30 19:57 ` Luiz Augusto von Dentz [this message]
2022-09-30 22:30   ` [PATCH v1] " Ajye Huang
2022-09-30 22:58     ` Luiz Augusto von Dentz

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='CABBYNZJZcgQ+VsPu68-14=EQGxxZ1VpHth37uO_NnGm+SsOnbw@mail.gmail.com' \
    --to=luiz.dentz@gmail.com \
    --cc=ajye_huang@compal.corp-partner.google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=johan.hedberg@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /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).