From: Matthew Schwartz <matthew.schwartz@linux.dev>
To: linux-bluetooth@vger.kernel.org
Cc: Matthew Schwartz <matthew.schwartz@linux.dev>
Subject: [PATCH BlueZ 2/3] device: Hide WakeAllowed when adapter cannot wake
Date: Sat, 25 Jul 2026 13:18:55 -0700 [thread overview]
Message-ID: <20260725201856.2142333-3-matthew.schwartz@linux.dev> (raw)
In-Reply-To: <20260725201856.2142333-1-matthew.schwartz@linux.dev>
dev_property_wake_allowed_exist() only checks whether the device has a
profile that supports wake configuration (HID/HoG), so WakeAllowed is
exposed on every input device even when the host controller cannot or
will not wake the system.
Gate the property on btd_adapter_may_wake() as well. The remote
wakeup device flag itself remains settable through mgmt and is still
stored. The kernel independently ignores it during suspend when the
controller may not wake the host, and the stored preference reapplies
once wakeup is enabled again. No PropertiesChanged signal is emitted
when the sysfs attribute changes, so clients observe the state that
is current at the time they query the property.
Assisted-by: Claude:claude-fable-5
---
src/device.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/device.c b/src/device.c
index 65d84be56..697baf628 100644
--- a/src/device.c
+++ b/src/device.c
@@ -1839,7 +1839,10 @@ static gboolean dev_property_wake_allowed_exist(
{
struct btd_device *device = data;
- return device_get_wake_support(device);
+ if (!device_get_wake_support(device))
+ return FALSE;
+
+ return btd_adapter_may_wake(device->adapter);
}
static void append_set(void *data, void *user_data)
--
2.55.0
next prev parent reply other threads:[~2026-07-25 20:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-25 20:18 [PATCH BlueZ 0/3] Hide WakeAllowed when the adapter cannot wake the host Matthew Schwartz
2026-07-25 20:18 ` [PATCH BlueZ 1/3] adapter: Add btd_adapter_may_wake() Matthew Schwartz
2026-07-25 21:19 ` Hide WakeAllowed when the adapter cannot wake the host bluez.test.bot
2026-07-25 20:18 ` Matthew Schwartz [this message]
2026-07-25 20:18 ` [PATCH BlueZ 3/3] doc: Mark WakeAllowed as optional Matthew Schwartz
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=20260725201856.2142333-3-matthew.schwartz@linux.dev \
--to=matthew.schwartz@linux.dev \
--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