Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp258558pxk; Wed, 23 Sep 2020 02:23:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxF4xojKqEwbiW6SnYoEvygKkCxgSX4kPlridALI7nOAHmhHArrsBIasOsTYo1mABpjJndu X-Received: by 2002:a17:906:1787:: with SMTP id t7mr9587650eje.173.1600853024437; Wed, 23 Sep 2020 02:23:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600853024; cv=none; d=google.com; s=arc-20160816; b=VDqlQbUR04RhKwViC1uFGiojPMoZVLZphPTJVaRDMu2mphbY+96ScLYrqLOIK1VwOq lkiru0Q+XGHS5bE02TfbUDjeO/65nw32SwhT0jwO7OCZWOdwFR9jBjWlyDDnqAFRdZgd YRZOWnE2yCvidhMSF33If5KdM89CVJZiiGbMwHZfoTy98jj3Y8NnUyZ5HOPF3MCNa6H4 vG2iJQAl+Xs8XYwZft9v0lA28Pf2jgtmXfuhjILSK1qttm3RNJyiDpU55mOg27aEecf4 Zn0X4uiUim2Cr4QAePUx9pFTCRV+/uI2jhRzM4EpxXFKPTIw8EDY3T0mc6gbtORxTNex KVsA== 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=ZXC6RIjQzvP4+2I2ajwE91pKSZgn0JwFP6uprOUMdtE=; b=pQcF3Rq6z+qFJ6pF2csCAwpx4tVkNTsonIykW6EysXlY6UeM8jDF38MvwkBpwhzlQE Nn32/0hWXz3s/7DTyPHBigMLOuj+p5DMeMd18zuh1GqmBqX+uzkxEZ5JTj8PB7UTToO1 iagoDh1kUF66JyiaLbxIgBjMyacv+6cq2UM2DJRDEj5SEdWGCg9v7BOuP6OUi421shgA inZF35KcJAWXwZSmldzHhd2epq/mkKVPcmYyD6VjBYHvQry2mG9VszLOLVKSmog4nEzd 77MsCeYZqrHmV6v31mx4/McaE24vc21xaVSS6w+fLfUUiorUDLKQX63LQ3AB7WK6Qw1r r4sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KwBf6MdW; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-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 h2si12784962ejo.1.2020.09.23.02.23.19; Wed, 23 Sep 2020 02:23:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-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=KwBf6MdW; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-bluetooth-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 S1726721AbgIWJWq (ORCPT + 99 others); Wed, 23 Sep 2020 05:22:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726672AbgIWJWl (ORCPT ); Wed, 23 Sep 2020 05:22:41 -0400 Received: from mail-qv1-xf4a.google.com (mail-qv1-xf4a.google.com [IPv6:2607:f8b0:4864:20::f4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A8802C0613D2 for ; Wed, 23 Sep 2020 02:22:41 -0700 (PDT) Received: by mail-qv1-xf4a.google.com with SMTP id l1so13498102qvr.0 for ; Wed, 23 Sep 2020 02:22:41 -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=ZXC6RIjQzvP4+2I2ajwE91pKSZgn0JwFP6uprOUMdtE=; b=KwBf6MdWhP0CknbKFW6SdYmhjmeKufVFeUTMS58YpG65Fa57LKDmq4GU4j1dXsqiIK KC7BzISj8ncc0A4zxKTitK5MCmXO218SNreBVdugutCob9UXG4C58Z2tRQeVF9EKNb2J HiBgyUGwChc7JqQKrA3Qq9ErOSHpPE/+rggv4QgrniULhscUIqiA0hrqw0rasVk5MzfA jLq6LVKHSx7vS1L664xoRfUvtfZidSSGCdb5Ds39MS9676fDRPgWxgdPcl7p0OjvaxVj dSTcruurTkrqS/H7wO7O2n8UQiS/8MAH0rIQdWjb3NUjXfb5cK5SAlj7AXAIPz1g0aAO CF7w== 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=ZXC6RIjQzvP4+2I2ajwE91pKSZgn0JwFP6uprOUMdtE=; b=O41IE6liyDqSlw+HDi3xj4+U1zjwNFS3GLPRItHJUcTMSYMjHNAnj0EnGTbOEsvQm5 hbUTkML85s194L6PVYjZhISi9wy4Enb3QKawsGEbQEe/4lVw6JKhglQ2o8Uk3dUb/6om DDmlWgERbIbd5PFAYizqhDiwTzKgV42VhYe69MpO2J8Dq9QtQ7KjJuOSry1UmshfCDQO Crq2gt5aAH7WHjRS+vBlOzYL5Dn3vj6SKzbKZQLquBpl3ybobdbQRfbh7yBrCNZeo/ot bK9h1JoNZ42ae/CzmclaGpF8xwM74Yg8K6TiUR74EKIuOw7wP0AlhKUp3dD5Cm+WLgZJ uPAw== X-Gm-Message-State: AOAM532UiCJ7eLCGeLQKSDs42PR3UYTQmEFiemLacGX+xwZhNrqXK1om LvBaXzqr3JZjYoaQepgy3jg290cJlQWo3Lv9ugFjAVxrqoI/jUWUaMfvZ51JGLVcrJ1ktHy0bAh USIhuNO1aqxJU9/aDCua26L30GwaSJnbExR8BHe01fK8cu7xF7LJBVj1S5RBfjoTjSPJgHpV8Yf QBOL8mkq3bOtE= 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:a0c:f687:: with SMTP id p7mr10292000qvn.15.1600852960833; Wed, 23 Sep 2020 02:22:40 -0700 (PDT) Date: Wed, 23 Sep 2020 17:22:30 +0800 In-Reply-To: <20200923172129.v5.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> Message-Id: <20200923172129.v5.2.I3774a8f0d748c7c6ec3402c4adcead32810c9164@changeid> Mime-Version: 1.0 References: <20200923172129.v5.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> X-Mailer: git-send-email 2.28.0.681.g6f77f65b4e-goog Subject: [PATCH v5 2/4] Bluetooth: Handle system suspend resume case From: Howard Chung To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org, luiz.dentz@gmail.com Cc: mmandlik@chromium.orgi, mcchou@chromium.org, alainm@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-bluetooth@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. Signed-off-by: Howard Chung Reviewed-by: Alain Michaud Reviewed-by: Manish Mandlik Reviewed-by: Abhishek Pandit-Subedi Reviewed-by: Miao-chen Chou --- Changes in v5: - Remove the change in hci_req_config_le_suspend_scan 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 ba3016cc0b573..db44680fbe9c9 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -1281,8 +1281,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.28.0.681.g6f77f65b4e-goog