From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (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 94C9A2D23B1 for ; Wed, 24 Dec 2025 06:54:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766559275; cv=none; b=cOLLHrYkaZ3kjUUVJ/JECOlsS0ih1E4K4C7P1MpNIVLHN26ca8oFM+63lyuHiEjO9ytUVKrIsdS8voxJH1X6QaPfyCJkPfaDjZPO1S5B0BtRYZ/whcB2700/VFv9iOVInCAp6BCiDfNtuMX0ot2pFCK1Tm3e/A9RnEzMC4sTQZM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766559275; c=relaxed/simple; bh=so7ejs/tXD+v18SWqcbAQpatqZhSQdyisz6wolGvqKE=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=Wg6Eq2wwt67cilSFheo9Ausxvon5d2QOH2MGDTcu+sAjwiu3EwGCcus8tFLD3SNgV5g69xvRmWHem1n32vV86HdVqzLium6RG4UPpUmCI/dgzmgIvLgx9j7tRQBYZgCUHNWlWbcURB+DfEq6SwVvlR9GIiMpEKvyJk8PuN5EppQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Qxd5vU9z; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=YpwJjy8/; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Qxd5vU9z"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="YpwJjy8/" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 5BO6PNBS678225 for ; Wed, 24 Dec 2025 06:54:32 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 34Okt0JF9BBw4/qZVJvVGZbHMv8GtHzwox7/u8MrpdM=; b=Qxd5vU9zdW3UDyCC m3QFdV5BDulsLiIns3bfYQKhadQ1iIyvj7s2Sc4NzovZWLqrsXHcjxc7h/oNBBRv sj42hazzEdF7HVO3QIIxsATa5fGGWWBr57GLzQSRlamHHhLLJKm/feEuJPhkCs3/ INrOolQpO/uplAHcgTDBkapaHk/CVn4kobtdaJ8d/prqgrAVgD6LqUwB+NENoyPz OLIBFel3SRv2NtCsQaseVyIrBVA9rifnB0+cJJdr5Hx9C2DD8C87S2ckucl0E//m r6vmi8QNFVCrETcz6H/xac7s5eLDVdCojC1l6XKHbXysHPfpYtV9c0xvVbzvqtek UQEjgg== Received: from mail-pg1-f198.google.com (mail-pg1-f198.google.com [209.85.215.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4b7yvq1tps-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 24 Dec 2025 06:54:31 +0000 (GMT) Received: by mail-pg1-f198.google.com with SMTP id 41be03b00d2f7-b609c0f6522so9896938a12.3 for ; Tue, 23 Dec 2025 22:54:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1766559271; x=1767164071; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=34Okt0JF9BBw4/qZVJvVGZbHMv8GtHzwox7/u8MrpdM=; b=YpwJjy8/LmmUddrQVFuje6RoOKceOYF3aTzHwvuC2N9SpbRB2HAFFZRiJggZLkv6sK DzAESa8PQ26EkXgOTbiyrRSxfQ677Jfwik1Hb6HuFTMsTg6LkEX/OmpiRz/uD0JRIIFS osyXXSWnSx2WhL7Pw0avw8oXSj+ZJW/iWyW1d8TijOdJJTEPGj50moENw0C3I5QKv7VV AvvUcV56BfDB+pR+jYkZ2A08zM2Z3sxjlGWF3tOcwXFllHJqBmDBRVlMFOuWk4yWPOp6 uhH1qYQkKpFgHJsmr6TTk37aRNCi4qpX9R4ItTb8m/t3/+StzZubWXDLokveB+AsXtod xdNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1766559271; x=1767164071; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=34Okt0JF9BBw4/qZVJvVGZbHMv8GtHzwox7/u8MrpdM=; b=VmzbwsDp4i17xbyjFATJVODcVcZQ+TnVTj5tgHd/9VKagyAxytXAJXLED1UqwsIZ+n N0w6dDwCjzbhYYwCGd08GvtMvPbRbELiUCXEWPhOXO+zm5qD2SkFu/4mT75/GNNeG8PD 5yK8gb7CrVtOf/RD12SotUSOZ0GM8QPeFCi/imE+w4QO/k6DZBGxPKP0n2P0igL9rIxG aMsQyDzO3ZM1WcE8WlRui3SBGaeg2ttwvop/nJB//oyg1UW66W13GKa0LouffseuQluY uhzsxxdnr5KpSlthPniesAbN5JGVord7fm2bqbvmMR1KOXsXbYYCvwEMhCk2yTw83uWW zrwQ== X-Forwarded-Encrypted: i=1; AJvYcCWg1dcX2zd7fkjl+XcWzDv75AlWgjpL3e3hjNikrEFMzHlQWxzW3WkNdi/vMk3xfBzAxXxa8WzYYP929mU=@vger.kernel.org X-Gm-Message-State: AOJu0YwGwUPdClgNaWiTjkyyvjKNT1O4RiDwZ8rsArAEchpJvPUCLlm3 miA/bKtPQnASjNJeHQ7tgtJ9xMZYg1xNFF8S6WJRzra1YpzZRmR1H9aaJylOmB8NyjMOE7FPw8o AaBdVGa7R/GvRRfsppxUM7Ow9262dtl4iypSGQ88laz/S8RNLjqD9GxVpJDnMDmA/cRM= X-Gm-Gg: AY/fxX544/7imCqkQYRtbP8yOCemvT2aO0TNgfWXDg5bxz2aSMSn2kXYtXxpM7+CYiD Sc/i6BXDgIdID+x6iYpY0K8D8qf6FZpUj7aIyAUN2CozYwyfCY+AacwhJRooFmsdNGiDJdvMr0o jGOCUERF9daLaZBKZPeyQBwcn+Hs9P1lhNMdVFwfIcIOd5wdbDQV/kuvKUNISGehNH9ig1wKNQb V3q47Gf8y5pv+fPi7hm9olkRB4Br7xsV5sb5ogDNYti88sTAqiykemODyi/48hC3ZN8g3ziljGl uGhUsqHtx1rcGkcFJW5MK6l9JxZTq3kirjJdSqhpgBs5n2tvOTwHjgj3HmCAYmP/PeSMRAIwcpZ +7k59qZTCWejjwUYPgS1+OMlF1edreoCyJyYkMhpxIm4K0vR634mal4c07A3VxS0= X-Received: by 2002:a05:7022:4089:b0:11b:9386:8264 with SMTP id a92af1059eb24-121722ed029mr16013618c88.41.1766559270854; Tue, 23 Dec 2025 22:54:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFZHmNsSPH6NKM+ismOIXjTLrl9nL+cZrkSk6A/E8HhMhoy5SFYbFs0Pn0v/AjsbVdXeXH3cg== X-Received: by 2002:a05:7022:4089:b0:11b:9386:8264 with SMTP id a92af1059eb24-121722ed029mr16013598c88.41.1766559270243; Tue, 23 Dec 2025 22:54:30 -0800 (PST) Received: from [10.110.49.95] (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-121724de268sm49331825c88.8.2025.12.23.22.54.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 23 Dec 2025 22:54:29 -0800 (PST) Message-ID: Date: Wed, 24 Dec 2025 14:54:24 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/1] Bluetooth: btqca: Add WCN6855 firmware priority selection feature To: Dmitry Baryshkov Cc: Bartosz Golaszewski , Marcel Holtmann , Luiz Augusto von Dentz , linux-arm-msm@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, cheng.jiang@oss.qualcomm.com, quic_chezhou@quicinc.com, wei.deng@oss.qualcomm.com References: <20251117021645.712753-1-shuai.zhang@oss.qualcomm.com> <20251117021645.712753-2-shuai.zhang@oss.qualcomm.com> Content-Language: en-US From: Shuai Zhang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-ORIG-GUID: LewZazGKzjK17lJw9e8Z_xh-SSD_qk8C X-Authority-Analysis: v=2.4 cv=abZsXBot c=1 sm=1 tr=0 ts=694b8e27 cx=c_pps a=Qgeoaf8Lrialg5Z894R3/Q==:117 a=JYp8KDb2vCoCEuGobkYCKw==:17 a=IkcTkHD0fZMA:10 a=wP3pNCr1ah4A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=NEAV23lmAAAA:8 a=EUspDBNiAAAA:8 a=33pz77RsE4FNkTIxbK4A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=x9snwWr2DeNwDh03kgHS:22 X-Proofpoint-GUID: LewZazGKzjK17lJw9e8Z_xh-SSD_qk8C X-Proofpoint-Spam-Details-Enc: AW1haW4tMjUxMjI0MDA1NyBTYWx0ZWRfX7nyQq90sOnvr arUvrmVV7aOxEiHdcZ9VxEDP77SzTBr+xVC0qS3sDD8RbQmtGFxpGO8H0lc2ahdEwAENpgsu2YU w5rNLfHlGWb7YHNFTHXQyk8Kmfrr/1koQzks4/oEeFYlNy+xTRpVCT3MfYCrr2ZxpHm49N1bsv5 49NYSSNzWbK0dA1iF9ekXlrIdlnmgr6+Z/sZbNR+UD8hUg7VVXxV9t19fuwsTOWmxDBIdghHSp/ 66uGHMHlPBQxumnF1je1Go2LZFGQBAEvTyTpQlm/on2vRbebR0Gewzr3kUU4hINdKgM5K54tg6D chcFMBP1UJPThiQ8FSCarq6be9OwcrtcF7mdA+OT84GH3DOCcu4rL+TqsgLFY1KojX2AVPgQQ1X 3gqtcEBgL5ANpffnnjwLmJMKYXSoYRw3YS/UQ+mMU4BULMr4B0Umioqg9X3jLzLBYCTHyzbl7Rl TxBk7dsAqKnwc37uMqQ== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2025-12-24_02,2025-12-22_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 priorityscore=1501 lowpriorityscore=0 bulkscore=0 spamscore=0 clxscore=1015 malwarescore=0 phishscore=0 suspectscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2512240057 On 12/24/2025 12:23 PM, Dmitry Baryshkov wrote: > On Tue, Dec 23, 2025 at 10:03:44AM +0800, Shuai Zhang wrote: >> Hi Dmitry >> >> On 12/21/2025 11:21 PM, Dmitry Baryshkov wrote: >>> On Fri, Dec 19, 2025 at 05:19:30PM +0800, Shuai Zhang wrote: >>>> Hi Dmitry >>>> >>>> On 11/19/2025 3:59 PM, Dmitry Baryshkov wrote: >>>>> On Mon, Nov 17, 2025 at 10:16:45AM +0800, Shuai Zhang wrote: >>>>>> Historically, WCN685x and QCA2066 shared the same firmware files. >>>>>> Now, changes are planned for the firmware that will make it incompatible >>>>>> with QCA2066, so a new firmware name is required for WCN685x. >>>>>> >>>>>> Test Steps: >>>>>> - Boot device >>>>>> - Check the BTFW loading status via dmesg >>>>>> >>>>>> Sanity pass and Test Log: >>>>>> QCA Downloading qca/wcnhpbftfw21.tlv >>>>>> Direct firmware load for qca/wcnhpbftfw21.tlv failed with error -2 >>>>>> QCA Downloading qca/hpbftfw21.tlv >>>>>> >>>>>> Signed-off-by: Shuai Zhang >>>>>> --- >>>>>> drivers/bluetooth/btqca.c | 22 ++++++++++++++++++++-- >>>>>> 1 file changed, 20 insertions(+), 2 deletions(-) >>>>>> >>>>>> diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c >>>>>> index 7c958d606..8e0004ef7 100644 >>>>>> --- a/drivers/bluetooth/btqca.c >>>>>> +++ b/drivers/bluetooth/btqca.c >>>>>> @@ -847,8 +847,12 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, >>>>>> "qca/msbtfw%02x.mbn", rom_ver); >>>>>> break; >>>>>> case QCA_WCN6855: >>>>>> + /* Due to historical reasons, WCN685x chip has been using firmware >>>>>> + * without the "wcn" prefix. The mapping between the chip and its >>>>>> + * corresponding firmware has now been corrected. >>>>>> + */ >>>>>> snprintf(config.fwname, sizeof(config.fwname), >>>>>> - "qca/hpbtfw%02x.tlv", rom_ver); >>>>>> + "qca/wcnhpbtfw%02x.tlv", rom_ver); >>>>>> break; >>>>>> case QCA_WCN7850: >>>>>> snprintf(config.fwname, sizeof(config.fwname), >>>>>> @@ -861,6 +865,13 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, >>>>>> } >>>>>> err = qca_download_firmware(hdev, &config, soc_type, rom_ver); >>>>>> + >>>>>> + if (!rampatch_name && err < 0 && soc_type == QCA_WCN6855) { >>>>>> + snprintf(config.fwname, sizeof(config.fwname), >>>>>> + "qca/hpbtfw%02x.tlv", rom_ver); >>>>>> + err = qca_download_firmware(hdev, &config, soc_type, rom_ver); >>>>>> + } >>>>> Is there a reason for ignoring how it was done already for other cases when >>>>> we need a similar fallback? Please extend the existing code (or rewrite >>>>> it) instead of adding a similar hook at a completely different place. >>>> Current Strategy (when DTS does not specify rampatch and firmware): >>>>     Rampatch: Load the rampatch based on soc_type. >>>>     NVM:  Load the NVM with board_id based on soc_type. >>>>                 If the file corresponding to board_id does not exist, then >>>> load the NVM file ending with .bin. >>>>     For HSP (new requirement): >>>>         First, load the rampatch/NVM files wcnhpbtfw and wcnhpnv. >>>>         If not found: >>>>         Rampatch: Fall back to loading the hpbtfw rampatch file. >>>>         NVM:  Starting from wcnhpnv.bxxx, load the NVM file ending with >>>> .bin. >>>>                     If still not found, look for hpnv.bxxx and then apply >>>> the above NVM strategy again (soc_type(board_id)  to .bin). >>>> >>>> The current changes are based on the original implementation, which should >>>> make them the clearest modifications. >>>> Please review according to the existing strategy, and feel free to let me >>>> know if you have any questions. >>> qca_download_firmware() has workaround code for WCN6750, loading TLV >>> file if MBN is not present. It doesn't make sense to have similar >>> workardounds in two different places. Could you please unify code >>> (either by moving existing code or by moving your workaround). >> I tried to move the changes into |qca_download_firmware|, but it conflicts >> with the logic for >> loading the default NVM. Specifically, when there is no NVM corresponding to >> the board_id, >> it will not load the |.bin| NVM file. I’m not sure whether this limitation >> is within a controllable range. >> >> https://github.com/shuaz-shuai/Add-WCN6855-firmware-priority-selection-feature > So, the solution is to move the quirk for WCN6750 out of > qca_download_firmware(). I’m not entirely clear on the rationale for removing WCN6750, as our current discussion focuses on handling WCN6855. If the logic for loading hpbtfw.tlv and hpnv.bxxx when wcnhpbtfw.tlv and wcnhpnv.bxxx are missing is moved into qca_download_firmware(), it won’t affect the firmware (hpbtfw.tlv). However, for NVM, if loading hpnv.bxxx fails, the hpnv.bin file will also not be loaded, which is a defect. This is why I prefer retaining the V3 changes. Please let me know if you have any concerns or questions. >>>>>> + >>>>>> if (err < 0) { >>>>>> bt_dev_err(hdev, "QCA Failed to download patch (%d)", err); >>>>>> return err; >>>>>> @@ -923,7 +934,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, >>>>>> case QCA_WCN6855: >>>>>> qca_read_fw_board_id(hdev, &boardid); >>>>>> qca_get_nvm_name_by_board(config.fwname, sizeof(config.fwname), >>>>>> - "hpnv", soc_type, ver, rom_ver, boardid); >>>>>> + "wcnhpnv", soc_type, ver, rom_ver, boardid); >>>>>> break; >>>>>> case QCA_WCN7850: >>>>>> qca_get_nvm_name_by_board(config.fwname, sizeof(config.fwname), >>>>>> @@ -936,6 +947,13 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate, >>>>>> } >>>>>> err = qca_download_firmware(hdev, &config, soc_type, rom_ver); >>>>>> + >>>>>> + if (!firmware_name && err < 0 && soc_type == QCA_WCN6855) { >>>>>> + qca_get_nvm_name_by_board(config.fwname, sizeof(config.fwname), >>>>>> + "hpnv", soc_type, ver, rom_ver, boardid); >>>>>> + err = qca_download_firmware(hdev, &config, soc_type, rom_ver); >>>>>> + } >>>>>> + >>>>>> if (err < 0) { >>>>>> bt_dev_err(hdev, "QCA Failed to download NVM (%d)", err); >>>>>> return err; >>>>>> -- >>>>>> 2.34.1 >>>>>> >>>> Thanks, >>>> Shuai