Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp9086472pxu; Mon, 28 Dec 2020 06:18:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJwE+nTQUIvKLJSUVTsIRtnSxnKtQrIusia/xv16pnqe0O1ivKzAclUEW3sca531AAELsw9y X-Received: by 2002:a50:bac4:: with SMTP id x62mr41647022ede.59.1609165092956; Mon, 28 Dec 2020 06:18:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1609165092; cv=none; d=google.com; s=arc-20160816; b=092plUYLjN/7x/62DSpXadDgZPvn4ifeSrC8AfvvV6UgspJA9JnxGkVIZsTdH8QEwn /RZ5VLYzeopj1xAwaGQGs9mA9Jd3EjNJLIpwCdnMFfXmvYs0b5+iqOyM+DAFOJINawnl va87VVecTvs6EA9BM1Vc9CsAxK5VZqpBWRBkUfMwRFxLQ9gIIlVCt28DMHpQrNLaunb4 IGELFAUWy0rBBpJ8aLehDpQlVOXa7wVzdJYZXY2EK2JuMHjZ3gOpANS6twpZjcY5RH/S RqIZNh23dJu4KC9yJuZyDfwVPIlLSXAPi80JSwtcaY8n1GEmBU9MRcfEjtm8XUTaWa8G v2TQ== 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=AxoyG+giPGLOlgmg0CAHbu8JsBE+aGJJKG0BUo8p3ys=; b=A81cpwmrtktnNM5hASDcPMuyFlLxSZaCDcpApLKByM5ibOj3c2L+NNufxUkQqJYCrr HoO3FQUfSJB+FrDFX0+FqxLKJBINAmZZX+IHTvG1SzeE+59tb89uh5hi1qKsq1tOdsHC OpYwEYsESgHQ0Ve8lwhjhj4OWu7N+1/U0GgyrIF2BjwZpm5yRk5DChGXF+FqZPWs+Wqg EDaErv+NM0cAWP4FosJjOj8CC+yRAfVORw+V/IWFqASGqiAaoxcuThZwWhUs2ZsOZwR+ Lif+I0XCNt12GnaTOw+jUfBEFM4GniU0boSkuFHQFOKevthjBz9ogIo2jDERtM4yDTy6 FXQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pfppLsom; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si20011569edq.329.2020.12.28.06.17.50; Mon, 28 Dec 2020 06:18:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=pfppLsom; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2440756AbgL1OPv (ORCPT + 99 others); Mon, 28 Dec 2020 09:15:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:50406 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440745AbgL1OPs (ORCPT ); Mon, 28 Dec 2020 09:15:48 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2C2F6229C6; Mon, 28 Dec 2020 14:15:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1609164932; bh=xw/Iij3mizGN/qFXcg3m4aUNkCXqNiN65UAqvml23bE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pfppLsomKfBtznZvivdoZSsLkrRD3JIjbAXIKRrwq5LRIlD/m03KuCdws99vog0cX 2b+u5tL6gcFna0c1aJX9FNlPZqy0FfROo0ki998Fr8jaVizdyRewD82uk1cvrtIWvD ukjOUEPXKJCrxTeMWMfzup/J9bQjmU4m12Bagaqg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Marcel Holtmann , Johan Hedberg , Sasha Levin Subject: [PATCH 5.10 343/717] Bluetooth: btusb: Fix detection of some fake CSR controllers with a bcdDevice val of 0x0134 Date: Mon, 28 Dec 2020 13:45:41 +0100 Message-Id: <20201228125037.459860075@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201228125020.963311703@linuxfoundation.org> References: <20201228125020.963311703@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit d74e0ae7e03032b47b8631cc1e52a7ae1ce988c0 ] Commit cde1a8a99287 ("Bluetooth: btusb: Fix and detect most of the Chinese Bluetooth controllers") made the detection of fake controllers more generic fixing it for much of the newer fakes / clones. But this does not work for a fake CSR controller with a bcdDevice value of 0x0134, which was correctly identified as fake before this change. Add an extra check for this special case, checking for a combination of a bcdDevice value of 0x0134, together with a lmp_subver of 0x0c5c and a hci_ver of BLUETOOTH_VER_2_0. The chip inside this fake dongle is marked as with "clockwise cw6629d". Fixes: cde1a8a99287 ("Bluetooth: btusb: Fix and detect most of the Chinese Bluetooth controllers") Signed-off-by: Hans de Goede Signed-off-by: Marcel Holtmann Signed-off-by: Johan Hedberg Signed-off-by: Sasha Levin --- drivers/bluetooth/btusb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index a9981678199d7..80468745d5c5e 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -1763,6 +1763,8 @@ static int btusb_setup_bcm92035(struct hci_dev *hdev) static int btusb_setup_csr(struct hci_dev *hdev) { + struct btusb_data *data = hci_get_drvdata(hdev); + u16 bcdDevice = le16_to_cpu(data->udev->descriptor.bcdDevice); struct hci_rp_read_local_version *rp; struct sk_buff *skb; bool is_fake = false; @@ -1832,6 +1834,12 @@ static int btusb_setup_csr(struct hci_dev *hdev) le16_to_cpu(rp->hci_ver) > BLUETOOTH_VER_4_0) is_fake = true; + /* Other clones which beat all the above checks */ + else if (bcdDevice == 0x0134 && + le16_to_cpu(rp->lmp_subver) == 0x0c5c && + le16_to_cpu(rp->hci_ver) == BLUETOOTH_VER_2_0) + is_fake = true; + if (is_fake) { bt_dev_warn(hdev, "CSR: Unbranded CSR clone detected; adding workarounds..."); -- 2.27.0