From: sashiko-bot@kernel.org
To: "Mukesh Ojha" <mukesh.ojha@oss.qualcomm.com>
Cc: dri-devel@lists.freedesktop.org, media-ci@linuxtv.org
Subject: Re: [PATCH 7/8] soc: qcom: mdt_loader: remove qcom_mdt_load()
Date: Sat, 26 Sep 2026 15:59:33 +0000 [thread overview]
Message-ID: <20260926155934.523A01F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260925155737.4161358-8-mukesh.ojha@oss.qualcomm.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] mm: devres memory leak in device lifecycle functions due to devm_qcom_pas_context_alloc()
--
commit 7aed1d3e9c7b0aae366ecbadb5ead9994e82f517
Author: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
soc: qcom: mdt_loader: remove qcom_mdt_load()
This commit removes the qcom_mdt_load() wrapper since all callers have been
migrated to qcom_mdt_pas_load(). The new function takes an explicit
qcom_pas_context and delegates memory setup to it.
> All callers have been migrated to qcom_mdt_pas_load(), which takes an
> explicit qcom_pas_context instead of a raw pas_id and delegates memory
> setup to the context.
[Severity: Medium]
Does this migration introduce a memory leak of struct qcom_pas_context?
The migration to qcom_mdt_pas_load() requires an explicit context allocated
via devm_qcom_pas_context_alloc(). This allocation is now placed inside
functions like ath12k_ahb_power_up(), venus_load_fw(), and
iris_load_fw_to_memory():
drivers/net/wireless/ath/ath12k/ahb.c:ath12k_ahb_power_up() {
...
ctx = devm_qcom_pas_context_alloc(dev, pasid, rproc_info->mem_phys,
rproc_info->mem_size);
...
}
drivers/media/platform/qcom/venus/firmware.c:venus_load_fw() {
...
core->fw.pas_ctx = devm_qcom_pas_context_alloc(dev, VENUS_PAS_ID,
*mem_phys, *mem_size);
...
}
drivers/media/platform/qcom/iris/iris_firmware.c:iris_load_fw_to_memory() {
...
core->pas_ctx = devm_qcom_pas_context_alloc(dev, IRIS_PAS_ID, mem_phys,
resource_size(&res));
...
}
These functions are executed repeatedly during normal system operations such as
system suspend/resume (e.g., ath12k_core_resume_early() ->
ath12k_hif_power_up() -> ath12k_ahb_power_up()) and system error recovery
(venus_sys_error_handler, iris_sys_error_handler).
Since devm_* resources are only freed when the driver is unbound, does every
invocation append a new allocation to the devres list without freeing the
previous one?
This would leak memory and degrade devres traversal performance with each
suspend/resume cycle or error recovery.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260925155737.4161358-1-mukesh.ojha@oss.qualcomm.com?part=7
next prev parent reply other threads:[~2026-09-26 15:59 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 15:57 [PATCH 0/8] Migrate PAS clients to qcom_mdt_pas_load() and qcom_pas_prepare_and_auth_reset() Mukesh Ojha
2026-09-25 15:57 ` [PATCH 1/8] remoteproc: qcom_wcnss: migrate " Mukesh Ojha
2026-09-26 15:59 ` sashiko-bot
2026-09-25 15:57 ` [PATCH 2/8] drm/msm/adreno: migrate zap shader loading " Mukesh Ojha
2026-09-26 15:59 ` sashiko-bot
2026-09-25 15:57 ` [PATCH 3/8] media: iris: migrate firmware " Mukesh Ojha
2026-09-26 15:59 ` sashiko-bot
2026-09-25 15:57 ` [PATCH 4/8] media: venus: " Mukesh Ojha
2026-09-26 15:59 ` sashiko-bot
2026-09-25 15:57 ` [PATCH 5/8] net: ipa: " Mukesh Ojha
2026-09-26 15:59 ` sashiko-bot
2026-09-25 15:57 ` [PATCH 6/8] wifi: ath12k: " Mukesh Ojha
2026-09-26 15:59 ` sashiko-bot
2026-09-25 15:57 ` [PATCH 7/8] soc: qcom: mdt_loader: remove qcom_mdt_load() Mukesh Ojha
2026-09-26 15:59 ` sashiko-bot [this message]
2026-09-25 15:57 ` [PATCH 8/8] firmware: qcom: pas: remove qcom_pas_auth_and_reset() Mukesh Ojha
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=20260926155934.523A01F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=media-ci@linuxtv.org \
--cc=mukesh.ojha@oss.qualcomm.com \
--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.