Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp149228ybl; Tue, 28 Jan 2020 20:42:59 -0800 (PST) X-Google-Smtp-Source: APXvYqwpSJ16Ny+MhtIwpVbQ0rF56UvXlqCT/scPD7vRL5p6NnWwVA6hGBjhQZV9thBehguAziNy X-Received: by 2002:a9d:76cb:: with SMTP id p11mr19645622otl.7.1580272979743; Tue, 28 Jan 2020 20:42:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580272979; cv=none; d=google.com; s=arc-20160816; b=AkeY/Nq6L4A8ZwxuQPu/9jc5N09A7yE7eeqpuugdeQj9RbqIPlpozI5vO17pZms23o 4ZL7+L0qXW2Dp37WDHYlCCKrb3dvuiE7xzdX0z6ar7cXLbt8lxmPoU7W5YCsiwFJ/brW 0t0EjxtFaWdXFHMsTTL+3dQMcDZhcy1ioGt4YsA0fErqGzMnYiWgPXZEWT1XfJl++Xcx 7ua2wXq325IDvyhf44N4SQ4HMJZMdKLROo/0B9YmGNTXag1vaYwiPLzb8xYdsVU2scOH zoqOHVIJ4RM87owE7FGALg+9gBHuspTt4otTW4wI61WHJtpENmh/BHDCyVOnfzLnoXVR je1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=l5f0nFW+qTTfm4+rRYT4pnXt53TsxwlXhKKkQNhN5BE=; b=kh351NbV+Q0EC4PQ1jEZJl8+3niDfeWvmkiXjLvzwN7TplXG+g/sD2vglFK2CCkpUz L9Bj6Xwldko9O4316nnDfwmnTfOBMAQQLa5tqp8LTA/g0QboFHJhcDB66EmE2zkIbtUP vHKMtrbCnwDjXZb/6FT//nNdsRhKHqkV+EhhYhowgkeGm3TF7yUNGtSEu4u8xpGdvj3V B67ltBe1ASaJVyeokanfy90m+jDOLnXKgnLunCziGLf0zUc4GtD7efdth8rB6sDeQfiv e1yx+29+AtYleKF4uHvLZT25bfn5CHJMmLnphkuben33ZmGm9kyI9hARsFssihcVXO5v bhjg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si580866oti.226.2020.01.28.20.42.47; Tue, 28 Jan 2020 20:42:59 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-bluetooth-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-bluetooth-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726466AbgA2Emq convert rfc822-to-8bit (ORCPT + 99 others); Tue, 28 Jan 2020 23:42:46 -0500 Received: from coyote.holtmann.net ([212.227.132.17]:33780 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726401AbgA2Emq (ORCPT ); Tue, 28 Jan 2020 23:42:46 -0500 Received: from marcel-macbook.fritz.box (p4FEFC5A7.dip0.t-ipconnect.de [79.239.197.167]) by mail.holtmann.org (Postfix) with ESMTPSA id 2ADDDCEC82; Wed, 29 Jan 2020 05:52:04 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.0 \(3608.60.0.2.5\)) Subject: Re: [RFC PATCH v2 1/4] Bluetooth: Add mgmt op set_wake_capable From: Marcel Holtmann In-Reply-To: <20200127175842.RFC.v2.1.I797e2f4cb824299043e771f3ab9cef86ee09f4db@changeid> Date: Wed, 29 Jan 2020 05:42:43 +0100 Cc: Luiz Augusto von Dentz , Alain Michaud , linux-bluetooth@vger.kernel.org, chromeos-bluetooth-upstreaming@chromium.org, "David S. Miller" , Johan Hedberg , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Jakub Kicinski Content-Transfer-Encoding: 8BIT Message-Id: <8C3B4FA7-3A59-4E0C-B609-B6278470F46E@holtmann.org> References: <20200128015848.226966-1-abhishekpandit@chromium.org> <20200127175842.RFC.v2.1.I797e2f4cb824299043e771f3ab9cef86ee09f4db@changeid> To: Abhishek Pandit-Subedi X-Mailer: Apple Mail (2.3608.60.0.2.5) Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Hi Abhishek. > When the system is suspended, only some connected Bluetooth devices > cause user input that should wake the system (mostly HID devices). Add > a list to keep track of devices that can wake the system and add > a management API to let userspace tell the kernel whether a device is > wake capable or not. > > Signed-off-by: Abhishek Pandit-Subedi > --- > > Changes in v2: None > > include/net/bluetooth/hci_core.h | 1 + > include/net/bluetooth/mgmt.h | 7 ++++++ > net/bluetooth/hci_core.c | 1 + > net/bluetooth/mgmt.c | 40 ++++++++++++++++++++++++++++++++ > 4 files changed, 49 insertions(+) > > diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h > index 89ecf0a80aa1..ce4bebcb0265 100644 > --- a/include/net/bluetooth/hci_core.h > +++ b/include/net/bluetooth/hci_core.h > @@ -394,6 +394,7 @@ struct hci_dev { > struct list_head mgmt_pending; > struct list_head blacklist; > struct list_head whitelist; > + struct list_head wakeable; I have the feeling that using a separate list is making this more complicated for us than it needs to be. I think in parts this comes through the fact that BR/EDR devices are handled via the whitelist list and for LE devices we are using the conn params “framework”. So maybe it is actually better to store in wakeable list just the BR/EDR devices. And ensure that wakeable is a subset of the whitelist list. And for LE we store it in the conn params lists. At some point, I think we need to merge whitelist and wakeable list for BR/EDR into a proper structure that can hold this information and maybe also revamp the inquiry cache we are using. I will comment on the rest when I go through the LE whitelist update patch (and yes, I realize or variable whitelist for BR/EDR is confusing). Regards Marcel