Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp644609ybh; Wed, 11 Mar 2020 08:03:41 -0700 (PDT) X-Google-Smtp-Source: ADFU+vvzhv86jtQu34yxXjmj7V+10kTiqXGFIYbs5p9pUKt5Xdf7cz1LDKGLBqHhHXnFWiEAs3SC X-Received: by 2002:a9d:3603:: with SMTP id w3mr2794485otb.94.1583939021339; Wed, 11 Mar 2020 08:03:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583939021; cv=none; d=google.com; s=arc-20160816; b=x1JFkuYtqijSqfT2lznKsqnCGm3W7Y46Jxcugp7tvSMT4tFnpVcNXS5/twWHxDdZqS C8dNKlVpk8Vj2gvkQsNHubBQlTBwTCgul4MFgGi26COWxl6079n6Anb8bxfwmMLkZnJH ZTl/3BjqqV76X3Bwf3tbkug2BdCMCiD4thPqiDBNLs33Yw/FZFltDvOq+Sf4ZNqSTfWV +nrk32jOup1k2/0w7fadeM8j/sGhPw/WxpYctFRjhaVXx7RrSUrV26tRQ/IsaXDkOxeO /QvpKezfPKHcriXUBQA8horRz3PgsfhyxqG2Mpo07hqy1YWaILQ5wNJScYiJ2OFkq9Fq sz3w== 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=JF/x+6U4yWEFf8DCeFPEESq0OOnRcWze6u1ayxjMcE0=; b=spxFR8wivDi2TuwpCdlkrPj3hdR0wWm8/G6FqY54j6UFVMZOGC6zL3QAuGP4XiFgRp Zk12kLN+jT8dT4iHDCGBklPz7UKxDTg9C5mp7Z2usrtgovG/Zil+9reguB8Cwy7J1U2g 8MhE+jtuTBgqLOEPqQZ791oQf4Y103MgyYmYS3kzCZ03mCpeecJXAqJWieX8xZJbClzN 1SMvEhYCWcFEj6T0ie7aAAo6kFJQr/ZbPoMhV2+S3e3vPAwuthRrXU6GtOZnNSzWjyWQ zZjdS3LIZD1UmssdsP603OFNfiSSFSQm3i2HR4uK8ng1z2cx+w60YhbGh0DxYln3Ya9C f9Qg== 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 d125si1119861oia.86.2020.03.11.08.03.19; Wed, 11 Mar 2020 08:03:41 -0700 (PDT) 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 S1729521AbgCKPDP convert rfc822-to-8bit (ORCPT + 99 others); Wed, 11 Mar 2020 11:03:15 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:43491 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729309AbgCKPDP (ORCPT ); Wed, 11 Mar 2020 11:03:15 -0400 Received: from [172.20.10.2] (x59cc8a78.dyn.telefonica.de [89.204.138.120]) by mail.holtmann.org (Postfix) with ESMTPSA id 3C97DCECDF; Wed, 11 Mar 2020 16:12:42 +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 v5 0/5] Bluetooth: Handle system suspend gracefully From: Marcel Holtmann In-Reply-To: <20200308212334.213841-1-abhishekpandit@chromium.org> Date: Wed, 11 Mar 2020 16:03:12 +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: References: <20200308212334.213841-1-abhishekpandit@chromium.org> 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, > This patch series prepares the Bluetooth controller for system suspend > by disconnecting all devices and preparing the event filter and LE > whitelist with devices that can wake the system from suspend. > > The main motivation for doing this is so we can enable Bluetooth as > a wake up source during suspend without it being noisy. Bluetooth should > wake the system when a HID device receives user input but otherwise not > send any events to the host. > > This patch series was tested on several Chromebooks with both btusb and > hci_serdev on kernel 4.19. The set of tests was basically the following: > * Reconnects after suspend succeed > * HID devices can wake the system from suspend (needs some related bluez > changes to call the Set Wake Capable management command) > * System properly pauses and unpauses discovery + advertising around > suspend > * System does not wake from any events from non wakeable devices > > Series 2 has refactored the change into multiple smaller commits as > requested. I tried to simplify some of the whitelist filtering edge > cases but unfortunately it remains quite complex. > > Series 3 has refactored it further and should have resolved the > whitelisting complexity in series 2. > > Series 4 adds a fix to check for powered down and powering down adapters. > > Series 5 moves set_wake_capable to the last patch in the series and > changes BT_DBG to bt_dev_dbg. > > Please review and provide any feedback. so I was planning to apply patches 1-4. The only thing that I noticed was that patch 2 introduces the following warning. CC net/bluetooth/hci_request.o net/bluetooth/hci_request.c: In function ‘hci_req_prepare_suspend’: net/bluetooth/hci_request.c:973:6: warning: unused variable ‘old_state’ [-Wunused-variable] 973 | int old_state; | ^~~~~~~~~ I think this variable should only be introduced in patch 4. Are you able to respin this series so that the variable moves to patch 4. If not, I can try to fix this myself. Regards Marcel