* [PATCH v2 1/3] remoteproc: qcom: pas: Fix the dtb PAS context creation
@ 2026-03-25 19:12 Mukesh Ojha
2026-03-25 19:13 ` [PATCH v2 2/3] remoteproc: qcom: pas: Map/unmap subsystem region before auth_and_reset Mukesh Ojha
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Mukesh Ojha @ 2026-03-25 19:12 UTC (permalink / raw)
To: Bjorn Andersson, Mathieu Poirier, Konrad Dybcio, Mukesh Ojha
Cc: linux-arm-msm, linux-remoteproc, linux-kernel
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 and, while at it, fix the place
where the DTB PAS context was being released unconditionally.
Fixes: b13d8baf5601 ("remoteproc: pas: Replace metadata context with PAS context structure")
Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com>
---
Changes in v2: https://lore.kernel.org/lkml/sxklpgc2rtr75maiu7lg4iukmaetvjyho7ytyyykmtdu2tov3k@gctoozxj7frl/
- No change.
drivers/remoteproc/qcom_q6v5_pas.c | 36 +++++++++++++++---------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c
index 46204da046fa..3bde37ac510c 100644
--- a/drivers/remoteproc/qcom_q6v5_pas.c
+++ b/drivers/remoteproc/qcom_q6v5_pas.c
@@ -250,7 +250,9 @@ static int qcom_pas_load(struct rproc *rproc, const struct firmware *fw)
return 0;
release_dtb_metadata:
- qcom_scm_pas_metadata_release(pas->dtb_pas_ctx);
+ if (pas->dtb_pas_id)
+ qcom_scm_pas_metadata_release(pas->dtb_pas_ctx);
+
release_firmware(pas->dtb_firmware);
return ret;
@@ -623,6 +625,7 @@ static void qcom_pas_pds_detach(struct qcom_pas *pas, struct device **pds, size_
static int qcom_pas_alloc_memory_region(struct qcom_pas *pas)
{
+ struct rproc *rproc = pas->rproc;
struct resource res;
int ret;
@@ -640,6 +643,12 @@ static int qcom_pas_alloc_memory_region(struct qcom_pas *pas)
return PTR_ERR(pas->mem_region);
}
+ pas->pas_ctx = devm_qcom_scm_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);
+
+ pas->pas_ctx->use_tzmem = rproc->has_iommu;
if (!pas->dtb_pas_id)
return 0;
@@ -657,6 +666,14 @@ static int qcom_pas_alloc_memory_region(struct qcom_pas *pas)
return PTR_ERR(pas->dtb_mem_region);
}
+ pas->dtb_pas_ctx = devm_qcom_scm_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);
+
+ pas->dtb_pas_ctx->use_tzmem = rproc->has_iommu;
+
return 0;
}
@@ -838,23 +855,6 @@ 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_scm_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_scm_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 = rproc->has_iommu;
- pas->dtb_pas_ctx->use_tzmem = rproc->has_iommu;
ret = rproc_add(rproc);
if (ret)
goto remove_ssr_sysmon;
--
2.53.0
^ permalink raw reply related [flat|nested] 7+ messages in thread* [PATCH v2 2/3] remoteproc: qcom: pas: Map/unmap subsystem region before auth_and_reset 2026-03-25 19:12 [PATCH v2 1/3] remoteproc: qcom: pas: Fix the dtb PAS context creation Mukesh Ojha @ 2026-03-25 19:13 ` Mukesh Ojha 2026-03-28 11:49 ` kernel test robot 2026-03-25 19:13 ` [PATCH v2 3/3] remoteproc: qcom: pas: Drop unused dtb_mem_region field Mukesh Ojha ` (2 subsequent siblings) 3 siblings, 1 reply; 7+ messages in thread From: Mukesh Ojha @ 2026-03-25 19:13 UTC (permalink / raw) To: Bjorn Andersson, Mathieu Poirier, Konrad Dybcio, Mukesh Ojha Cc: linux-arm-msm, linux-remoteproc, linux-kernel Qualcomm remoteproc drivers such as qcom_q6v5_mss, which do not use the Peripheral Authentication Service (PAS), always map the MBA region before use and unmap it once the usage is complete. This behavior was introduced to avoid issues seen in the past where speculative accesses from the application processor to the MBA region after it was assigned to the remote Q6 led to an XPU violation. The issue was mitigated by unmapping the region before handing control to the remote Q6. Currently, most Qualcomm SoCs using the PAS driver run either with a standalone QHEE or the Gunyah hypervisor. In these environments, the hypervisor unmaps the Q6 memory from HLOS Stage-2 and remaps it into the Q6 Stage-2 page table. As a result, speculative accesses from HLOS cannot reach the region even if it remains mapped in HLOS Stage-1; therefore, XPU violations cannot occur. However, when the same SoC runs Linux at EL2, Linux itself must perform the unmapping to avoid such issues. It is still correct to apply this mapping/ unmapping sequence even for SoCs that run under Gunyah, so this behavior should not be conditional. Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> --- Changes in v2: https://lore.kernel.org/lkml/20260310135205.2497789-2-mukesh.ojha@oss.qualcomm.com/ - Moved map/unmap to pas_load function and further to coredump/minidump function. drivers/remoteproc/qcom_q6v5_pas.c | 40 ++++++++++++++++++++--------- drivers/soc/qcom/mdt_loader.c | 18 ++++++++++--- include/linux/soc/qcom/mdt_loader.h | 4 +-- 3 files changed, 44 insertions(+), 18 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index 3bde37ac510c..c8c143fea1b4 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -148,7 +148,16 @@ static void qcom_pas_minidump(struct rproc *rproc) if (rproc->dump_conf == RPROC_COREDUMP_DISABLED) return; + pas->mem_region = ioremap_wc(pas->mem_phys, pas->mem_size); + if (!pas->mem_region) { + dev_err(pas->dev, "unable to map memory region: %pa+%zx\n", + &pas->mem_phys, pas->mem_size); + return; + } + qcom_minidump(rproc, pas->minidump_id, qcom_pas_segment_dump); + iounmap(pas->mem_region); + pas->mem_region = NULL; } static int qcom_pas_pds_enable(struct qcom_pas *pas, struct device **pds, @@ -241,7 +250,7 @@ static int qcom_pas_load(struct rproc *rproc, const struct firmware *fw) } ret = qcom_mdt_pas_load(pas->dtb_pas_ctx, pas->dtb_firmware, - pas->dtb_firmware_name, pas->dtb_mem_region, + pas->dtb_firmware_name, &pas->dtb_mem_reloc); if (ret) goto release_dtb_metadata; @@ -321,7 +330,7 @@ static int qcom_pas_start(struct rproc *rproc) } ret = qcom_mdt_pas_load(pas->pas_ctx, pas->firmware, rproc->firmware, - pas->mem_region, &pas->mem_reloc); + &pas->mem_reloc); if (ret) goto release_pas_metadata; @@ -512,6 +521,22 @@ static unsigned long qcom_pas_panic(struct rproc *rproc) return qcom_q6v5_panic(&pas->q6v5); } +static void qcom_pas_coredump(struct rproc *rproc) +{ + struct qcom_pas *pas = rproc->priv; + + pas->mem_region = ioremap_wc(pas->mem_phys, pas->mem_size); + if (!pas->mem_region) { + dev_err(pas->dev, "unable to map memory region: %pa+%zx\n", + &pas->mem_phys, pas->mem_size); + return; + } + + rproc_coredump(rproc); + iounmap(pas->mem_region); + pas->mem_region = NULL; +} + static const struct rproc_ops qcom_pas_ops = { .unprepare = qcom_pas_unprepare, .start = qcom_pas_start, @@ -520,6 +545,7 @@ static const struct rproc_ops qcom_pas_ops = { .parse_fw = qcom_pas_parse_firmware, .load = qcom_pas_load, .panic = qcom_pas_panic, + .coredump = qcom_pas_coredump, }; static const struct rproc_ops qcom_pas_minidump_ops = { @@ -637,11 +663,6 @@ static int qcom_pas_alloc_memory_region(struct qcom_pas *pas) pas->mem_phys = pas->mem_reloc = res.start; pas->mem_size = resource_size(&res); - pas->mem_region = devm_ioremap_resource_wc(pas->dev, &res); - if (IS_ERR(pas->mem_region)) { - dev_err(pas->dev, "unable to map memory region: %pR\n", &res); - return PTR_ERR(pas->mem_region); - } pas->pas_ctx = devm_qcom_scm_pas_context_alloc(pas->dev, pas->pas_id, pas->mem_phys, pas->mem_size); @@ -660,11 +681,6 @@ static int qcom_pas_alloc_memory_region(struct qcom_pas *pas) pas->dtb_mem_phys = pas->dtb_mem_reloc = res.start; pas->dtb_mem_size = resource_size(&res); - pas->dtb_mem_region = devm_ioremap_resource_wc(pas->dev, &res); - if (IS_ERR(pas->dtb_mem_region)) { - dev_err(pas->dev, "unable to map dtb memory region: %pR\n", &res); - return PTR_ERR(pas->dtb_mem_region); - } pas->dtb_pas_ctx = devm_qcom_scm_pas_context_alloc(pas->dev, pas->dtb_pas_id, pas->dtb_mem_phys, diff --git a/drivers/soc/qcom/mdt_loader.c b/drivers/soc/qcom/mdt_loader.c index c004d444d698..33f3543f8e55 100644 --- a/drivers/soc/qcom/mdt_loader.c +++ b/drivers/soc/qcom/mdt_loader.c @@ -11,6 +11,7 @@ #include <linux/device.h> #include <linux/elf.h> #include <linux/firmware.h> +#include <linux/io.h> #include <linux/kernel.h> #include <linux/module.h> #include <linux/firmware/qcom/qcom_scm.h> @@ -478,22 +479,31 @@ EXPORT_SYMBOL_GPL(qcom_mdt_load); * @ctx: Pointer to the PAS (Peripheral Authentication Service) context * @fw: Firmware object representing the .mdt file * @firmware: Name of the firmware used to construct segment file names - * @mem_region: Memory region allocated for loading the firmware * @reloc_base: Physical address adjusted after relocation * * Return: 0 on success or a negative error code on failure. */ int qcom_mdt_pas_load(struct qcom_scm_pas_context *ctx, const struct firmware *fw, - const char *firmware, void *mem_region, phys_addr_t *reloc_base) + const char *firmware, phys_addr_t *reloc_base) { + void *mem_region; int ret; ret = __qcom_mdt_pas_init(ctx->dev, fw, firmware, ctx->pas_id, ctx->mem_phys, ctx); if (ret) return ret; - return qcom_mdt_load_no_init(ctx->dev, fw, firmware, mem_region, ctx->mem_phys, - ctx->mem_size, reloc_base); + mem_region = ioremap_wc(ctx->mem_phys, ctx->mem_size); + if (!mem_region) { + dev_err(ctx->dev, "unable to map memory region: %pa+%zx\n", &ctx->mem_phys, + ctx->mem_size); + return -EINVAL; + } + + ret = qcom_mdt_load_no_init(ctx->dev, fw, firmware, mem_region, ctx->mem_phys, + ctx->mem_size, reloc_base); + iounmap(mem_region); + return ret; } EXPORT_SYMBOL_GPL(qcom_mdt_pas_load); diff --git a/include/linux/soc/qcom/mdt_loader.h b/include/linux/soc/qcom/mdt_loader.h index 82372e0db0a1..7c551b98e182 100644 --- a/include/linux/soc/qcom/mdt_loader.h +++ b/include/linux/soc/qcom/mdt_loader.h @@ -21,7 +21,7 @@ int qcom_mdt_load(struct device *dev, const struct firmware *fw, phys_addr_t *reloc_base); int qcom_mdt_pas_load(struct qcom_scm_pas_context *ctx, const struct firmware *fw, - const char *firmware, void *mem_region, phys_addr_t *reloc_base); + const char *firmware, phys_addr_t *reloc_base); int qcom_mdt_load_no_init(struct device *dev, const struct firmware *fw, const char *fw_name, void *mem_region, @@ -47,7 +47,7 @@ static inline int qcom_mdt_load(struct device *dev, const struct firmware *fw, static inline int qcom_mdt_pas_load(struct qcom_scm_pas_context *ctx, const struct firmware *fw, const char *firmware, - void *mem_region, phys_addr_t *reloc_base) + phys_addr_t *reloc_base) { return -ENODEV; } -- 2.53.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/3] remoteproc: qcom: pas: Map/unmap subsystem region before auth_and_reset 2026-03-25 19:13 ` [PATCH v2 2/3] remoteproc: qcom: pas: Map/unmap subsystem region before auth_and_reset Mukesh Ojha @ 2026-03-28 11:49 ` kernel test robot 0 siblings, 0 replies; 7+ messages in thread From: kernel test robot @ 2026-03-28 11:49 UTC (permalink / raw) To: Mukesh Ojha, Bjorn Andersson, Mathieu Poirier, Konrad Dybcio Cc: oe-kbuild-all, linux-arm-msm, linux-remoteproc, linux-kernel Hi Mukesh, kernel test robot noticed the following build warnings: [auto build test WARNING on remoteproc/rproc-next] [also build test WARNING on linus/master v7.0-rc5 next-20260327] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Mukesh-Ojha/remoteproc-qcom-pas-Map-unmap-subsystem-region-before-auth_and_reset/20260328-004624 base: https://git.kernel.org/pub/scm/linux/kernel/git/remoteproc/linux.git rproc-next patch link: https://lore.kernel.org/r/20260325191301.164579-2-mukesh.ojha%40oss.qualcomm.com patch subject: [PATCH v2 2/3] remoteproc: qcom: pas: Map/unmap subsystem region before auth_and_reset config: arm64-randconfig-r113-20260328 (https://download.01.org/0day-ci/archive/20260328/202603281911.4W11adGI-lkp@intel.com/config) compiler: aarch64-linux-gcc (GCC) 8.5.0 sparse: v0.6.5-rc1 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260328/202603281911.4W11adGI-lkp@intel.com/reproduce) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp@intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202603281911.4W11adGI-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/soc/qcom/mdt_loader.c:496:20: sparse: sparse: incorrect type in assignment (different address spaces) @@ expected void *mem_region @@ got void [noderef] __iomem * @@ drivers/soc/qcom/mdt_loader.c:496:20: sparse: expected void *mem_region drivers/soc/qcom/mdt_loader.c:496:20: sparse: got void [noderef] __iomem * >> drivers/soc/qcom/mdt_loader.c:505:17: sparse: sparse: incorrect type in argument 1 (different address spaces) @@ expected void volatile [noderef] __iomem *addr @@ got void *mem_region @@ drivers/soc/qcom/mdt_loader.c:505:17: sparse: expected void volatile [noderef] __iomem *addr drivers/soc/qcom/mdt_loader.c:505:17: sparse: got void *mem_region vim +496 drivers/soc/qcom/mdt_loader.c 469 470 /** 471 * qcom_mdt_pas_load - Loads and authenticates the metadata of the firmware 472 * (typically contained in the .mdt file), followed by loading the actual 473 * firmware segments (e.g., .bXX files). Authentication of the segments done 474 * by a separate call. 475 * 476 * The PAS context must be initialized using qcom_scm_pas_context_init() 477 * prior to invoking this function. 478 * 479 * @ctx: Pointer to the PAS (Peripheral Authentication Service) context 480 * @fw: Firmware object representing the .mdt file 481 * @firmware: Name of the firmware used to construct segment file names 482 * @reloc_base: Physical address adjusted after relocation 483 * 484 * Return: 0 on success or a negative error code on failure. 485 */ 486 int qcom_mdt_pas_load(struct qcom_scm_pas_context *ctx, const struct firmware *fw, 487 const char *firmware, phys_addr_t *reloc_base) 488 { 489 void *mem_region; 490 int ret; 491 492 ret = __qcom_mdt_pas_init(ctx->dev, fw, firmware, ctx->pas_id, ctx->mem_phys, ctx); 493 if (ret) 494 return ret; 495 > 496 mem_region = ioremap_wc(ctx->mem_phys, ctx->mem_size); 497 if (!mem_region) { 498 dev_err(ctx->dev, "unable to map memory region: %pa+%zx\n", &ctx->mem_phys, 499 ctx->mem_size); 500 return -EINVAL; 501 } 502 503 ret = qcom_mdt_load_no_init(ctx->dev, fw, firmware, mem_region, ctx->mem_phys, 504 ctx->mem_size, reloc_base); > 505 iounmap(mem_region); 506 return ret; 507 } 508 EXPORT_SYMBOL_GPL(qcom_mdt_pas_load); 509 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki ^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 3/3] remoteproc: qcom: pas: Drop unused dtb_mem_region field 2026-03-25 19:12 [PATCH v2 1/3] remoteproc: qcom: pas: Fix the dtb PAS context creation Mukesh Ojha 2026-03-25 19:13 ` [PATCH v2 2/3] remoteproc: qcom: pas: Map/unmap subsystem region before auth_and_reset Mukesh Ojha @ 2026-03-25 19:13 ` Mukesh Ojha 2026-03-26 13:32 ` [PATCH v2 1/3] remoteproc: qcom: pas: Fix the dtb PAS context creation Konrad Dybcio 2026-03-29 10:51 ` Dmitry Baryshkov 3 siblings, 0 replies; 7+ messages in thread From: Mukesh Ojha @ 2026-03-25 19:13 UTC (permalink / raw) To: Bjorn Andersson, Mathieu Poirier, Konrad Dybcio, Mukesh Ojha Cc: linux-arm-msm, linux-remoteproc, linux-kernel dtb_mem_region is no longer referenced after the ioremap was moved to respective places where mapping is required. Remove it from struct qcom_pas. Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> --- changes in v2: - New change. drivers/remoteproc/qcom_q6v5_pas.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c index c8c143fea1b4..0c9183ea06f5 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -100,8 +100,9 @@ struct qcom_pas { phys_addr_t mem_reloc; phys_addr_t dtb_mem_reloc; phys_addr_t region_assign_phys[MAX_ASSIGN_COUNT]; + void *mem_region; - void *dtb_mem_region; + size_t mem_size; size_t dtb_mem_size; size_t region_assign_size[MAX_ASSIGN_COUNT]; -- 2.53.0 ^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/3] remoteproc: qcom: pas: Fix the dtb PAS context creation 2026-03-25 19:12 [PATCH v2 1/3] remoteproc: qcom: pas: Fix the dtb PAS context creation Mukesh Ojha 2026-03-25 19:13 ` [PATCH v2 2/3] remoteproc: qcom: pas: Map/unmap subsystem region before auth_and_reset Mukesh Ojha 2026-03-25 19:13 ` [PATCH v2 3/3] remoteproc: qcom: pas: Drop unused dtb_mem_region field Mukesh Ojha @ 2026-03-26 13:32 ` Konrad Dybcio 2026-03-29 10:51 ` Dmitry Baryshkov 3 siblings, 0 replies; 7+ messages in thread From: Konrad Dybcio @ 2026-03-26 13:32 UTC (permalink / raw) To: Mukesh Ojha, Bjorn Andersson, Mathieu Poirier, Konrad Dybcio Cc: linux-arm-msm, linux-remoteproc, linux-kernel On 3/25/26 8:12 PM, Mukesh Ojha wrote: > 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 and, while at it, fix the place > where the DTB PAS context was being released unconditionally. > > Fixes: b13d8baf5601 ("remoteproc: pas: Replace metadata context with PAS context structure") > Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> > --- > Changes in v2: https://lore.kernel.org/lkml/sxklpgc2rtr75maiu7lg4iukmaetvjyho7ytyyykmtdu2tov3k@gctoozxj7frl/ > - No change. > > drivers/remoteproc/qcom_q6v5_pas.c | 36 +++++++++++++++--------------- > 1 file changed, 18 insertions(+), 18 deletions(-) > > diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c > index 46204da046fa..3bde37ac510c 100644 > --- a/drivers/remoteproc/qcom_q6v5_pas.c > +++ b/drivers/remoteproc/qcom_q6v5_pas.c > @@ -250,7 +250,9 @@ static int qcom_pas_load(struct rproc *rproc, const struct firmware *fw) > return 0; > > release_dtb_metadata: > - qcom_scm_pas_metadata_release(pas->dtb_pas_ctx); > + if (pas->dtb_pas_id) > + qcom_scm_pas_metadata_release(pas->dtb_pas_ctx); I suppose just checking for if (pas->dtb_pas_ctx) would be more obvious but this is effectively equal and other places check for pas_id too Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com> Konrad ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/3] remoteproc: qcom: pas: Fix the dtb PAS context creation 2026-03-25 19:12 [PATCH v2 1/3] remoteproc: qcom: pas: Fix the dtb PAS context creation Mukesh Ojha ` (2 preceding siblings ...) 2026-03-26 13:32 ` [PATCH v2 1/3] remoteproc: qcom: pas: Fix the dtb PAS context creation Konrad Dybcio @ 2026-03-29 10:51 ` Dmitry Baryshkov 2026-03-30 12:55 ` Mukesh Ojha 3 siblings, 1 reply; 7+ messages in thread From: Dmitry Baryshkov @ 2026-03-29 10:51 UTC (permalink / raw) To: Mukesh Ojha Cc: Bjorn Andersson, Mathieu Poirier, Konrad Dybcio, linux-arm-msm, linux-remoteproc, linux-kernel On Thu, Mar 26, 2026 at 12:42:59AM +0530, Mukesh Ojha wrote: > 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 and, while at it, fix the place > where the DTB PAS context was being released unconditionally. Okay, if it wasn't obvious from the previous comment: split into two patches. > > Fixes: b13d8baf5601 ("remoteproc: pas: Replace metadata context with PAS context structure") Was the issue not present before this commit? Was the metadata correctly freed? > Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> > --- > Changes in v2: https://lore.kernel.org/lkml/sxklpgc2rtr75maiu7lg4iukmaetvjyho7ytyyykmtdu2tov3k@gctoozxj7frl/ > - No change. > > drivers/remoteproc/qcom_q6v5_pas.c | 36 +++++++++++++++--------------- > 1 file changed, 18 insertions(+), 18 deletions(-) > > diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c > index 46204da046fa..3bde37ac510c 100644 > --- a/drivers/remoteproc/qcom_q6v5_pas.c > +++ b/drivers/remoteproc/qcom_q6v5_pas.c > @@ -250,7 +250,9 @@ static int qcom_pas_load(struct rproc *rproc, const struct firmware *fw) > return 0; > > release_dtb_metadata: > - qcom_scm_pas_metadata_release(pas->dtb_pas_ctx); > + if (pas->dtb_pas_id) > + qcom_scm_pas_metadata_release(pas->dtb_pas_ctx); > + > release_firmware(pas->dtb_firmware); > > return ret; -- With best wishes Dmitry ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/3] remoteproc: qcom: pas: Fix the dtb PAS context creation 2026-03-29 10:51 ` Dmitry Baryshkov @ 2026-03-30 12:55 ` Mukesh Ojha 0 siblings, 0 replies; 7+ messages in thread From: Mukesh Ojha @ 2026-03-30 12:55 UTC (permalink / raw) To: Dmitry Baryshkov Cc: Bjorn Andersson, Mathieu Poirier, Konrad Dybcio, linux-arm-msm, linux-remoteproc, linux-kernel On Sun, Mar 29, 2026 at 01:51:16PM +0300, Dmitry Baryshkov wrote: > On Thu, Mar 26, 2026 at 12:42:59AM +0530, Mukesh Ojha wrote: > > 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 and, while at it, fix the place > > where the DTB PAS context was being released unconditionally. > > Okay, if it wasn't obvious from the previous comment: split into two > patches. > > > > > Fixes: b13d8baf5601 ("remoteproc: pas: Replace metadata context with PAS context structure") > > Was the issue not present before this commit? Was the metadata correctly > freed? Yes, it was present and even after the above commit nothing has changed as ctx->ptr is still NULL but DTB context memory is only needed for subsystems which have DTB support. Let me see if I can split this into two patches. The first will put the DTB PAS ID check and the later will do the context allocation movement. > > > Signed-off-by: Mukesh Ojha <mukesh.ojha@oss.qualcomm.com> > > --- > > Changes in v2: https://lore.kernel.org/lkml/sxklpgc2rtr75maiu7lg4iukmaetvjyho7ytyyykmtdu2tov3k@gctoozxj7frl/ > > - No change. > > > > drivers/remoteproc/qcom_q6v5_pas.c | 36 +++++++++++++++--------------- > > 1 file changed, 18 insertions(+), 18 deletions(-) > > > > diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c > > index 46204da046fa..3bde37ac510c 100644 > > --- a/drivers/remoteproc/qcom_q6v5_pas.c > > +++ b/drivers/remoteproc/qcom_q6v5_pas.c > > @@ -250,7 +250,9 @@ static int qcom_pas_load(struct rproc *rproc, const struct firmware *fw) > > return 0; > > > > release_dtb_metadata: > > - qcom_scm_pas_metadata_release(pas->dtb_pas_ctx); > > + if (pas->dtb_pas_id) > > + qcom_scm_pas_metadata_release(pas->dtb_pas_ctx); > > + > > release_firmware(pas->dtb_firmware); > > > > return ret; > > -- > With best wishes > Dmitry -- -Mukesh Ojha ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-03-30 12:55 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-03-25 19:12 [PATCH v2 1/3] remoteproc: qcom: pas: Fix the dtb PAS context creation Mukesh Ojha 2026-03-25 19:13 ` [PATCH v2 2/3] remoteproc: qcom: pas: Map/unmap subsystem region before auth_and_reset Mukesh Ojha 2026-03-28 11:49 ` kernel test robot 2026-03-25 19:13 ` [PATCH v2 3/3] remoteproc: qcom: pas: Drop unused dtb_mem_region field Mukesh Ojha 2026-03-26 13:32 ` [PATCH v2 1/3] remoteproc: qcom: pas: Fix the dtb PAS context creation Konrad Dybcio 2026-03-29 10:51 ` Dmitry Baryshkov 2026-03-30 12:55 ` Mukesh Ojha
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox