lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALprXBaUMR0uxMKeJ8f8+BWHDesfB9CxDquy4Muptf4eppmQdA@mail.gmail.com>
Date:   Sat, 1 Oct 2022 06:30:38 +0800
From:   Ajye Huang <ajye_huang@...pal.corp-partner.google.com>
To:     Luiz Augusto von Dentz <luiz.dentz@...il.com>
Cc:     linux-kernel@...r.kernel.org,
        Marcel Holtmann <marcel@...tmann.org>,
        Johan Hedberg <johan.hedberg@...il.com>,
        "David S . Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        linux-bluetooth@...r.kernel.org, netdev@...r.kernel.org
Subject: Re: [PATCH v1] bluetooth: Fix the bluetooth icon status after running
 hciconfig hci0 up

On Sat, Oct 1, 2022 at 3:57 AM Luiz Augusto von Dentz
<luiz.dentz@...il.com> wrote:
>
> Hi Ajye,
>
> On Fri, Sep 30, 2022 at 7:07 AM Ajye Huang
> <ajye_huang@...pal.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@...pal.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

Hi Luiz

Now, this code you mentioned in hci_dev_open_sync() was moved from
hci_core.c to hci_sync.c
The below modification is workable.
Do you agree?
If so, I will send you the v2 version. Thanks

index 15c75ef4c271..76c3107c9f91 100644
--- a/net/bluetooth/hci_sync.c
+++ b/net/bluetooth/hci_sync.c
@@ -4676,6 +4676,7 @@ int hci_dev_open_sync(struct hci_dev *hdev)
                    hci_dev_test_flag(hdev, HCI_MGMT) &&
                    hdev->dev_type == HCI_PRIMARY) {
                        ret = hci_powered_update_sync(hdev);
+                       mgmt_power_on(hdev, ret);
                }
        } else {
                /* Init failed, cleanup */

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ