Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1245724ybt; Tue, 7 Jul 2020 10:53:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzytjlZA4Tv5JXiHPiNHeuCEyi/doXPwNzRs1J4W03xGdEis9C2EyvB11ebj5OG5VoTBtGO X-Received: by 2002:a17:906:2cd5:: with SMTP id r21mr46841552ejr.20.1594144410679; Tue, 07 Jul 2020 10:53:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594144410; cv=none; d=google.com; s=arc-20160816; b=NqPPUuWOlZLaoxLVWvrNisMTl/IyQ6jPsPZtu5pmkKYzNkcat5wrSOKC7ulMplItJE PpXV/kncQS57zd2j7r9DTAc4pcQX00MmGcFbgYmP3JCeMCnhOA1J5mkRiv3D9IVmYtn2 1xCVq7WJy4vC8VJTH71qzkTix2hQgmGKGYKl3/ilDJVc5YknZCcSwoGOvKz2WSWA3vsm nRuaS/cGHWGaawVoPHV9PXnMf+xXnGf22zcrib+seurJtp2e44my5TJONtWyjzRs6cv1 isWcDqYrbnlf5mkbCL3iACjCn2gQx9mvV4+HFnrkNiXp9asrwBPmOp3/iJ236dRkVWlI NkWg== 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=AjJzSpH+6PSgjm7K9Fmcq3Du4iGdtClqyugjGVFCgYE=; b=TJElZGOXm0ESEOQ2ET/gMFx2H5N+SSmtbpUV7RXViVClBXk9kRRIgOHTFmjSIMQvh7 xGWsnC6700tuHBHLnaXe7Cu6yOaKwpoPbKHxsbeU6vRtuH6HxUEzUYE7dsnKgrnC+aaU 6s71hxtLrF+NXSPCbHtuevJFDVWGKSNiqaHDfRW7V0d8hEQPK2kUaq9Ws8wVF0QM4sjL cAnY9lZgJa5RvbBtKbUR0Z2F+iT3fksXl/U0w4tWZT53azVXKUpyO+JrvWT5dupf8czI ddZEXpvF/AyrhZwf0vh9XVPMih/1sxXliiA5l9e0mMCOrVFLKbxghFB4ZojNzFB/mfuF KrCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dIdBr80o; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d21si18324456edj.417.2020.07.07.10.53.06; Tue, 07 Jul 2020 10:53:30 -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=@gmail.com header.s=20161025 header.b=dIdBr80o; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728663AbgGGRu7 (ORCPT + 99 others); Tue, 7 Jul 2020 13:50:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728211AbgGGRu6 (ORCPT ); Tue, 7 Jul 2020 13:50:58 -0400 Received: from mail-oo1-xc42.google.com (mail-oo1-xc42.google.com [IPv6:2607:f8b0:4864:20::c42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A16B3C061755 for ; Tue, 7 Jul 2020 10:50:58 -0700 (PDT) Received: by mail-oo1-xc42.google.com with SMTP id s190so4767002ooa.13 for ; Tue, 07 Jul 2020 10:50:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AjJzSpH+6PSgjm7K9Fmcq3Du4iGdtClqyugjGVFCgYE=; b=dIdBr80o69ULkmGHD/noIM9/vWDvLeQcc7bXpGZoIlEzn8yAGECqovUxUNgQyn/mMf 6dc5WtZihvq2SlAhnvKc6xOu7Q4Qy3JHSAMHPnPdCJN/IGXQyY9f1aJkHyH46rJ7DqL+ jEUHGZ2Vf/qrFpTQhG+iKqodsBGJKhIxo1T4lM/mfz9RNMpqNLPmOI8zPHVOnqjz248M PagwRgFJnRa518NGSlgCZyZPoSfdpewUr+Mced7Q5LezZ5gRc558u++tdMmi2lOlq60x 349qu1i07TZbw9XzBAKbxM+RbFGAI0XRaYMvsphPHQALQZu2Kzpx/lm20zSM//QJYKH6 I2tA== 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=AjJzSpH+6PSgjm7K9Fmcq3Du4iGdtClqyugjGVFCgYE=; b=sI+TFL1oFuRgzds1i1tdKQXm0cAy2DkCUTR9fANH1ICqDQ0/cCFse3U+w+IfbK268e HUJ+pfboAEbwxUAJ6t73/sWRe3r2zyaqNYWnz/v/IjM2ubEvAM4IMNviilrKKccu2oTV 2mCQHIxigPLd2zEayE2ridPhCCALSwdCtkFL4Qfk8P7ejg48QmmcS/wUzdfDNgx4lsg/ 1TQD/a3/r9bgQI8Oos8PaTEGusFcg6j7nXTzuMWVzQTnU45RLjz8r9CDTUmpyvOCTpx0 lidWyF37AvB/7V4fwej7f76XPTWtes25ew0zDk269eMYEBh75hS/uUlYAYIPfhh7rl3h KIbQ== X-Gm-Message-State: AOAM530+uHky7wyjxpuDmRHJdweRUYt1ARSBWZPlZETQSRUWkV8Wo9wj 7uvWN4t3bT6Mto+2+m4aBt720q1ekBJEqPNr7e+c9mqw X-Received: by 2002:a4a:b284:: with SMTP id k4mr9384681ooo.49.1594144257960; Tue, 07 Jul 2020 10:50:57 -0700 (PDT) MIME-Version: 1.0 References: <20200706202518.1153647-1-abhishekpandit@chromium.org> In-Reply-To: <20200706202518.1153647-1-abhishekpandit@chromium.org> From: Luiz Augusto von Dentz Date: Tue, 7 Jul 2020 10:50:46 -0700 Message-ID: Subject: Re: [BlueZ PATCH v7 0/6] device: Allow devices to be marked as wake capable To: Abhishek Pandit-Subedi 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 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