From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E7887268FD7; Thu, 3 Apr 2025 19:05:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743707155; cv=none; b=DbxZICA5vGp9kH2hM5gn1gFK/uBlKe2O1HVm1TcC2tZQE6JD154dz/Nu/vjrAIhts8fSTPk+BHu4FG5awvLbZXKFw25HbAOY20LQw22+mW16Ib21yR5vzMRRfDJeGYgJ/k6ahZVLMxcLQMYP8Ah/2zPbE2CQ1K5hrWBB0a7KQFQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743707155; c=relaxed/simple; bh=pbn86FTWVBRDEjw1khVpontfVhI57wkmC0bHWaQKsv4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=kHX7w9+H1/dEtjPVKoeWMk45RdeYV8tok1vj2UhcE0vZOBL7GsqzVEA8NR93JdH2llhKPZt4V3kZ5iBgQuvhZUfW2qiCWanJwJf7a7dhUINRSBo3o/E4FW09HvvivbDmMMBldilS1juJ6Rcclr3eB+MVKtwhnRKuKdbtoiEEZWs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EE6KPY94; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EE6KPY94" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E42E0C4CEE3; Thu, 3 Apr 2025 19:05:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743707154; bh=pbn86FTWVBRDEjw1khVpontfVhI57wkmC0bHWaQKsv4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EE6KPY94/dkiny3KBso8Fo+CZ/Ke3maDYFWrY1y1uhbdm2IAeeegjs2B1j7RHsSug 1PTwrP1Tbu29daxZZw8gl61V/MWStsVoJfl3qvK+4U1fdqRF8zN3JM7GVyvXu+QUyX TZLE6+FJnCjHbGOapMiACBNRuQMTXM1ku9O1yGJXi5znfsxSPYnim73QoTdz0DsVJR gIs/glnA30YU74iH1GsOt/OuaULBOhBbvwWdKDzG/Nt6Cms7OEdKm7ufossvGa33lI WE2/LnWl36D5yzhMdbO6LY1B9qSTXxgIofL5o3agPUssaKH/NayJgiDzenxpaedmEH P+Gut0oF337Lg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Pedro Nishiyama , Luiz Augusto von Dentz , Sasha Levin , marcel@holtmann.org, johan.hedberg@gmail.com, luiz.dentz@gmail.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org Subject: [PATCH AUTOSEL 6.13 49/49] Bluetooth: Add quirk for broken READ_PAGE_SCAN_TYPE Date: Thu, 3 Apr 2025 15:04:08 -0400 Message-Id: <20250403190408.2676344-49-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250403190408.2676344-1-sashal@kernel.org> References: <20250403190408.2676344-1-sashal@kernel.org> Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.13.9 Content-Transfer-Encoding: 8bit From: Pedro Nishiyama [ Upstream commit 127881334eaad639e0a19a399ee8c91d6c9dc982 ] Some fake controllers cannot be initialized because they return a smaller report than expected for READ_PAGE_SCAN_TYPE. Signed-off-by: Pedro Nishiyama Signed-off-by: Luiz Augusto von Dentz Signed-off-by: Sasha Levin --- include/net/bluetooth/hci.h | 8 ++++++++ net/bluetooth/hci_sync.c | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 6f06d20093a7a..8d4c5cb1496c9 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h @@ -362,6 +362,14 @@ enum { * This quirk must be set before hci_register_dev is called. */ HCI_QUIRK_BROKEN_READ_VOICE_SETTING, + + /* When this quirk is set, the HCI_OP_READ_PAGE_SCAN_TYPE command is + * skipped. This is required for a subset of the CSR controller clones + * which erroneously claim to support it. + * + * This quirk must be set before hci_register_dev is called. + */ + HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE, }; /* HCI device flags */ diff --git a/net/bluetooth/hci_sync.c b/net/bluetooth/hci_sync.c index bb455e96a715a..cb4d47ae129e8 100644 --- a/net/bluetooth/hci_sync.c +++ b/net/bluetooth/hci_sync.c @@ -4156,7 +4156,8 @@ static int hci_read_page_scan_type_sync(struct hci_dev *hdev) * support the Read Page Scan Type command. Check support for * this command in the bit mask of supported commands. */ - if (!(hdev->commands[13] & 0x01)) + if (!(hdev->commands[13] & 0x01) || + test_bit(HCI_QUIRK_BROKEN_READ_PAGE_SCAN_TYPE, &hdev->quirks)) return 0; return __hci_cmd_sync_status(hdev, HCI_OP_READ_PAGE_SCAN_TYPE, -- 2.39.5