All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: clancy_shang@163.com
Cc: marcel@holtmann.org, johan.hedberg@gmail.com,
	 linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org,
	 zhongjun.yu@quectel.com, Clancy Shang <clancy.shang@quectel.com>
Subject: Re: [PATCH] Bluetooth: hci_sync: fix hogp device suspend bug
Date: Tue, 26 Dec 2023 10:40:07 -0500	[thread overview]
Message-ID: <CABBYNZJQFD_=VcFZxK=AugixVMgc=Zw4WPgQn+ax28cNGWBGUQ@mail.gmail.com> (raw)
In-Reply-To: <20231226060818.2446327-1-clancy_shang@163.com>

Hi Clancy,

On Tue, Dec 26, 2023 at 1:09 AM <clancy_shang@163.com> wrote:
>
> From: Clancy Shang <clancy.shang@quectel.com>
>
> when Bluetooth enters suspend, and disconnects everything with the
> disconnect reason code of 0x15, the hogp device could not into sleep
> and continued advertising. when use the disconnect reason code of 0x13,
> the hogp device going into sleep succeeded.
>
> Signed-off-by: Clancy Shang <clancy.shang@quectel.com>
> ---
>  net/bluetooth/hci_sync.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c
> index d85a7091a116..16b5420c32d0 100644
> --- a/net/bluetooth/hci_sync.c
> +++ b/net/bluetooth/hci_sync.c
> @@ -5927,7 +5927,7 @@ int hci_suspend_sync(struct hci_dev *hdev)
>
>         if (hci_conn_count(hdev)) {
>                 /* Soft disconnect everything (power off) */
> -               err = hci_disconnect_all_sync(hdev, HCI_ERROR_REMOTE_POWER_OFF);
> +               err = hci_disconnect_all_sync(hdev, HCI_ERROR_REMOTE_USER_TERM);

So the device interpretes that it can reconnect on power off but not
on user termination error? And you think changing the error would make
this interoperate any better? Afaik user termination can be generated
by various reasons, including the non-clean termination ones, while
power off error is quite clear on the reason, so instead of using a
more generic error you probably should contact the device manufacturer
and have it fix this problem and until then Id probably disable wakeup
support since it doesn't behave properly when receiving
HCI_ERROR_REMOTE_POWER_OFF.

>                 if (err) {
>                         /* Set state to BT_RUNNING so resume doesn't notify */
>                         hdev->suspend_state = BT_RUNNING;
> --
> 2.25.1
>
>


-- 
Luiz Augusto von Dentz

  parent reply	other threads:[~2023-12-26 15:40 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-26  6:08 [PATCH] Bluetooth: hci_sync: fix hogp device suspend bug clancy_shang
2023-12-26  6:35 ` bluez.test.bot
2023-12-26 15:40 ` Luiz Augusto von Dentz [this message]
     [not found]   ` <6358e9a9.6c6.18ca8e3e1cf.Coremail.clancy_shang@163.com>
2023-12-27 16:47     ` Re: [PATCH] " Luiz Augusto von Dentz
  -- strict thread matches above, loose matches on Subject: below --
2024-01-03 10:12 clancy_shang
2024-01-03 15:55 ` Luiz Augusto von Dentz
2023-12-21  7:16 15013537245
2023-12-21  9:05 ` Paul Menzel

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='CABBYNZJQFD_=VcFZxK=AugixVMgc=Zw4WPgQn+ax28cNGWBGUQ@mail.gmail.com' \
    --to=luiz.dentz@gmail.com \
    --cc=clancy.shang@quectel.com \
    --cc=clancy_shang@163.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=zhongjun.yu@quectel.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 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.