Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp3824230imw; Mon, 11 Jul 2022 17:07:06 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tJ4iEmkyy/gxjUZcjaNQV17jGKou7o+Zv7/tcgCfD6UC1qQy1JAgCKDXRzEmrPBpkooI3O X-Received: by 2002:a63:fd0b:0:b0:415:f76b:a2cd with SMTP id d11-20020a63fd0b000000b00415f76ba2cdmr7752544pgh.440.1657584426550; Mon, 11 Jul 2022 17:07:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657584426; cv=none; d=google.com; s=arc-20160816; b=OWM6aR3yGpsAOlg6pFDm+Qqw0N86lSetbpMVVygrDxofOss1+lIiRvjTfh33xesk4B VVuQCv/Qj+aJfkJAqx2zeSJLgi4nomt9zE8d1T4RltbAPOgWaI19nn3y/CMPdqrVvKS5 TiWSLh97fzCCdFJNb21CQ2xY5tMlHfH+Z7RR68hg1GccKGubHNXWKmhdt0MEPim4y/pE GXiMBwelH1s2U4Rxdy49+Z70NdySWRtzsdYhD4f/NdnQVgsHg3Hiok5g8SrKmNIloMuq 4dglMngQqR6p0+czM15eVwfi8ARmfKFHkOSnfReKo40Du/lTw1qQh32x7YaAH5vQOm+T vimw== 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:dkim-signature; bh=1JpwXxBfHL+adQw1k/M4Xx4GgPy74dDIIx1BqOfF6HE=; b=tU/La/naUjKlX6pCZk2lUyglzhHmxxVGH16u1YUwMn8bH9YracVrkn85clu8HG1v9G REjWiANJwQivX+s18pUimtr8JoPSWgzDYcgd3ivzPrhLmh5eOIDwRcqFq23dSfiG1vcP azT9DBHVaOhmhh+73hxLgIvQFbUPkfQpBCwSnRKKSUc8O9sRsIRTMfpofZtbSf2TQ7Ce VD8tF9atJ86uVG7G1pCoVxQc+6DZGs83Ik5boX831POurr+YrpjWTxLSEgOlu12jVgwf qdU03d7KP9QD2ZzER0hP2j27u2xB0lKdbZNzlZtupWUkSHIZ0MqaQ/X2xQiGXDpj1JMu DgMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=qdJg+sV1; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d8-20020a17090a02c800b001efd453955fsi10628706pjd.43.2022.07.11.17.06.54; Mon, 11 Jul 2022 17:07:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=qdJg+sV1; spf=pass (google.com: domain of linux-bluetooth-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S231331AbiGLAFt (ORCPT + 99 others); Mon, 11 Jul 2022 20:05:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229670AbiGLAFk (ORCPT ); Mon, 11 Jul 2022 20:05:40 -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 1D47BDF2 for ; Mon, 11 Jul 2022 17:05:39 -0700 (PDT) Received: by mail-pg1-x54a.google.com with SMTP id 9-20020a631449000000b00412b1418c79so2490078pgu.2 for ; Mon, 11 Jul 2022 17:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=1JpwXxBfHL+adQw1k/M4Xx4GgPy74dDIIx1BqOfF6HE=; b=qdJg+sV1ZLY12NdCbWtFBRr9HAPtVRoRvyYrjzWV5P4xFPENTKzw4kkMuCxv8lkuUi /B5kQ+fqovXQvljejTKCF0jeYXsS2p6J7khkTKAYhg99QjaOx3b7BTUDSe7/sbkdqkWh 74Ex8ZdqJ3HX6T1LMVG2pzp06jJabgMAmjomYh9tLZ1f+QFtK4B4f7edSEzxie1HMwrP lOh9Et7UzZkKXQ9bRards3gFFNzLuIezTHcOGIHFtAnMmpV7FIuuL2ITptWZM27N9ZKQ k7OUnqswKWMn0vb8WyzvdOdHOS9/x/eqY2ytET2xYjaJfUMiXFu0lcBXVqmgEHGp2jPN SHrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=1JpwXxBfHL+adQw1k/M4Xx4GgPy74dDIIx1BqOfF6HE=; b=HYcDiR8K4pO0+YoLRxhSyxW79KxT5JwdLAgk0L6L4xgEmK/ebjtRoO6p/vddEPqg50 y3CdAaY04AzbmTJK9bdRSTrfEmm86sgKOHRttPSRetq8VDcCV/sY35UQ40/DctCbTQ5d lxwSpcnTOt7XQrN7d1Q5V6J5Np52UOzJUb9LTL4iHYDIjmVqcCXiZ6UPea4Up3Spz970 q7rNkdzg5KNoLWp2C7L8UgulwoZffiUJ1ndJ/0l2gAq1t9oul27pn8xlH6kmbOYpw9T7 1mPI5xpWWMFK7AGAWAcwekVK0lO6Hgcmo2GrFTKfxs79YaZmPjhIqmI6yjpuzGpe76X3 QUag== X-Gm-Message-State: AJIora+zkta0e2LG0qjpcGAf51bXvAXj93wrS1xSFzlh5dNDS5lgzT6R temhVGyBg4YO33px061DXQXI9LTJ3rcVK/LAlFIhMfGCJx6Ewd0FXIAPlVFDZ4pWfHRHMFmn9Iq a/ZxLKA7vISzG02El5vYk/rAR7rV2mkGjEXKDqH1bMQbPXPOxiW8DMZgkqNW3vAcEuQkx6cuqOX Qk X-Received: from jiangzp-glinux-dev.c.googlers.com ([fda3:e722:ac3:cc00:7f:e700:c0a8:4c52]) (user=jiangzp job=sendgmr) by 2002:a17:90a:bc04:b0:1f0:506d:78b9 with SMTP id w4-20020a17090abc0400b001f0506d78b9mr1065616pjr.4.1657584338428; Mon, 11 Jul 2022 17:05:38 -0700 (PDT) Date: Mon, 11 Jul 2022 17:05:30 -0700 In-Reply-To: <20220712000530.2531197-1-jiangzp@google.com> Message-Id: <20220711170515.kernel.v2.1.Ia489394ab4176efa5a39ce8d08bb4c4b7bee23b9@changeid> Mime-Version: 1.0 References: <20220712000530.2531197-1-jiangzp@google.com> X-Mailer: git-send-email 2.37.0.144.g8ac04bfd2-goog Subject: [kernel PATCH v2 1/1] Bluetooth: hci_sync: Fix resuming scan after suspend resume From: Zhengping Jiang To: linux-bluetooth@vger.kernel.org, marcel@holtmann.org Cc: Zhengping Jiang , Abhishek Pandit-Subedi , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Johan Hedberg , Luiz Augusto von Dentz , Paolo Abeni , linux-kernel@vger.kernel.org, netdev@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-bluetooth@vger.kernel.org After resuming, remove setting scanning_paused to false, because it is checked and set to false in hci_resume_scan_sync. Also move setting the value to false before updating passive scan, because the value is used when resuming passive scan. Fixes: 3b42055388c30 (Bluetooth: hci_sync: Fix attempting to suspend with unfiltered passive scan) Signed-off-by: Zhengping Jiang Reviewed-by: Abhishek Pandit-Subedi --- Changes in v2: - Reduce title length Changes in v1: - Fix updating passive scan after suspend resume net/bluetooth/hci_sync.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 7cb3100518799..212b0cdb25f5e 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -5063,13 +5063,13 @@ static int hci_resume_scan_sync(struct hci_dev *hdev) if (!hdev->scanning_paused) return 0; + hdev->scanning_paused = false; + hci_update_scan_sync(hdev); /* Reset passive scanning to normal */ hci_update_passive_scan_sync(hdev); - hdev->scanning_paused = false; - return 0; } @@ -5088,7 +5088,6 @@ int hci_resume_sync(struct hci_dev *hdev) return 0; hdev->suspended = false; - hdev->scanning_paused = false; /* Restore event mask */ hci_set_event_mask_sync(hdev); -- 2.37.0.144.g8ac04bfd2-goog