Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3086749rwb; Mon, 15 Aug 2022 17:48:21 -0700 (PDT) X-Google-Smtp-Source: AA6agR4sHdvE6Oj0DsrGWy28pPU95ogWoHw7sMKrFZEUmtE681McBhzb7FeNVHnNFlUrJPXlK/Wm X-Received: by 2002:a05:6402:43c5:b0:43d:f9ca:4061 with SMTP id p5-20020a05640243c500b0043df9ca4061mr16748813edc.352.1660610901538; Mon, 15 Aug 2022 17:48:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610901; cv=none; d=google.com; s=arc-20160816; b=A46jqNug2RuCiFJrm+r5ASspbUc8mXowStNAULqFl1O1/GVUC+W/sIrInECgbOv9sO 3xdCcRHKlA/W9IVau3AVylRliETcnj7f1mZtbH5HFY5yD1Kz4N37+yIX/cFd4OFZzjRL 3lP3/WR7tUvjOBtHo7BDffImd71hQiNyH4amJmlYvnjEZqDnGzj3NGrCAm0VTCZCf18H Jo4sSQ9CrPXoZ0xvoe24iT+b6b+vumWmMxDfHzJA5xs+5rSZBgylGwemkEcHnX0Y64t/ BLLQZMNnuLroYoSLhpEEeYDathBsH/73fdd/v0ZDtz+vUB9h6cWv48L33hbMoPcAs2MV e9mg== 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=+159AsEVkX2Pic64aKsb+tJvRblVlcMsTET95w9yf00=; b=ncQG3HWyMkLUuzeVn6PyrqkiyQrSGuxXgJmx/0Tvahm02C7lPfGSn9rHvNImhnaCRN nrfVWCrg7rgZMifxXW5iCpMHbquaYV7WA6brD8dmXO8J9Z+qTp9Uuni8ecfRM1s4yCP4 0RIf99iDuLW9LPvTXstGeq4RbnqD/TuosI8RsbyXu4cyPRHzVh22dePTIzPY9u3Ytu3A 0FvaC6C7a31OylDWi/jxGd3ZSuSUR1BKaEbxGffgi7mMwPBXhwDmOi9weAKb0NVXx8ns 9V4nYNwlYLO3+X/3AUop97vl3q+q4dLyzHSR9cyAkZq0Bq37iiL6mZ6DdVZlHkGAKfAx 0Y5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=x4mzIhUO; 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 md17-20020a170906ae9100b00730d33c8fb3si8200473ejb.49.2022.08.15.17.47.54; Mon, 15 Aug 2022 17:48:21 -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=x4mzIhUO; 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 S1355664AbiHPABG (ORCPT + 99 others); Mon, 15 Aug 2022 20:01:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1356006AbiHOXxa (ORCPT ); Mon, 15 Aug 2022 19:53:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B5B115CE3F; Mon, 15 Aug 2022 13:18:23 -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 8FC14B8115B; Mon, 15 Aug 2022 20:18:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DB0E8C433B5; Mon, 15 Aug 2022 20:18:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660594696; bh=bG0UNHZ0ezxQ5XIhk9xy53ikELEQGQ7wHxTXr6HVsOY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=x4mzIhUOYvQa99a4+PVXXr+/qlsfmf4zIuI79E9/9yB0WAasx+OBcxwtXcfHGMMaK Pm8ew+f45sOZ3/FaeXz6LiSGX6Ae82rmdDhv7Ob6DeA1IcwNEPMaTOgi8Ek/b05BOf aiTV+J7my78LjZPjF2AmLrtMRUo9rUnOlirplUcs= 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.19 0530/1157] Bluetooth: hci_sync: Fix resuming scan after suspend resume Date: Mon, 15 Aug 2022 19:58:06 +0200 Message-Id: <20220815180500.849909054@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 c17021642234..1641db8722e0 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -5039,13 +5039,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; } @@ -5064,7 +5064,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