Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2937173rwb; Mon, 15 Aug 2022 14:25:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR7e0ToFAoDses/rGa/knrf6NNzK1X3NmjxJg5QbMAY8Amzb2Lcxk1Cc24fZ0ZUJweDUZdr7 X-Received: by 2002:a17:907:2cc8:b0:731:53a3:4a33 with SMTP id hg8-20020a1709072cc800b0073153a34a33mr11303971ejc.319.1660598709907; Mon, 15 Aug 2022 14:25:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660598709; cv=none; d=google.com; s=arc-20160816; b=gZ2tXS1pHNSFkHU5/nWvM+KvoyTbsNWeeNfNFVfJfrJMtViiOGh0yP7lShk4ZlIZLW 4GwtbrFBGfKBhJa8/2ACQa8Y3sp1icp+kZOwpK8OMkAed/9LFtOn09k6138e51Xg2V3n xZY67zzQEEvjA+6STCoXosg/7c1GOEKlOQ7Koidj4vcXymqfuI+vk0kimVrT6TQpH8rN akj5iqaNYjYDBHy68TZomkaDqPz41SdUWa8e1Y8nfDZdHKeoYF6TCdhZkVGVzI9b21IY O740R19mLMi7LD0DoJLGHQDEzpI4MYDaHuuhCqRjO7xm/5sVkM9aOBKj8bp1t9ia+U66 xKaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mMMIFMNABeboHfltMjaEOzSIiTLTb9KeLIJy8dp+vvE=; b=oYmoQN99fKI2b0Umv28l/nwRcSMA6HEnSsYbkJq0YxA62Q8RoOCTl53nrIYdX3lFPB piPVTocvpKnQo9vC/qX9sWuW19pyJ17E5/nWNwYGI9z1gpqRp6eEqXS4Lni7Bd1/v4Td D0YVr/t+c4K+20EpaYo2UbFc4qRow4vfpqfWTnXK9UTl3rkCCyW7GpxYwyeomkCnbfGt 03LZdF59t84MYjCXNMobDWpgGl17pLvujF+7Q3asAGPuges+eEg5lU8/f5fdhMad/2wo decucEjMZSoKduNtYJObFAAIWOHwlmWrZRsCkbqs6v4oMcuek+SV731jhVZL65LbVZmn fFKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Su6yXtTL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ji14-20020a170907980e00b00730f3cb968fsi9111496ejc.990.2022.08.15.14.24.40; Mon, 15 Aug 2022 14:25:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=@linuxfoundation.org header.s=korg header.b=Su6yXtTL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344561AbiHOVVh (ORCPT + 99 others); Mon, 15 Aug 2022 17:21:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243822AbiHOVQB (ORCPT ); Mon, 15 Aug 2022 17:16:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 148B6DD773; Mon, 15 Aug 2022 12:20:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6949AB81109; Mon, 15 Aug 2022 19:20:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BA570C433C1; Mon, 15 Aug 2022 19:20:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591205; bh=YSQI2zPVfo1ine7m5O/rAnLOw30xNef/7p43YRVoBwY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Su6yXtTL1WAJHe/eX8QUQYJMBR2XPFDC7vOcq1W9XDLQwhoPtoUtFltvhemNdrV+W a48xTtOZBhxgY7Ao7xgbh+k3Ag2ok3ooeu/wAQw2tmhN9Vg3IaOzVUDbUNv4Ieh8XW McnjChL+zeQQbCnMNxF9TBsl4FYIUbu4vEDjNeIY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Zhengping Jiang , Abhishek Pandit-Subedi , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 5.18 0498/1095] Bluetooth: hci_sync: Fix resuming scan after suspend resume Date: Mon, 15 Aug 2022 19:58:17 +0200 Message-Id: <20220815180450.130852699@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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-kernel@vger.kernel.org From: Zhengping Jiang [ Upstream commit 68253f3cd715e819bc4bff2b0e6b21234e259d56 ] 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 Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- 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 9e2a42299fc0..99ef15167a81 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -5008,13 +5008,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; } @@ -5033,7 +5033,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.35.1