Re: [PATCH v5 4/5] remoteproc: qcom: pas: Add late attach support for subsystems

From: Jingyi Wang

Date: Tue Apr 14 2026 - 01:11:13 EST




On 4/11/2026 2:04 PM, Jie Gan wrote:


On 4/9/2026 4:52 PM, Jingyi Wang wrote:
<...>
  static const struct rproc_ops qcom_pas_ops = {
      .unprepare = qcom_pas_unprepare,
      .start = qcom_pas_start,
@@ -518,6 +582,7 @@ static const struct rproc_ops qcom_pas_ops = {
      .parse_fw = qcom_pas_parse_firmware,
      .load = qcom_pas_load,
      .panic = qcom_pas_panic,
+    .attach = qcom_pas_attach,

Possible issue in the future here. The kaanapali_soccp_resource does not set minidump_id, so this is not triggered today, but it is a latent bug for any future device that sets both early_boot and minidump_id.

qcom_pas_attach is added to qcom_pas_ops but not to qcom_pas_minidump_ops. When a device with minidump_id set uses the minidump ops table, the .attach pointer is NULL. rproc_attach_device() checks if (rproc->ops->attach) before calling it, so the attach callback is silently skipped. For a device with early_boot = true and minidump_id != 0, the state is set to RPROC_DETACHED in probe, but the attach logic (crash check, ready check, ping) is never executed, leaving the subsystem in an inconsistent state.

Thanks,
Jie


ACK, we can add qcom_pas_attach to minidumps_ops in next version.

Thanks,
Jingyi

  };
  static const struct rproc_ops qcom_pas_minidump_ops = {
@@ -855,6 +920,15 @@ static int qcom_pas_probe(struct platform_device *pdev)
      pas->pas_ctx->use_tzmem = rproc->has_iommu;
      pas->dtb_pas_ctx->use_tzmem = rproc->has_iommu;
+
+    if (desc->early_boot) {
+        ret = qcom_q6v5_ping_subsystem_init(&pas->q6v5, pdev);
+        if (ret)
+            dev_warn(&pdev->dev, "Falling back to firmware load\n");
+        else
+            pas->rproc->state = RPROC_DETACHED;
+    }
+
      ret = rproc_add(rproc);
      if (ret)
          goto remove_ssr_sysmon;