Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp680275ybh; Wed, 11 Mar 2020 08:41:53 -0700 (PDT) X-Google-Smtp-Source: ADFU+vtVVsVPSzcR5sjFmzHMp/PAEZfbz5mtq7pCWMO5SZNlgjIXg7UmI3t3HN+qa1Alq6RnbKXn X-Received: by 2002:aca:d68a:: with SMTP id n132mr2508258oig.40.1583941313107; Wed, 11 Mar 2020 08:41:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1583941313; cv=none; d=google.com; s=arc-20160816; b=KpRswKnrRVFO1brTM8iTIofduXeMBNlsYnFkuqZR0PUnXX39L1Ivps/fhedgCtpfBU 3YIR++BxbitxHmE2asMhuMzgEDEjC6MXEoaPeCa435S9VUVDzcgvLZgamA4A57Y+h5+N Vu5SbhlJcFP51sfSDfwN3bP5U/INGCE0eM5Sv2yHRbBGOT12GP5k07xICPigFGHf2/8a LrSJnLf2fMlQ/9U+BaxffpXQ2wg6Z+R6+wgPIUsH++kJGbxuxCszIZ77YR/UTWYVcBH4 Gj4hBtYSq7CewhwXPQmzSb+LAAk2qTq58honqIOX4Z5b78QPETwYNP8baKNqDLLemRIn EFgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=bRlEXufW+otZULePWW/gKpEh2IixSSza/KchTcrPm2Q=; b=HD9A6TbihZviehC6eua3DqV0IgW1ZVNbfXzRT+OVUl8Bj4vU03ydGnbcEiFCXoHIXF Eblh0b7e5qonO45/6FtB0b6pocVoIWIyxfLDH1Wsa50gFcERIF10u99zRFp9B/zZC03i r9KesQmGzByha06qbLRR8g7acIgBf2UdynWQjiOVMXbaTkjUWfcNX2TM81tRW8D5aLtC v5F1FWJgCShOqbFDVnzp80RJuQiFh89ZyPY8RrW4n6q65JopxDbr+JVFtIvusHW2n9ga 7EUyP4Gn1hiaOWH3vr1a5sWzwpZR87Gd1dfsOXgGL+ErGqm3Cg5op459cnYpvQQ1Jtei cKvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j7kpCO3v; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k24si1562357otf.213.2020.03.11.08.41.26; Wed, 11 Mar 2020 08:41:53 -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; dkim=pass header.i=@chromium.org header.s=google header.b=j7kpCO3v; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729956AbgCKPlY (ORCPT + 99 others); Wed, 11 Mar 2020 11:41:24 -0400 Received: from mail-vs1-f68.google.com ([209.85.217.68]:41130 "EHLO mail-vs1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729929AbgCKPlX (ORCPT ); Wed, 11 Mar 2020 11:41:23 -0400 Received: by mail-vs1-f68.google.com with SMTP id k188so1606128vsc.8 for ; Wed, 11 Mar 2020 08:41:23 -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:content-transfer-encoding; bh=bRlEXufW+otZULePWW/gKpEh2IixSSza/KchTcrPm2Q=; b=j7kpCO3voHcWqHVyatv0lWnoAAecB8yuezwj9exrXWfCvklFKwRQ6i0yNsnulp2Ilf aYceY31muzNpCzivV9FxEu8Vqy9DpXdlRX/hd8kNQ6eG3AdabEG55fVjKvzhUR24P3NT f64/tJP5KM+lAmMmVfIMAu2FulqGjNZgyGQDQ= 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:content-transfer-encoding; bh=bRlEXufW+otZULePWW/gKpEh2IixSSza/KchTcrPm2Q=; b=U8V9ILwTu1Leplm2aleRFO56sEmN1522Eylc7Evxg0GXfy6FRw/zcYW8UQ89s3ZmaP FOruzA2NMrm44QxA0SQQYx4Jp1fZyZr3c3h/gNAM+BtEzdNwLZ2YKvxCGgLS4OE0FjC+ NB/69dn9x4i3kAc/N3JuiQnBInseZ9Gx2/B1sblsoC/bphzp4ac2sMzZiyaM9NIhvjRV a0m7Fh3NWVBMCEyYC1+dmL82o6iVduHUefFvFva5VGluRGPgGyAJAmPn1Y32IYTaR7Wz zwAf7wviH2z/78qrxft2XXMp6+uTBlunE8AziNtWS6Tg4sp0X/12M0v/lJyX7jXbhUJj K7hg== X-Gm-Message-State: ANhLgQ358mKzhNNAj8fFnu5kJ4MjTR1Ed6ZmzGPyjnyMqXqGaTfL69yt AP/bI4f79D7Ow41kyaev4eG1/LDMHgrhS9MNPrqu1C4o X-Received: by 2002:a67:f641:: with SMTP id u1mr2388964vso.86.1583941282719; Wed, 11 Mar 2020 08:41:22 -0700 (PDT) MIME-Version: 1.0 References: <20200308212334.213841-1-abhishekpandit@chromium.org> In-Reply-To: From: Abhishek Pandit-Subedi Date: Wed, 11 Mar 2020 08:41:08 -0700 Message-ID: Subject: Re: [RFC PATCH v5 0/5] Bluetooth: Handle system suspend gracefully To: Marcel Holtmann Cc: Luiz Augusto von Dentz , Alain Michaud , Bluez mailing list , ChromeOS Bluetooth Upstreaming , "David S. Miller" , Johan Hedberg , netdev , LKML , Jakub Kicinski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-bluetooth-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org Sure -- patch incoming in a few minutes. On Wed, Mar 11, 2020 at 8:03 AM Marcel Holtmann wrote= : > > 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 shoul= d > > 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 blue= z > > 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 adapter= s. > > > > 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 =E2=80=98hci_req_prepare_suspend= =E2=80=99: > net/bluetooth/hci_request.c:973:6: warning: unused variable =E2=80=98old_= state=E2=80=99 [-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 >