Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp410615pxu; Thu, 26 Nov 2020 01:40:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKjO0HKneo2cV2iI2xiQHaav8inP+arAiTPDMB65TP+SERtgLvrZ0VfhKqJGTVbN9hFecd X-Received: by 2002:a05:6402:1c0a:: with SMTP id ck10mr1656731edb.266.1606383606439; Thu, 26 Nov 2020 01:40:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606383606; cv=none; d=google.com; s=arc-20160816; b=Gr2cUQX5OVgohWXQtOMMTmlMKmfxZPBLWjcewmivJW7jDZwgyFc9jVS602gsvQMQyL eAl39QRo/PHMSvHQrqS05TNbiz+XoGRqNkD8K2Ufe0EWqSxQp4424l6g4KCxWs3WQw9P rsZckyxm+VMPHICYl+YKQ885nGFFQ33C+gcdtL51oAY4fnz+hmA0YjVnibRGKEGPW4bh MBEkwZnksdtOiT4jmzYCZCsCEP1kXILlOY9MBg717pSOfwoLkcQFgxH0ri+NeBxHbOEY g/7PedG+mYtdqjVU1CYouvawDGrSbv6DtF4/dpsuCdHoymJqgtwFrzElf1JrfPuZgPu+ nhKA== 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=lXyh67vNMJMfjKfbnDtxJFjlSgopuz07QzIMmNfAPeg=; b=QFWH0F/6NIHO1uA/GRWw+TFm/GhxhB1vlIjbh0QWylcZt4MLfkmyHZBYfk6vJN7eQi OSRqkyFbjtWtn9Wn8wX9+Tcfsgi6F8vMVEiN30jHYI69H2jzFhBMhy3Ej3bahbtS4qnR //4MnmYqBVOh4gVhSEvGPAZzOYAPNs86cc/MsHdyaQhucnOt8rpwm4n6M9WrKLZ6hQro 8xukUsiKckybfLAg45u0Pm66La26mj3KhTg+ICZ/wmufFaKFCcTVuZITagYQQz5QX1hT 5mz4qgywHeSX3w+MU7z+2Ag1whJ7AxnL0h1M5KJ1CrS4FSke2WeIJrw/9cKkVjm8MhCb EIWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=L5IGUI+F; 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 a11si2337371eje.119.2020.11.26.01.39.26; Thu, 26 Nov 2020 01:40:06 -0800 (PST) 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=L5IGUI+F; 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 S2387587AbgKZEWj (ORCPT + 99 others); Wed, 25 Nov 2020 23:22:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387595AbgKZEWi (ORCPT ); Wed, 25 Nov 2020 23:22:38 -0500 Received: from mail-yb1-xb4a.google.com (mail-yb1-xb4a.google.com [IPv6:2607:f8b0:4864:20::b4a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EADBC061A04 for ; Wed, 25 Nov 2020 20:22:38 -0800 (PST) Received: by mail-yb1-xb4a.google.com with SMTP id u37so1214602ybi.15 for ; Wed, 25 Nov 2020 20:22:38 -0800 (PST) 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=lXyh67vNMJMfjKfbnDtxJFjlSgopuz07QzIMmNfAPeg=; b=L5IGUI+FZGUk7IRBh3HsJdYoxbrewNtuzP7m+REKeCVgqz7N0I0lrS0MsRMyoVpQa7 rUupJ6W/PyyIfTIZ7qIlWbyVS8w8cbIPMS+oRZCpAWC2iLsciHl5r9WKpslO7SEACbc4 +cAXXMLHoH+6j2qqnIFzYCljIaTWIEwhG8IrUCxNxmMhVrtzvLXTYXnDgu8B0TmmGBkS r5G6DC5RhJF40jPvn9yJGPsJlAmcxvUw2JGJigdXGMvXIRuS1sj8B3ja0qwNI/ra7P8n UOCqzTbjdQQ3O7qKaaj2pyWFnLRb5OTo/z1uiRGSroVVw8p2oDJyyhHfUsn7Ns54Le6T T4Lw== 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=lXyh67vNMJMfjKfbnDtxJFjlSgopuz07QzIMmNfAPeg=; b=JD+A03DYyJwRCWEe7sFlF58/8EJ9gNNIHA1g2z2aMpYWuS+0dAJq4szwiltgQc0qdq CpvRTRk+SyzqhQpvS1Wq0H/hYNHPcWUKsDb+qkp7rb4XcQdJuRoRjx5CeyeUcnIcCZyZ smFZC95Tj0ZIwT/WCc6cxwFf1S5Qqfvi0A7zauU3u9srSJLe112kyuPT300ijSOPkppu pUKr1uTyL9EAq09522GTfO5/reBG+Wjr/HJ3CtlGg7AN3UohGWWTuTCU1528tdJJCEXW MhXsCApCBmP7dfWR8tre5wKYKcgFfy0u4VtQbjr2pHDdDHXI+FsLRSpjNI5DMmt92EWL vQTQ== X-Gm-Message-State: AOAM531sbWq/JWno1HxAwclHuCaApnDaA7SliDphIa36Rcux4/DMQv4x 8h+/4lfPx5g91ddlg3yGLyH010Ll/HxRKn2g0o3weZ82PFZL9YN1k6zfA3nlk/rP4HlNSM84Ur3 Le2zol+eAXTx55wCNlUK+RjKJWkUHglahHfj7DwrIikoxCnAQ/ZpzjGxNeB+clA40WuF/qAFYWw plw3WhtYB6TFI= 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:a25:2845:: with SMTP id o66mr1678470ybo.260.1606364557582; Wed, 25 Nov 2020 20:22:37 -0800 (PST) Date: Thu, 26 Nov 2020 12:22:22 +0800 In-Reply-To: <20201126122109.v11.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> Message-Id: <20201126122109.v11.2.I3774a8f0d748c7c6ec3402c4adcead32810c9164@changeid> Mime-Version: 1.0 References: <20201126122109.v11.1.Ib75f58e90c477f9b82c5598f00c59f0e95a1a352@changeid> X-Mailer: git-send-email 2.29.2.454.gaff20da3a2-goog Subject: [PATCH v11 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, mcchou@chromium.org, mmandlik@chromium.org, Howard Chung , 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 --- (no changes since v5) 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 d6bf1517ddaec..8addb94560013 100644 --- a/net/bluetooth/hci_request.c +++ b/net/bluetooth/hci_request.c @@ -1294,8 +1294,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.2.454.gaff20da3a2-goog