[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7kwwrrrjcpawhelmwnz5mebczre73lubjgl23sa2pc2skrlm4b@p3urdzakyhbv>
Date: Sun, 28 Dec 2025 01:34:24 +0200
From: Dmitry Baryshkov <dmitry.baryshkov@....qualcomm.com>
To: Shuai Zhang <shuai.zhang@....qualcomm.com>
Cc: Bartosz Golaszewski <brgl@...ev.pl>, Marcel Holtmann <marcel@...tmann.org>,
Luiz Augusto von Dentz <luiz.dentz@...il.com>,
linux-arm-msm@...r.kernel.org, linux-bluetooth@...r.kernel.org,
linux-kernel@...r.kernel.org, cheng.jiang@....qualcomm.com,
quic_chezhou@...cinc.com, wei.deng@....qualcomm.com,
jinwang.li@....qualcomm.com, mengshi.wu@....qualcomm.com
Subject: Re: [PATCH v4 1/1] Bluetooth: btqca: Add WCN6855 firmware priority
selection feature
On Fri, Dec 26, 2025 at 03:56:21PM +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.
>
> To code uniformity, move WCN7850 workaround to the caller.
>
> 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 <shuai.zhang@....qualcomm.com>
> ---
> drivers/bluetooth/btqca.c | 62 +++++++++++++++++++++++----------------
> 1 file changed, 37 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/bluetooth/btqca.c b/drivers/bluetooth/btqca.c
> index 7c958d606..81b0208cf 100644
> --- a/drivers/bluetooth/btqca.c
> +++ b/drivers/bluetooth/btqca.c
> @@ -581,28 +581,11 @@ static int qca_download_firmware(struct hci_dev *hdev,
>
> ret = request_firmware(&fw, config->fwname, &hdev->dev);
> if (ret) {
> - /* For WCN6750, if mbn file is not present then check for
> - * tlv file.
> - */
> - if (soc_type == QCA_WCN6750 && config->type == ELF_TYPE_PATCH) {
> - bt_dev_dbg(hdev, "QCA Failed to request file: %s (%d)",
> - config->fwname, ret);
> - config->type = TLV_TYPE_PATCH;
> - snprintf(config->fwname, sizeof(config->fwname),
> - "qca/msbtfw%02x.tlv", rom_ver);
> - bt_dev_info(hdev, "QCA Downloading %s", config->fwname);
> - ret = request_firmware(&fw, config->fwname, &hdev->dev);
> - if (ret) {
> - bt_dev_err(hdev, "QCA Failed to request file: %s (%d)",
> - config->fwname, ret);
> - return ret;
> - }
> - }
Separate commit, please. It's not related to WCN685x firmware name
change.
> /* If the board-specific file is missing, try loading the default
> * one, unless that was attempted already.
> */
> - else if (config->type == TLV_TYPE_NVM &&
> - qca_get_alt_nvm_file(config->fwname, sizeof(config->fwname))) {
> + if (config->type == TLV_TYPE_NVM &&
> + qca_get_alt_nvm_file(config->fwname, sizeof(config->fwname))) {
> bt_dev_info(hdev, "QCA Downloading %s", config->fwname);
> ret = request_firmware(&fw, config->fwname, &hdev->dev);
> if (ret) {
> @@ -847,8 +830,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),
> @@ -862,8 +849,26 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
>
> err = qca_download_firmware(hdev, &config, soc_type, rom_ver);
> if (err < 0) {
> - bt_dev_err(hdev, "QCA Failed to download patch (%d)", err);
> - return err;
> + /* For WCN6750, if mbn file is not present then check for tlv file.*/
> + if (soc_type == QCA_WCN6750 && config.type == ELF_TYPE_PATCH) {
If you scroll up, you will see that for WCN6750 at this point type
always is ELF_TYPE_PATCH, so the second part of the condition is
useless.
> + bt_dev_dbg(hdev, "QCA Failed to request file: %s (%d)",
> + config.fwname, err);
> + config.type = TLV_TYPE_PATCH;
> + snprintf(config.fwname, sizeof(config.fwname),
> + "qca/msbtfw%02x.tlv", rom_ver);
> + bt_dev_info(hdev, "QCA Downloading %s", config.fwname);
> + err = qca_download_firmware(hdev, &config, soc_type, rom_ver);
> + } else if (!rampatch_name && 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);
> + }
> +
> + if (err) {
> + bt_dev_err(hdev, "QCA Failed to request file: %s (%d)",
> + config.fwname, err);
> + return err;
> + }
> }
>
> /* Give the controller some time to get ready to receive the NVM */
> @@ -923,7 +928,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),
> @@ -937,8 +942,15 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
>
> 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;
> + 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;
> + }
> + }
> }
>
> switch (soc_type) {
> --
> 2.34.1
>
--
With best wishes
Dmitry
Powered by blists - more mailing lists