Linux bluetooth development
 help / color / mirror / Atom feed
From: Dylan MacKenzie <ecstaticmorse@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Dylan MacKenzie <ecstaticmorse@gmail.com>
Subject: [PATCH BlueZ 0/2] input: Do not re-page HID devices that disconnected on purpose
Date: Sat, 21 Nov 2026 12:58:33 -0800	[thread overview]
Message-ID: <20261121205835.381239-1-ecstaticmorse@gmail.com> (raw)

The input plugin re-pages a HID device after its connection is closed
even when the link was terminated on purpose, which takes devices that
can be bonded to several hosts, e.g. earbuds, away from the host they
just switched to. Details are in patch 2.

Patch 1 keeps the reason of the last disconnection in the per-bearer
state of the device, patch 2 uses it to skip the reconnection when the
link was terminated by the remote device or by the local host. Link
loss keeps being handled as before.

One behaviour change to be aware of: the kernel reports Remote Device
Terminated Connection due to Power Off (0x15) as
MGMT_DEV_DISCONN_REMOTE as well, so a device with ReconnectMode "host"
that announces it is powering off is no longer paged if it comes back
within 3 minutes.

Tested with Pixel Buds Pro 2 (ReconnectMode "any") on top of 5.87.

Dylan MacKenzie (2):
  device: Add btd_device_get_disconnect_reason
  input/device: Only auto-reconnect on link loss

 profiles/input/device.c | 18 ++++++++++++++++++
 src/device.c            |  7 +++++++
 src/device.h            |  1 +
 3 files changed, 26 insertions(+)

-- 
2.56.0


             reply	other threads:[~2026-11-21 20:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-21 20:58 Dylan MacKenzie [this message]
2026-11-21 20:58 ` [PATCH BlueZ 1/2] device: Add btd_device_get_disconnect_reason Dylan MacKenzie
2026-11-21 23:18   ` input: Do not re-page HID devices that disconnected on purpose bluez.test.bot
2026-11-21 20:58 ` [PATCH BlueZ 2/2] input/device: Only auto-reconnect on link loss Dylan MacKenzie

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=20261121205835.381239-1-ecstaticmorse@gmail.com \
    --to=ecstaticmorse@gmail.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox