All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Madhavan Ganesan" <madhavan.ganesan@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH ath-next v4 03/14] wifi: ath12k: add QMI support for extended firmware binary download
Date: Tue, 24 Nov 2026 16:58:16 +0000	[thread overview]
Message-ID: <sashiko-outbox-231632@kernel.org> (raw)
In-Reply-To: <20261124-wifi8_qcn9575_bringup-v4-3-1f5b87ece6a3@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] wifi: ath12k: missing support check in
  ath12k_qmi_request_target_cap()
--

commit 0ad2dc5f1d6c66c21dfaf536a6cc18a2499967aa
Author: Madhavan Ganesan <madhavan.ganesan@oss.qualcomm.com>

wifi: ath12k: add QMI support for extended firmware binary download

This commit adds QMI support for downloading multiple firmware binaries
(M3, AUX uC, and MCSS uC) in a single combined request via
QMI_WLANFW_EXT_FW_BIN_DOWNLOAD_REQ_V01 when advertised by the target.

> diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
> index 69512b82aa3b3..3b60d624b0aa5 100644
> --- a/drivers/net/wireless/ath/ath12k/qmi.c
> +++ b/drivers/net/wireless/ath/ath12k/qmi.c

[ ... ]

> @@ -3115,6 +3289,27 @@ int ath12k_qmi_request_target_cap(struct ath12k_base *ab)
>  		}
>  	}
>  
> +	if (resp.ext_fw_bin_download_support_valid &&
> +	    resp.ext_fw_bin_download_bitmap_valid) {
> +		ab->qmi.ext_fw_bin_download_bitmap =
> +			resp.ext_fw_bin_download_bitmap;
> +		ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi extended firmware bin download bitmap 0x%x\n",
> +			   resp.ext_fw_bin_download_bitmap);
> +
> +		if (ab->qmi.ext_fw_bin_download_bitmap &
> +		    ~QMI_WLANFW_EXT_FW_BIN_TYPE_HOST_SUPPORTED_MASK) {
> +			ath12k_warn(ab, "Invalid ext_fw_bin_download_bitmap 0x%x, host-unsupported bits set\n",
> +				    ab->qmi.ext_fw_bin_download_bitmap);
> +			ret = -EINVAL;
> +			goto out;
> +		}
> +		ab->qmi.ext_fw_bin_download_support = !!resp.ext_fw_bin_download_support;
> +		ath12k_dbg(ab, ATH12K_DBG_QMI, "qmi extended firmware bin download supported\n");
> +	} else {
> +		ab->qmi.ext_fw_bin_download_support = false;
> +		ab->qmi.ext_fw_bin_download_bitmap = 0;
> +	}
> +

[Severity: Medium]
Should this condition also check resp.ext_fw_bin_download_support before
validating and storing the bitmap?

QMI_OPT_FLAG sets ext_fw_bin_download_support_valid to 1 whenever TLV 0x2B
is present on the wire, even if resp.ext_fw_bin_download_support is 0.
When firmware sends both TLVs with ext_fw_bin_download_support == 0,
ath12k_qmi_request_target_cap() still enters this branch, stores and
validates the unused bitmap (failing with -EINVAL if any unsupported bits
are set), and logs that extended download is supported.

Conversely, if ext_fw_bin_download_support is non-zero and
ext_fw_bin_download_bitmap is 0, the mask check passes here and defers
failure until ath12k_qmi_wlanfw_ext_fw_bin_mem_info_send() after regdb,
board data, and calibration data have already been downloaded.

In addition, because m3_mem and aux_uc_mem share a union with
ext_fw_bin_mem[], if ext_fw_bin_mem[4..6] are allocated on initial boot
and a subsequent ath12k_qmi_request_target_cap() call during reset or
recovery clears ab->qmi.ext_fw_bin_download_support to false,
ath12k_qmi_free_fw_bin_mem() will take the legacy path and free only union
slots 0 and 1, leaking the coherent DMA allocations in
ext_fw_bin_mem[4..6].

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261124-wifi8_qcn9575_bringup-v4-0-1f5b87ece6a3@oss.qualcomm.com?part=3

  reply	other threads:[~2026-11-24 16:58 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-24 16:43 [PATCH ath-next v4 00/14] wifi: ath12k: add initial Wi-Fi 8 support for QCN9575 Madhavan Ganesan
2026-11-24 16:43 ` [PATCH ath-next v4 01/14] wifi: ath12k: refactor PCI window selection to per-device layout Madhavan Ganesan
2026-11-24 16:43 ` [PATCH ath-next v4 02/14] wifi: ath12k: add extended QMI WLAN cfg for CE and service pipes Madhavan Ganesan
2026-11-24 16:43 ` [PATCH ath-next v4 03/14] wifi: ath12k: add QMI support for extended firmware binary download Madhavan Ganesan
2026-11-24 16:58   ` sashiko-bot [this message]
2026-11-24 16:43 ` [PATCH ath-next v4 04/14] wifi: ath12k: add Wi-Fi 8 directory and base module scaffolding Madhavan Ganesan
2026-11-24 16:43 ` [PATCH ath-next v4 05/14] wifi: ath12k: add initial Wi-Fi 8 hw params and init helper for QCN9575 Madhavan Ganesan
2026-11-24 16:43 ` [PATCH ath-next v4 06/14] wifi: ath12k: add Wi-Fi 8 HAL register table and hal init hook " Madhavan Ganesan
2026-11-24 16:43 ` [PATCH ath-next v4 07/14] wifi: ath12k: add Wi-Fi 8 HAL ops and descriptor definitions " Madhavan Ganesan
2026-11-24 16:53   ` sashiko-bot
2026-11-24 16:43 ` [PATCH ath-next v4 08/14] wifi: ath12k: add unified firmware image support " Madhavan Ganesan
2026-11-24 16:43 ` [PATCH ath-next v4 09/14] wifi: ath12k: add Wi-Fi 8 MHI config " Madhavan Ganesan
2026-11-24 16:43 ` [PATCH ath-next v4 10/14] wifi: ath12k: add Wi-Fi 8 CE config and service pipe map " Madhavan Ganesan
2026-11-24 16:43 ` [PATCH ath-next v4 11/14] wifi: ath12k: add Wi-Fi 8 WMI init " Madhavan Ganesan
2026-11-24 16:43 ` [PATCH ath-next v4 12/14] wifi: ath12k: add Wi-Fi 8 hw ops " Madhavan Ganesan
2026-11-24 16:43 ` [PATCH ath-next v4 13/14] wifi: ath12k: add and hook Wi-Fi 8 mac80211 ops skeleton " Madhavan Ganesan
2026-11-24 17:06   ` sashiko-bot
2026-11-24 16:43 ` [PATCH ath-next v4 14/14] wifi: ath12k: add Wi-Fi 8 PCI driver scaffolding " Madhavan Ganesan
2026-11-24 16:56   ` sashiko-bot
2026-11-24 17:10 ` [PATCH ath-next v4 00/14] wifi: ath12k: add initial Wi-Fi 8 support " Vasanthakumar Thiagarajan
2026-12-02  1:53 ` Baochen Qiang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-231632@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=madhavan.ganesan@oss.qualcomm.com \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.