Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795046456; b=eztctRG85rtTEZEMhriwKdrhq3Ej6HLG+z+lQFgyPJ/feUOPq9exc9QneIT9Qrow9+Xb BIQHE8B+GI/b+YFf+sVFAF034bZ47UHLkDogLSywtvcRMWaS5vyYaONCtwo9XzZKq6uMa ePXV9aigjfDK7zACPtyRypyvtKcw1apTEGuDG2IdWCdMJf4FRuRiYLqX34VTwmWwJnLJe 9Ul3EWU7yFqoNmya00V0Ruy60xVGGK7gsvYeqqAL+pPImD8tCcw9CxJrjCLjUQuOg2zhF UO9kaOcr2cj6yjn/HKSYrkAa+5LtrkFKVFrFxKeLvEH7zOXljUHp0/G7ekMAgVWdU+A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795046456; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=Bt4MpU+kQ37lZI9Pu1LFfvqsMXCQtT7nbPjA3Lgn2J0=; b=UmJH6We/fRU9yk0uSqlsPWfgsRzVmBMGndPrgJC6WFOcUdb+LqdAai15+GIT9/sOgdbp 4ACis6I1p6wOtiImYihFMUDMSOeW6B+TrRyCNMY6WUJKJM1VuZZ+G2myjWnv5mA0n0YY8 i4BoaMAXnxBIUYvP5My0McabHMrzJjXU9imkoyKxcVXTIkf9fjjAU3UlT7AT1nU96mP// izX/rpvAcoBYMVeV4iBMR33lH6p3ZSLwWY6qq0Z/rn0U+7fGQ/xoeVfvPxyt3zdvnqDS2 ZQHvTCJaxKJScXspFwiSHpg8VfpCx13US2y3Wqsy7XyY1euf+dG/cS0AYQkkce65MqQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b="W/8kEuuX"; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10627606A320; Thu, 19 Nov 2026 00:00:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=W/8kEuuX Received: by smtp.kernel.org (Postfix) with ESMTPSA id 634951F000C5; Thu, 19 Nov 2026 00:00:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1795046455; bh=Bt4MpU+kQ37lZI9Pu1LFfvqsMXCQtT7nbPjA3Lgn2J0=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=W/8kEuuXLlIZjbiIALwvyX2bmMA9B2dVY/1x13EL54/tU4665g0++GqqRRqcoD4Gk nVBBWCD+h9NvdZTH/ZysTk6J1YnsVyxGZdtxYuoYF4BuiVfeuY/M6yssYB1PWhS0Ec Ni3c+aw2LbeaLcAepauHdNUZGsuc7WyX0nE0kvbI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Valentin Kindschi , Luiz Augusto von Dentz , Sasha Levin Subject: [PATCH 6.1 1250/2857] Bluetooth: hci_sync: re-enable legacy advertising on resume Date: Wed, 18 Nov 2026 15:38:04 +0100 Message-ID: <20261118150246.557460266@linuxfoundation.org> X-Mailer: git-send-email 2.56.0 In-Reply-To: <20261118150201.293410965@linuxfoundation.org> References: <20261118150201.293410965@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Valentin Kindschi [ Upstream commit 737139f4157d302292a6b937d96922879ecabfa3 ] hci_resume_advertising_sync() never re-enables advertising on a controller without extended advertising. It restores HCI_ADVERTISING from advertising_old_state, then calls hci_schedule_adv_instance_sync(), which starts with: if (hci_dev_test_flag(hdev, HCI_ADVERTISING) && !ext_adv_capable(hdev)) return -EPERM; The flag it tests was set a few lines earlier by the resume itself, so the call returns -EPERM without sending anything. The return value is discarded by every caller, so the failure is silent: advertising_paused is cleared, HCI_ADVERTISING is set, and the controller is not advertising. Observed on a BCM43455 (no extended advertising) after an active scan: btmon shows the pause disabling advertising and no re-enable in the ten seconds that follow, the device does not appear in another controller's scan, and btmgmt info still reports "advertising" in current settings. Enable instance 0x00 directly in that case, the way reenable_adv_sync() already does for the same situation. Instances continue to go through hci_schedule_adv_instance_sync() so the software rotation loop is rearmed. This affects every caller of hci_resume_advertising_sync(), not only the scan path: address resolution changes, accept list updates, discovery stop, suspend/resume and the end of an LE connection attempt all leave advertising disabled on such a controller today. The resume does nothing when the controller is already advertising, as it is after directed advertising was started for a peripheral connection, so it does not replace that advertising. err is initialised because the extended branch leaves it unset when adv_instances is empty and HCI_LE_ADV_0 is clear. Fixes: ad383c2c65a5 ("Bluetooth: hci_sync: Enable advertising when LL privacy is enabled") Cc: stable@vger.kernel.org Assisted-by: Claude:claude-opus-5.5 btmon Signed-off-by: Valentin Kindschi Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- net/bluetooth/hci_sync.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index 28e7fa689aae8..453ed84d3e242 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -2734,7 +2734,7 @@ static int hci_pause_advertising_sync(struct hci_dev *hdev) static int hci_resume_advertising_sync(struct hci_dev *hdev) { struct adv_info *adv, *tmp; - int err; + int err = 0; /* If advertising has not been paused there is nothing to do. */ if (!hdev->advertising_paused) @@ -2767,13 +2767,19 @@ static int hci_resume_advertising_sync(struct hci_dev *hdev) */ if (hci_dev_test_and_clear_flag(hdev, HCI_LE_ADV_0)) err = hci_enable_ext_advertising_sync(hdev, 0x00); - } else { + } else if (hdev->cur_adv_instance) { /* Schedule for most recent instance to be restarted and begin * the software rotation loop */ err = hci_schedule_adv_instance_sync(hdev, hdev->cur_adv_instance, true); + } else if (hci_dev_test_flag(hdev, HCI_ADVERTISING) && + !hci_dev_test_flag(hdev, HCI_LE_ADV)) { + /* hci_schedule_adv_instance_sync() rejects instance 0x00 while + * HCI_ADVERTISING is set, so enable it directly. + */ + err = hci_start_adv_sync(hdev, 0x00); } hdev->advertising_paused = false; -- 2.53.0