From: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
To: Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konradybcio@kernel.org>,
Mathieu Poirier <mathieu.poirier@linaro.org>,
Sumit Garg <sumit.garg@oss.qualcomm.com>,
Neil Armstrong <neil.armstrong@linaro.org>
Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-remoteproc@vger.kernel.org,
Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>,
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>,
Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Subject: [PATCH v5 3/6] remoteproc: qcom: pas: Fix the PAS context creation placement
Date: Fri, 24 Jul 2026 23:58:55 +0530 [thread overview]
Message-ID: <20260724182858.1868271-4-mukesh.ojha@oss.qualcomm.com> (raw)
In-Reply-To: <20260724182858.1868271-1-mukesh.ojha@oss.qualcomm.com>
DTB PAS context creation should be done only for subsystems that support
a DTB firmware binary; otherwise, memory is wasted. Move the context
creation to the appropriate location.
Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com>
Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
---
drivers/remoteproc/qcom_q6v5_pas.c | 29 +++++++++++++----------------
1 file changed, 13 insertions(+), 16 deletions(-)
diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index f70836cc382d..997b3a7ce672 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -702,6 +702,11 @@ static int qcom_pas_alloc_memory_region(struct qcom_pas *pas)
return PTR_ERR(pas->mem_region);
}
+ pas->pas_ctx = devm_qcom_pas_context_alloc(pas->dev, pas->pas_id,
+ pas->mem_phys, pas->mem_size);
+ if (IS_ERR(pas->pas_ctx))
+ return PTR_ERR(pas->pas_ctx);
+
if (!pas->dtb_pas_id)
return 0;
@@ -719,6 +724,12 @@ static int qcom_pas_alloc_memory_region(struct qcom_pas *pas)
return PTR_ERR(pas->dtb_mem_region);
}
+ pas->dtb_pas_ctx = devm_qcom_pas_context_alloc(pas->dev, pas->dtb_pas_id,
+ pas->dtb_mem_phys,
+ pas->dtb_mem_size);
+ if (IS_ERR(pas->dtb_pas_ctx))
+ return PTR_ERR(pas->dtb_pas_ctx);
+
return 0;
}
@@ -901,23 +912,9 @@ static int qcom_pas_probe(struct platform_device *pdev)
qcom_add_ssr_subdev(rproc, &pas->ssr_subdev, desc->ssr_name);
- pas->pas_ctx = devm_qcom_pas_context_alloc(pas->dev, pas->pas_id,
- pas->mem_phys, pas->mem_size);
- if (IS_ERR(pas->pas_ctx)) {
- ret = PTR_ERR(pas->pas_ctx);
- goto remove_ssr_sysmon;
- }
-
- pas->dtb_pas_ctx = devm_qcom_pas_context_alloc(pas->dev, pas->dtb_pas_id,
- pas->dtb_mem_phys,
- pas->dtb_mem_size);
- if (IS_ERR(pas->dtb_pas_ctx)) {
- ret = PTR_ERR(pas->dtb_pas_ctx);
- goto remove_ssr_sysmon;
- }
-
pas->pas_ctx->use_tzmem = desc->needs_tzmem || rproc->has_iommu;
- pas->dtb_pas_ctx->use_tzmem = desc->needs_tzmem || rproc->has_iommu;
+ if (pas->dtb_pas_id)
+ pas->dtb_pas_ctx->use_tzmem = desc->needs_tzmem || rproc->has_iommu;
if (desc->early_boot)
pas->rproc->state = RPROC_DETACHED;
--
2.53.0
next prev parent reply other threads:[~2026-07-24 18:29 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-24 18:28 [PATCH v5 0/6] remoteproc: qcom: pas: Misc fixes Mukesh Ojha
2026-07-24 18:28 ` [PATCH v5 1/6] remoteproc: qcom: annotate mem_region fields with __iomem Mukesh Ojha
2026-07-24 18:28 ` [PATCH v5 2/6] remoteproc: qcom: pas: Guard dtb metadata release with dtb_pas_id check Mukesh Ojha
2026-07-24 18:28 ` Mukesh Ojha [this message]
2026-07-24 18:28 ` [PATCH v5 4/6] remoteproc: qcom: pas: Map/unmap subsystem region before auth_and_reset Mukesh Ojha
2026-07-24 18:28 ` [PATCH v5 5/6] remoteproc: qcom: pas: Drop unused dtb_mem_region field Mukesh Ojha
2026-07-24 18:28 ` [PATCH v5 6/6] firmware: qcom: scm: introduce keep_mdt_buf flag in PAS context Mukesh Ojha
2026-08-02 4:08 ` Bjorn Andersson
2026-08-03 9:06 ` Mukesh Ojha
2026-08-04 15:25 ` Bjorn Andersson
2026-08-04 15:44 ` Mukesh Ojha
2026-07-31 3:26 ` (subset) [PATCH v5 0/6] remoteproc: qcom: pas: Misc fixes Bjorn Andersson
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=20260724182858.1868271-4-mukesh.ojha@oss.qualcomm.com \
--to=mukesh.ojha@oss.qualcomm.com \
--cc=andersson@kernel.org \
--cc=dmitry.baryshkov@oss.qualcomm.com \
--cc=konrad.dybcio@oss.qualcomm.com \
--cc=konradybcio@kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=neil.armstrong@linaro.org \
--cc=sumit.garg@oss.qualcomm.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®