From: sashiko-bot@kernel.org
To: "Aaradhana Sahu" <aaradhana.sahu@oss.qualcomm.com>
Cc: devicetree@vger.kernel.org, robh@kernel.org, conor+dt@kernel.org
Subject: Re: [PATCH ath-next v2 09/17] wifi: ath12k: add support for unified data-region memory allocation
Date: Fri, 16 Oct 2026 03:35:48 +0000 [thread overview]
Message-ID: <sashiko-outbox-173678@kernel.org> (raw)
In-Reply-To: <20261016-mpp-bringup-v2-9-f510c33bfcf5@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] ath12k: data-region loop incorrectly intercepts all memory chunk types
--
commit 1f2202b158e5c8168f0cae90faae57bce35a9612
Author: Aaradhana Sahu <aaradhana.sahu@oss.qualcomm.com>
wifi: ath12k: add support for unified data-region memory allocation
This commit adds support for devices that provide M3 and calibration
memory through a unified data-region reserved-memory node. If the
data-region lookup fails, it falls back to the existing per-memory-type
allocation scheme.
> diff --git a/drivers/net/wireless/ath/ath12k/qmi.c b/drivers/net/wireless/ath/ath12k/qmi.c
> --- a/drivers/net/wireless/ath/ath12k/qmi.c
> +++ b/drivers/net/wireless/ath/ath12k/qmi.c
[ ... ]
> @@ -2851,6 +2871,48 @@ static int ath12k_qmi_assign_target_mem_chunk(struct ath12k_base *ab)
> const char *rname;
> int i, idx, ret;
>
> + ret = of_reserved_mem_region_to_resource_byname(np, "data-region", &res);
> + if (ret && ret != -ENODATA)
> + return ret;
> +
> + if (!ret) {
> + avail_rmem_size = resource_size(&res);
> + for (i = 0, idx = 0; i < ab->qmi.mem_seg_count; i++) {
> + chunk = &ab->qmi.target_mem[i];
> +
> + if (chunk->type == CALDB_MEM_REGION_TYPE) {
> + ret = ath12k_qmi_map_target_mem(ab, idx, 0, chunk->size,
> + chunk->type);
> + if (ret)
> + goto out;
> +
> + idx++;
> + continue;
> + }
> +
> + if (offset > avail_rmem_size ||
> + avail_rmem_size - offset < chunk->size) {
> + ath12k_err(ab, "failed to assign mem type %u req size %u avail size %zu\n",
> + chunk->type, chunk->size,
> + offset > avail_rmem_size ? 0 :
> + avail_rmem_size - offset);
> + ret = -EINVAL;
> + goto out;
> + }
> +
> + ret = ath12k_qmi_map_target_mem(ab, idx, res.start + offset,
> + chunk->size, chunk->type);
[Severity: High]
The commit message states that only M3 and calibration memory should be
allocated from the unified data-region, while other segments continue to use
separate regions.
Since there is no check for the chunk type here, won't this unconditionally
map all memory segments (including HOST_DDR_REGION_TYPE, BDF_MEM_REGION_TYPE,
and MLO_GLOBAL_MEM_REGION_TYPE) sequentially from the data-region?
> + if (ret)
> + goto out;
> +
> + offset += chunk->size;
> + idx++;
> + }
> +
> + ab->qmi.mem_seg_count = idx;
> + return 0;
> + }
[Severity: High]
Because the function returns 0 here after iterating all requested memory
segments, does this entirely bypass the fallback code below that maps the
dedicated q6-region and mlo-global-mem regions?
Could this lead to device initialization failure if the data-region is
exhausted, or place hardware-specific memory segments at incorrect physical
addresses?
[ ... ]
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261016-mpp-bringup-v2-0-f510c33bfcf5@oss.qualcomm.com?part=9
next prev parent reply other threads:[~2026-10-16 3:35 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-16 3:21 [PATCH ath-next v2 00/17] wifi: ath12k: Add support for QCN6432 Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 01/17] dt-bindings: net: wireless: Add QCN6432 device tree binding documentation Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 02/17] wifi: ath12k: Refactor PCI operations and MSI config structure Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 03/17] wifi: ath12k: Add hardware parameter for QCN6432 Aaradhana Sahu
2026-10-16 3:41 ` sashiko-bot
2026-10-16 3:21 ` [PATCH ath-next v2 04/17] wifi: ath12k: Add hardware ring mask " Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 05/17] wifi: ath12k: add hardware registers " Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 06/17] wifi: ath12k: move multi MSI vector flag to ath12k_dev_flags Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 07/17] wifi: ath12k: Add hybrid_bus_type in ath12k_hw_params Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 08/17] wifi: ath12k: Add hif operation support for QCN6432 Aaradhana Sahu
2026-10-16 3:46 ` sashiko-bot
2026-10-16 3:21 ` [PATCH ath-next v2 09/17] wifi: ath12k: add support for unified data-region memory allocation Aaradhana Sahu
2026-10-16 3:35 ` sashiko-bot [this message]
2026-10-16 3:21 ` [PATCH ath-next v2 10/17] wifi: ath12k: move MSI config to pci.c Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 11/17] wifi: ath12k: Add platform MSI support for CE Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 12/17] wifi: ath12k: Enable MSI interrupt support for DP interrupt Aaradhana Sahu
2026-10-16 3:41 ` sashiko-bot
2026-10-16 3:21 ` [PATCH ath-next v2 13/17] wifi: ath12k: use CMEM write for PPT on hybrid bus devices Aaradhana Sahu
2026-10-16 3:41 ` sashiko-bot
2026-10-16 3:21 ` [PATCH ath-next v2 14/17] wifi: ath12k: store and use MSI data per CE and DP interrupt group for QCN6432 Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 15/17] wifi: ath12k: Derive QMI service instance ID per protection domain Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 16/17] wifi: ath12k: Resolve userPD ID per device Aaradhana Sahu
2026-10-16 3:21 ` [PATCH ath-next v2 17/17] wifi: ath12k: Add QCN6432 AHB support Aaradhana Sahu
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-173678@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=aaradhana.sahu@oss.qualcomm.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--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.