Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp1108405pxx; Fri, 30 Oct 2020 02:10:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrgmKbjKrbWTGifLKHWv55DnPuXFa6BDvQ/st4UgZKep566PLgLN6JrlaXMU7tFZvptbF5 X-Received: by 2002:a05:6402:c12:: with SMTP id co18mr1181831edb.162.1604049044682; Fri, 30 Oct 2020 02:10:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1604049044; cv=none; d=google.com; s=arc-20160816; b=ziEOW8ApnisJm29+ULEAcRAbijIK/54EB5g0mCJnW0SqWufnNMih4UtPzi+5n891AK GmB6Mb/ajyDpc78uW8UCBQplhyoQcaVgbqoqkctvUTh7bD5M+AA0EQCouvnb6BVIgin9 u3MMWi9htw+SWY2l4wqS33OghP2fHFk0zSOe0mhz5wbFS1TzP+R214b5s7kUh7bmIbWW 8aKlLyChhnE1AgVJWsPnGccMRUyNQd9ZSHKulVUQdYeCfzDTyU45pLb/ERumgFi3zjPx 8DpHj8dTjSewnZfmC5wvnGJIsJKy7W3zA//n96kFzwWbjMaACRLLdFGMXyByfXNeOedh 6YeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=y9r4BIYxJa4WnGbQ9pgMMQmBboczCy4Fi2w4BB7yPfI=; b=exwoeFdJ4jqEWiXxPgeclgc6d3fLRcnoZMJGxnP3RIp0ghQpaeWAKqZ6Mr+l3eIwvI EjEl92QP5GGMOtZFRAosv2sHWcYUObsrS2qsQrxE3nsyGAc6qF9Jk0uX+nq5+S+w2WOT V3chSmFebR9QYpapMQWuCi38f8SfimqSyYK1wVqtzoISCzM4/c3S6utnF2BmUd+p9FxP PgS6N6c/ZPJBzAkjAreRyCMMYE3wHOR4TTHlSCCV8CrOfcMFU6vYgO8suHn7n80dlPzY Ue7D+ENy/VfiSAJp6IeZHs+kSroCvFsVwghoOUMzJ0GcPx4fjoVW9lrY7ZXhENOVAHAr Eilg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=sO+NFzSu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k16si2599440eja.59.2020.10.30.02.10.22; Fri, 30 Oct 2020 02:10:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@google.com header.s=20161025 header.b=sO+NFzSu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726209AbgJ3JIp (ORCPT + 99 others); Fri, 30 Oct 2020 05:08:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726176AbgJ3JIm (ORCPT ); Fri, 30 Oct 2020 05:08:42 -0400 Received: from mail-pg1-x54a.google.com (mail-pg1-x54a.google.com [IPv6:2607:f8b0:4864:20::54a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63A60C0613D2 for ; Fri, 30 Oct 2020 02:08:42 -0700 (PDT) Received: by mail-pg1-x54a.google.com with SMTP id e27so4193878pge.15 for ; Fri, 30 Oct 2020 02:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=y9r4BIYxJa4WnGbQ9pgMMQmBboczCy4Fi2w4BB7yPfI=; b=sO+NFzSuWYNKtwk3TsEE9K//jXOLQIeOGSB3EphRYpAtYk4KafmJqX5E9bQtt3CUia Zd9u/HnxqrG0OMkjBLYnNRnxiaDUVwFGyzsJn1xwL0h14En3ZQhdrfh3EwAEyoBVkRKM NGVrzGeCX+k4HplS3NrRPkRbmYa7Sfy5rUsjT5fJg2NDLSsmp3C696OMe2Di22AzOzRF 796mRXdfWW4/4NVaDU5BrI6WN71CknoJwqt+1olsnaqiSJ/Br367X9YL0pMTcJ+U9fdW 0e5UnP1E80pmFPK8dST2aeDDJpDASFaUeh5kWRyG2JKn2Xh6ZE20RmVwTGFfwWcdh8nv KLMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=y9r4BIYxJa4WnGbQ9pgMMQmBboczCy4Fi2w4BB7yPfI=; b=o0tHpJrIh/8eHhNH6Fut9F0akLVgx0jhOPeSCEWvnkOr2QulQrjm91R5IxI6Ik4cHP LbQVSDbnWONy0X8NLgcrsHNX0ulaDCebUcOIx8EpPZ+5LvoAXulMoH3glQ/c2B/7nZgc 3ey68xD99ojfgDRHYgF+nWFVBoKZGwHK3TF5iAXb3Ixb6LZcLD5eHCNDVRQDGnAGFjK4 bmTSyvdmGjKKhiAikXznV/zvqB2vBlh9h1D18bKl3sL7nUqcqFcWZ/WmojuQaCVWS5Wu DNzaDEVMVXMItLSfvgEnzMVs9dui5chg/VpneQACKYdzhqZIyQ0/N5oSCvnO8yVjyB5a 7Tag== X-Gm-Message-State: AOAM531SnccSr/lcSlv/D8HJfHhpIWC1+Zndp6GwH9CyYK1rLj3aQfkw 2BOylipw13gFz6yxFkCb90ufLax8w8pU5RJUTg== Sender: "howardchung via sendgmr" X-Received: from howardchung-p920.tpe.corp.google.com ([2401:fa00:1:10:f693:9fff:fef4:4e45]) (user=howardchung job=sendgmr) by 2002:a17:90b:f85:: with SMTP id ft5mr345340pjb.1.1604048921633; Fri, 30 Oct 2020 02:08:41 -0700 (PDT) Date: Fri, 30 Oct 2020 17:08:24 +0800 In-Reply-To: <20201030163529.v6.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> Message-Id: <20201030163529.v6.2.I3774a8f0d748c7c6ec3402c4adcead32810c9164@changeid> Mime-Version: 1.0 References: <20201030163529.v6.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> X-Mailer: git-send-email 2.29.1.341.ge80a0c044ae-goog Subject: [PATCH v6 2/5] Bluetooth: Handle system suspend resume case From: Howard Chung To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com Cc: alainm@chromium.org, mmandlik@chromium.orgi, mcchou@chromium.org, Howard Chung , Manish Mandlik , Abhishek Pandit-Subedi , "David S. Miller" , Jakub Kicinski , Johan Hedberg , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch adds code to handle the system suspension during interleave scan. The interleave scan will be canceled when the system is going to sleep, and will be restarted after waking up. Commit-changes 5: - Remove the change in hci_req_config_le_suspend_scan Signed-off-by: Howard Chung Reviewed-by: Alain Michaud Reviewed-by: Manish Mandlik Reviewed-by: Abhishek Pandit-Subedi Reviewed-by: Miao-chen Chou --- (no changes since v1) net/bluetooth/hci_request.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/bluetooth/hci_request.c b/net/bluetooth/hci_request.c index 70ea126f56282..b615b981be9d6 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -1284,8 +1284,10 @@ void hci_req_prepare_suspend(struct hci_dev *hdev, enum suspended_state next) hci_req_add(&req, HCI_OP_WRITE_SCAN_ENABLE, 1, &page_scan); /* Disable LE passive scan if enabled */ - if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) + if (hci_dev_test_flag(hdev, HCI_LE_SCAN)) { + cancel_interleave_scan(hdev); hci_req_add_le_scan_disable(&req, false); + } /* Mark task needing completion */ set_bit(SUSPEND_SCAN_DISABLE, hdev->suspend_tasks); -- 2.29.1.341.ge80a0c044ae-goog