Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2307800lqo; Mon, 20 May 2024 01:23:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUEne7CZ5F/gm/mgkSG9KMoUYzJuEU2VtyetQUIn2ljdVyLJAA207p/dgs0JDyrgjefTmMP+QHTrgqyIS8HMYT91XEhirdXNc3APctVzg== X-Google-Smtp-Source: AGHT+IGZtxISFx4sWt1uSW0Hdv926gBahAyakI93nB7GldYlMsmsmb/om1XYvpUfoxtiZGNJe/Pl X-Received: by 2002:ac2:596a:0:b0:523:a5b3:5e1d with SMTP id 2adb3069b0e04-523a5b35f2amr8078778e87.10.1716193390023; Mon, 20 May 2024 01:23:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716193389; cv=pass; d=google.com; s=arc-20160816; b=QYonIM+R7em6oDPn7HcA2VuiwTppSph/irs0bJJWEOq12LbDq3M8GeZVc76fJBwzWH 7A3OsLjuwBywB4720ikU2yPfHG8POfCkwVmyOopipN9mw/a2i2Jq/qUvKnXuKwQ6JZjP 1+oMnzuerocXlUlyktcBg262azD+WEWtPtZy0FXpCKwQvuj99N1CoVUsS6mqEj5ikcA5 jn7iavvTb8YvYKInDcTkXdTV7Ts6BVswx3QWif5tORIW0uixxWwx9l23325t2e6k8LAl 5zutko49OFO9UUuBxdhu1KkkSMya25VrwjPWMFg+RCnIU+sr3tZAh311rn6cS5J+HUVE i/JA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :content-transfer-encoding:content-language:accept-language :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=xxyfwzj4YG0tPEZ/3bUqnoDgX/g24irPCw+Lds2NfTM=; fh=G5+6GkmkL6xw+q8DAY0zKVxK0r3P443Z+RSnCjSWUX0=; b=pWAXs7PuR9upwOkOCRQ3lz3z/zm3tjHb2PramDJxTWkpcXwRXxHI7z/Kd+VyjEEqWY 3U/kKbAQ5hurfJyMDvEz1lif3Y2n93z+8CKgXR2+EDC7aaezoK2O4mxHbrm79v1AU7is udTYZLHOTCPFoaVuiXYwnS88i7d8W2b+ps+5JeTDbt8YC/0UDqOUp+lhl+ob0UqagHun K3tHWu1GRtBBtipEsa/zRnXKSQTZHuzc2F4eGikAINFfKFxJxPJ/ya7aXTTiJ8sRpqoC NLnJdXR4ZhKra/eVGuhptz0VrCvU6A43QNuXKaoZb0odZn3l67QWYfVT6TGVurOpFEE2 NJ4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infineon.com header.s=IFXMAIL header.b=TPqoTGqq; arc=pass (i=1 spf=pass spfdomain=infineon.com dkim=pass dkdomain=infineon.com dmarc=pass fromdomain=infineon.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4797-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4797-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=infineon.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17bd56bbsi1298310466b.702.2024.05.20.01.23.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 01:23:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-bluetooth+bounces-4797-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infineon.com header.s=IFXMAIL header.b=TPqoTGqq; arc=pass (i=1 spf=pass spfdomain=infineon.com dkim=pass dkdomain=infineon.com dmarc=pass fromdomain=infineon.com); spf=pass (google.com: domain of linux-bluetooth+bounces-4797-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-bluetooth+bounces-4797-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=infineon.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 8D64E1F21491 for ; Mon, 20 May 2024 08:23:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E57E71BC58; Mon, 20 May 2024 08:23:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=infineon.com header.i=@infineon.com header.b="TPqoTGqq" X-Original-To: linux-bluetooth@vger.kernel.org Received: from smtp9.infineon.com (smtp9.infineon.com [217.10.52.204]) (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 4AAED1BC23 for ; Mon, 20 May 2024 08:23:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.10.52.204 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716193383; cv=none; b=c1KOOodmYTmdiy6jLhxeLSprzNVwrqv08GmNnQ7SbCKGYXxCNOrw7QC6qst9BwW3Z5iPdEd/lV+leWHl9RAQQ5ULG/Z+48Jgv5zIgEAYqpqLTu3AsDian0bqtrFg0S0aYxUHg0p2iAsOLCnsbPIiKje2HPPj7/ATufb+PNEcsME= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716193383; c=relaxed/simple; bh=bGAyD3ixI6iTBtEyZPh/mmBmmc00y8EuZD435YwkgKg=; h=From:To:CC:Subject:Date:Message-ID:Content-Type:MIME-Version; b=ULnpiByqx3am0VRHLF58J/3/5MfITYBIMgQ9LdCmUhMTXEKrHlHfa3m0s72YGIfaWXDwiODgi+RvaCIjbpL/RXF/s05NvoeNSD5KU1cgxBOYOHyWoepbKPVtIRFnvdpHqIksvkhFNHUyXqm8IRDk8Jr04Wz5lqkczOaDRKRn8vY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infineon.com; spf=pass smtp.mailfrom=infineon.com; dkim=pass (1024-bit key) header.d=infineon.com header.i=@infineon.com header.b=TPqoTGqq; arc=none smtp.client-ip=217.10.52.204 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infineon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=infineon.com DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=infineon.com; i=@infineon.com; q=dns/txt; s=IFXMAIL; t=1716193382; x=1747729382; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=bGAyD3ixI6iTBtEyZPh/mmBmmc00y8EuZD435YwkgKg=; b=TPqoTGqq1XIxiYN+cRfVWfy9VUNsqvVoN4Duxmp2Dr8XVSKKCrELd4wE MlKlQjaL+aDpBa4PmBwlyfHvbPzzQ650VyQkUYlMMMQpQt5+rrRgTNMo8 izzwKko4oOsbQRo3lvjNuw1t6SLugFrd5pfnP+qglqesm5SP8nEnQMWCW 8=; X-IronPort-AV: E=McAfee;i="6600,9927,11077"; a="19490355" X-IronPort-AV: E=Sophos;i="6.08,174,1712613600"; d="scan'208";a="19490355" Received: from unknown (HELO MUCSE812.infineon.com) ([172.23.29.38]) by smtp9.infineon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2024 10:22:54 +0200 Received: from MUCSE837.infineon.com (172.23.7.109) by MUCSE812.infineon.com (172.23.29.38) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 20 May 2024 10:22:53 +0200 Received: from MUCSE832.infineon.com (172.23.7.104) by MUCSE837.infineon.com (172.23.7.109) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 20 May 2024 10:22:52 +0200 Received: from MUCSE832.infineon.com ([fe80::6918:9b7d:1c9c:3175]) by MUCSE832.infineon.com ([fe80::6918:9b7d:1c9c:3175%15]) with mapi id 15.02.1118.040; Mon, 20 May 2024 10:22:52 +0200 From: To: , CC: Subject: [PATCH v2] Patch for CYW4373 hci up fail issue Thread-Topic: [PATCH v2] Patch for CYW4373 hci up fail issue Thread-Index: Adqqjj3ae2mX8VZUTA2IVSUTW9hBaw== Date: Mon, 20 May 2024 08:22:52 +0000 Message-ID: <016dd2b28cd5435ba6f13b01d4da0d44@infineon.com> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-bluetooth@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 CYW4373 ROM FW has an issue that it claims LE_Read_Transmit_Power command a= s supported in a response of Read_Local_Supported_Command command but rejects the LE_Read_Transmit_Po= wer command with "Unknown HCI Command" status. Due to the issue, Bluetooth driver of 5.15 and later kernel fails to hci up= . Especially in USB i/f case, it would be difficult to download patch FW that= includes Its fix unless hci is up. The patch forces the driver to skip LE_Read_Transmit_Power Command when it = detects CYW4373 with ROM FW build. Signed-off-by: Nobuaki Tsunashima --- V1 -> V2: Fix several coding style warnings. drivers/bluetooth/btbcm.c | 33 ++++++++++++++++++++++++++++++++- drivers/bluetooth/btusb.c | 4 ++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c index 0a5445ac5e1b..da4718a268d0 100644 --- a/drivers/bluetooth/btbcm.c +++ b/drivers/bluetooth/btbcm.c @@ -437,18 +437,49 @@ static const struct dmi_system_id disable_broken_read= _transmit_power[] =3D { { } }; =20 +struct bcm_chip_version_table { + u8 chip_id; + u16 baseline; +}; +#define BCM_ROMFW_BASELINE_NUM 0xFFFF +static const struct bcm_chip_version_table disable_broken_read_transmit_po= wer_by_chip_ver[] =3D { + {0x87, BCM_ROMFW_BASELINE_NUM} /* CYW4373/4373E */ +}; +static bool btbcm_is_disable_broken_read_tx_power_by_chip_ver(u8 chip_id, = u16 baseline) +{ + int i; + int table_size =3D ARRAY_SIZE(disable_broken_read_transmit_power_by_chip_= ver); + const struct bcm_chip_version_table *entry =3D=20 + &disable_broken_read_transmit_power_by_chip_ver[0]; + + for (i =3D 0 ; i < table_size ; i++, entry++) + { + if ((chip_id =3D=3D entry->chip_id) && (baseline =3D=3D entry->baseline)= ) + return true; + } + + return false; +} + static int btbcm_read_info(struct hci_dev *hdev) { struct sk_buff *skb; + u8 chip_id; + u16 baseline; =20 /* Read Verbose Config Version Info */ skb =3D btbcm_read_verbose_config(hdev); if (IS_ERR(skb)) return PTR_ERR(skb); - + chip_id =3D skb->data[1]; + baseline =3D skb->data[3] | (skb->data[4] << 8); bt_dev_info(hdev, "BCM: chip id %u", skb->data[1]); kfree_skb(skb); =20 + /* Check Chip ID and disable broken Read LE Min/Max Tx Power */ + if (btbcm_is_disable_broken_read_tx_power_by_chip_ver(chip_id, baseline)) + set_bit(HCI_QUIRK_BROKEN_READ_TRANSMIT_POWER, &hdev->quirks); + return 0; } =20 diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index d31edad7a056..52561c8d8828 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -142,6 +142,10 @@ static const struct usb_device_id btusb_table[] =3D { { USB_VENDOR_AND_INTERFACE_INFO(0x04ca, 0xff, 0x01, 0x01), .driver_info =3D BTUSB_BCM_PATCHRAM }, =20 + /* Cypress devices with vendor specific id */ + { USB_VENDOR_AND_INTERFACE_INFO(0x04b4, 0xff, 0x01, 0x01), + .driver_info =3D BTUSB_BCM_PATCHRAM }, + /* Broadcom devices with vendor specific id */ { USB_VENDOR_AND_INTERFACE_INFO(0x0a5c, 0xff, 0x01, 0x01), .driver_info =3D BTUSB_BCM_PATCHRAM }, --=20 2.25.1