From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCAFCC433DF for ; Wed, 24 Jun 2020 19:40:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B9A662077D for ; Wed, 24 Jun 2020 19:40:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391360AbgFXTkH (ORCPT ); Wed, 24 Jun 2020 15:40:07 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:58971 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391239AbgFXTkG (ORCPT ); Wed, 24 Jun 2020 15:40:06 -0400 Received: from marcel-macpro.fritz.box (p5b3d2638.dip0.t-ipconnect.de [91.61.38.56]) by mail.holtmann.org (Postfix) with ESMTPSA id C34A3CECDB; Wed, 24 Jun 2020 21:49:56 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.80.23.2.2\)) Subject: Re: [PATCH] Bluetooth: Don't restart scanning if paused From: Marcel Holtmann In-Reply-To: <20200624113351.1.Ic6b1fca2b1b3fe989db21ceae76bab80bd87d387@changeid> Date: Wed, 24 Jun 2020 21:40:03 +0200 Cc: BlueZ , Alain Michaud , ChromeOS Bluetooth Upstreaming , "David S. Miller" , Johan Hedberg , netdev , kernel list , Jakub Kicinski Content-Transfer-Encoding: 7bit Message-Id: References: <20200624113351.1.Ic6b1fca2b1b3fe989db21ceae76bab80bd87d387@changeid> To: Abhishek Pandit-Subedi X-Mailer: Apple Mail (2.3608.80.23.2.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Abhishek, > When restarting LE scanning, check if it's currently paused before > enabling passive scanning. > > Signed-off-by: Abhishek Pandit-Subedi > --- > When running suspend stress tests on Chromebooks, we discovered > instances where the Chromebook didn't enter the deepest idle states > (i.e. S0ix). After some debugging, we found that passive scanning was > being enabled AFTER the suspend notifier had run (and disabled all > scanning). > > For this fix, I simply looked at all the places where we call > HCI_OP_LE_SET_SCAN_ENABLE and added a guard clause for suspend. With > this fix, we were able to get through 100+ iterations of the suspend > stress test without any problems entering S0ix. > > > net/bluetooth/hci_request.c | 10 ++++++++++ > 1 file changed, 10 insertions(+) patch has been applied to bluetooth-next tree. Regards Marcel