Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1341192ybt; Tue, 7 Jul 2020 13:20:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzcmH5s0B3LKD9FWNx0KoS8hbtwfM0xwfdyBAzojW33XmqzNRoZqKCbQXDLSYaU1HfbSY4G X-Received: by 2002:a17:906:1414:: with SMTP id p20mr47871305ejc.247.1594153259399; Tue, 07 Jul 2020 13:20:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594153259; cv=none; d=google.com; s=arc-20160816; b=EOCWsLVMbVp73sd1NKUQHnMN0NyrVEPobWSLn2vS4gxuE5+hr/Zs0pZLpg4sS/lnBi gZgoyoKfwjv9CyxuaYjE0YMnlQOAndyo4gOldKMc9ydL3J5K9VEWyoSNYZ9yloSs8SAy ag0rjlH2PAaOpY9bAbzP0YJCa0lhPXIDU0w0uxIBWU5iDP+3xlGJNRRMZ2odtN35Oj9q Jdz4eIKDyfub4brf4IyxRszC7qkG392ESBcrcPkVk5G0CaoCc8O/EVr+LAZYzsdAc7Vj sobQCzENUnKqgCvBj1mCJ2tNt1WLt9akfIJ4RjHbR0OLjpBoq41l6wVZSnUCkHA6T9Cl QTMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=DAZkdSMy6rGL4HXgiQRy1c3I5dw1ddM0iPQtXxoHahE=; b=jxN1oUy0cYuXtnztN5A4KiVLkN6LBZnrZOcRYNTzKjSZpmRGGRp+y5/H7RrfYMUo9c 0c3EvA1FcoJyeDDglCtHOzjztadEjCl+J7+yuD15Av+CSbaZ07mX7w+gz8GubB5EqttF Lhp8KRMta8pYpXSdnWm9G7coCmMlGoCY4OloUa/lO9u0EYilSMxFCd2564TLNYttnxyn UriDvQwdv32YNxcVLLsBqpfLLrRrM6EIdygIWJpAxn5uABWPzdEuJ/XSJBZRIWpzH5eX d667fLjjS3P9fsJc5B9MfpwLk5TpgFwhNPFkAQH9D9vit0drz4+kiHvhjNH7gHE3nRe7 iERA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dqJod+UN; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k19si15156005ejc.167.2020.07.07.13.20.25; Tue, 07 Jul 2020 13:20:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=dqJod+UN; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728328AbgGGURf (ORCPT + 99 others); Tue, 7 Jul 2020 16:17:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50330 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728280AbgGGURf (ORCPT ); Tue, 7 Jul 2020 16:17:35 -0400 Received: from mail-ua1-x942.google.com (mail-ua1-x942.google.com [IPv6:2607:f8b0:4864:20::942]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3D4EC061755 for ; Tue, 7 Jul 2020 13:17:34 -0700 (PDT) Received: by mail-ua1-x942.google.com with SMTP id n4so2519076uae.5 for ; Tue, 07 Jul 2020 13:17:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DAZkdSMy6rGL4HXgiQRy1c3I5dw1ddM0iPQtXxoHahE=; b=dqJod+UNQhVJ3Fx+S7PWIqRHnDCKbaQ3tsgfsN0vogU2uMBuaiscmPV9zaT6PwrCeU qAXZNqC2zqZjiEgG3civZzp5luib28FwVxrq9EMC1Q0GwO0z2D9bc+LZdQX4BCHsijqf chOiIsZI9WS6vOG6cDudlMjyRPUVh2SNZY8fI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DAZkdSMy6rGL4HXgiQRy1c3I5dw1ddM0iPQtXxoHahE=; b=CoavVwS1V9HlqqFe3dkbQ67JP+wwikz0inR/hQTmrqkMbJwDBbljgzyIZcpvwIoyNX /fOpThyPfxODbesLQlRsrw1O7vp1u9/hbvgKAkAFIXXUCZ9yL9f58w8ZIZkLIzVsPXGU hCu2FnmJ/h3zLB4T1w+LT9jHhHf3Nr0k3XUcGawa7/ursg4+Ncix+NZ1BZ8D7Ddmcjgq inbSez4qrB2yg9BcTMlHVfvfyYbW+g3odEuqIQwovOcF/Uyhd83cRTYnzonZUdPDXvBH MzQ5mowSlxYWzjMYoaq4+Cc0BiR9xhwzbvljIAdL16I4giusp6RhcPEKJTAcyyiEzEaN CKaw== X-Gm-Message-State: AOAM5325cSNpsdIQG3xx7OsAEXs9wlkuvX1eAonv8ZF54Bwljr9qTpOv nUFs5IinkLeP51Zh8/q6ttidqu+6NOuyOLmDF4mvvsjO X-Received: by 2002:ab0:1167:: with SMTP id g39mr21484290uac.60.1594153054128; Tue, 07 Jul 2020 13:17:34 -0700 (PDT) MIME-Version: 1.0 References: <20200706202518.1153647-1-abhishekpandit@chromium.org> In-Reply-To: From: Abhishek Pandit-Subedi Date: Tue, 7 Jul 2020 13:17:23 -0700 Message-ID: Subject: Re: [BlueZ PATCH v7 0/6] device: Allow devices to be marked as wake capable To: Luiz Augusto von Dentz Cc: "linux-bluetooth@vger.kernel.org" , Alain Michaud , Marcel Holtmann , ChromeOS Bluetooth Upstreaming Content-Type: text/plain; charset="UTF-8" Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Thanks Luiz. On Tue, Jul 7, 2020 at 10:50 AM Luiz Augusto von Dentz wrote: > > Hi Abhishek, > > On Mon, Jul 6, 2020 at 1:25 PM Abhishek Pandit-Subedi > wrote: > > > > > > Hi Luiz, > > > > This change accompanies a change in the kernel to allow marking devices > > as wakeable so they can wake the system from suspend. Currently, only > > HID devices support this and will be configured to allow this setting to > > be changed via the WakeAllowed property. > > > > Accompanying kernel change: https://patchwork.kernel.org/patch/11609999/ > > > > In order to set this flag, Bluez must call Set Device Flags with the > > Remote Wakeup bit set. This change was tested with the accompanying > > kernel changes on v5.4 with both manual tests and automated tests. > > > > Here's the tests that I ran manually: > > - Pair new HID device and confirm it has Wake Allowed to True > > (default). Verify device can be woken from suspend with device. > > - Restart bluetoothd, confirm Device Flags Changed event after Add > > Device has no Remote Wakeup flag and Set Device Flags is called > > afterwards to restore it. Verify wake from suspend still works. > > - Disable Wake allowed via dbus and confirm wake from suspend no > > longer works. > > - Restart bluetoothd and confirm Wake Allowed is still false. Verify > > wake from suspend does not work. > > > > Thanks > > Abhishek > > > > Changes in v7: > > * Fix more build issues reported by bluez.test.bot > > > > Changes in v6: > > * Fix up some build issues reported by bluez.test.bot > > * Save pending property id and emit success only after set flags returns > > * Ignore multiple calls to set_wake_allowed to the same value > > * Emit property error busy if same value is already sent to mgmt > > * Fix up build issues reported by bluez.test.bot > > > > Changes in v5: > > - Use device_flags mgmt op > > * Decode device flags > > * Refactor to use set_wake_flags and respond to device flags changed > > * Add wake_override so we can keep track of user/profile configuration > > vs what is currently active > > * Only call device_set_wake_support > > > > Changes in v4: > > * Renamed wake_capable to wake_allowed > > * Removed set_wake_capable mgmt op and updated add_device to accept > > flags to set whether a device is wakeable > > * Refactored adapter_whitelist_add and adapter_auto_connect_add to call > > adapter_add_device > > * Renamed WakeCapable to WakeAllowed > > * Renamed WakeCapable to WakeAllowed > > * Renamed device_set_profile_wake_support to just > > device_set_wake_support > > > > Changes in v3: > > * Added profile_wake_support and made wake_capable dependent on it > > * Added documentation for WakeCapable > > * Mark HID device to support wake from suspend > > > > Changes in v2: > > * Added dbus api "WakeCapable" to set value > > * Update device_set_wake_capable to be called by > > adapter_set_wake_capable_complete so we can emit property changed > > * Newly added to show whether device is wake capable > > * Removed automatically setting wake capable for HID devices > > > > Abhishek Pandit-Subedi (6): > > mgmt: Add mgmt op and events for device flags > > monitor: Decode device flags mgmt ops and event > > device: Support marking a device with wake allowed > > client: Display wake allowed property with info > > doc/device-api: Add WakeAllowed > > input: Make HID devices support wake > > > > client/main.c | 1 + > > doc/device-api.txt | 5 + > > lib/mgmt.h | 33 +++++++ > > monitor/packet.c | 70 ++++++++++++++ > > profiles/input/device.c | 1 + > > profiles/input/hog.c | 1 + > > src/adapter.c | 93 ++++++++++++++++++ > > src/adapter.h | 3 +- > > src/device.c | 210 ++++++++++++++++++++++++++++++++++++++++ > > src/device.h | 10 ++ > > 10 files changed, 426 insertions(+), 1 deletion(-) > > > > -- > > 2.27.0.212.ge8ba1cc988-goog > > Applied, thanks. > > -- > Luiz Augusto von Dentz