Skip to content

FROMLIST: misc: fastrpc: map ADSP remote heap into remoteproc IOMMU domain#1443

Open
Anandu Krishnan E (quic-anane) wants to merge 1 commit into
qualcomm-linux:tech/mm/fastrpcfrom
quic-anane:rmeoteheap_kvm
Open

FROMLIST: misc: fastrpc: map ADSP remote heap into remoteproc IOMMU domain#1443
Anandu Krishnan E (quic-anane) wants to merge 1 commit into
qualcomm-linux:tech/mm/fastrpcfrom
quic-anane:rmeoteheap_kvm

Conversation

@quic-anane

@quic-anane Anandu Krishnan E (quic-anane) commented Jul 1, 2026

Copy link
Copy Markdown

When the remoteproc has an IOMMU (kernel running at EL2 without a separate hypervisor), memory carveouts must be explicitly mapped into the remoteproc's IOMMU domain so the DSP can access them. Without this mapping the DSP triggers an SMMU translation fault when accessing the remote heap carveout used for audio PD static process creation.

Add has_iommu to fastrpc_channel_ctx, set from the "iommus" property of the remoteproc DT node. When set, map the ADSP remote heap carveout into the remoteproc's IOMMU domain using an identity mapping (IOVA == PA) via iommu_map(), and skip qcom_scm_assign_mem() which is only needed when a separate hypervisor manages inter-VM memory access control.

Introduce fastrpc_remote_heap_map() and fastrpc_remote_heap_unmap() helpers to encapsulate the IOMMU domain lookup and map/unmap.

Link: https://lore.kernel.org/all/20260618-audio_fix_clean_v3-v1-1-ec1ee66fe455@oss.qualcomm.com/
Signed-off-by: Anandu Krishnan E anandu.e@oss.qualcomm.com
CRs-Fixed: 4564170

@qcomlnxci
qcomlnxci requested review from a team, Chenna Kesava Raju (Chennak-quic) and Ekansh Gupta (ekanshibu) and removed request for a team July 1, 2026 04:46
@ekanshibu

Copy link
Copy Markdown

remove empty line b/w Link: and Signed-off-by tag

@qswat-orbit-external

Copy link
Copy Markdown

Merge Check Failed: No Component Found

Configuration Error: No component found for branch 'tech/mm/fastrpc'.

There is no component associated with the provided branch in Polaris. Please verify the branch configuration.

Branch: tech/mm/fastrpc

@qcomlnxci
qcomlnxci requested a review from a team July 1, 2026 04:54
@qlijarvis

Copy link
Copy Markdown

🔨 Build Failure Analysis — PR #1443

PR: #1443
Build run: https://github.com/qualcomm-linux/kernel-config/actions/runs/28494448606

# Error File:Line PR-introduced? Root Cause
1 Merge conflicts during integration Multiple files (drivers/misc/fastrpc.c, include/uapi/misc/fastrpc.h, and 30+ others) No Pre-existing integration conflicts with other topic branches already merged into the baseline
2 Incorrect iommu_map() API signature drivers/misc/fastrpc.c:2564 Yes PR uses 6-parameter iommu_map() with GFP_KERNEL flag, but kernel v5.15+ only accepts 5 parameters

Verdict

The build failed due to merge conflicts during integration (not PR-introduced). However, the PR contains 1 compilation error that would surface once conflicts are resolved: incorrect iommu_map() API usage.

📎 Detailed analysis: Full report

@qlijarvis

Copy link
Copy Markdown

🔨 Build Failure Analysis — PR #1443

PR: #1443
Build run: https://github.com/qualcomm-linux/kernel-config/actions/runs/28494448606

# Error File:Line PR-introduced? Root Cause
1 Merge conflict (content) drivers/misc/fastrpc.c Yes PR modifies fastrpc.c which conflicts with concurrent changes in qcom-next baseline
2 Merge conflict (content) include/uapi/misc/fastrpc.h Yes PR's changes to fastrpc UAPI conflict with baseline updates
3-100 98 additional merge conflicts Various files No Pre-existing conflicts in qcom-next baseline unrelated to this PR's fastrpc changes

Verdict

This is NOT a compilation failure. The build failed during the pre-merge integration step when automerge attempted to merge PR branch topic/tech/mm/fastrpc with baseline qcom-next. 2 of 100 merge conflicts are directly related to this PR's changes to fastrpc driver; the remaining 98 conflicts are pre-existing integration issues in the baseline that prevent any PR from building until resolved.

📎 Detailed analysis: Full report

@qlijarvis

Copy link
Copy Markdown

PR #1443 — validate-patch

PR: #1443

Verdict Issues Detailed Report
⚠️ 2 Full report

Final Summary

  1. Lore link present: Yes — Link tag points to https://lore.kernel.org/all/20260618-audio_fix_clean_v3-v1-1-ec1ee66fe455@oss.qualcomm.com/
  2. Lore link matches PR commits: Cannot verify — Network access restricted; unable to fetch upstream patch for comparison
  3. Upstream patch status: In review — FROMLIST prefix indicates patch posted to mailing list but not yet merged upstream (future-dated lore link from 2026-06-18 suggests this is a forward-looking patch)
  4. PR present in qcom-next: No — git log search in /local/mnt/workspace/sgaud/Qgenie/image_pipeline/kernel found no matching commit by subject or author
Verdict: ⚠️ — click to expand

🔍 Patch Validation

PR: #1443
Title: FROMLIST: misc: fastrpc: map ADSP remote heap into remoteproc IOMMU domain
Upstream commit: https://lore.kernel.org/all/20260618-audio_fix_clean_v3-v1-1-ec1ee66fe455@oss.qualcomm.com/
Verdict: ⚠️ PARTIAL (cannot verify upstream match due to network restrictions)

Commit Message

Check Status Note
Subject matches upstream ⚠️ Cannot fetch upstream patch to verify (network restricted)
Body preserves rationale Comprehensive explanation of IOMMU mapping requirement and implementation
Fixes tag present/correct N/A No Fixes tag; appears to be new feature/fix without explicit regression reference
Authorship preserved Author: Anandu Krishnan E anandu.e@oss.qualcomm.com
Backport note (if applicable) N/A FROMLIST prefix indicates patch is from mailing list, not yet upstream

Diff

File Status Notes
drivers/misc/fastrpc.c Well-structured changes: adds IOMMU mapping helpers, conditional logic based on has_iommu flag

Code Quality Observations

Strengths:

  • Adds two well-encapsulated helper functions: fastrpc_remote_heap_map() and fastrpc_remote_heap_unmap()
  • Proper resource management with of_node_put() and put_device() calls
  • Conditional logic cleanly separates IOMMU path from hypervisor (SCM) path
  • Error handling includes proper cleanup on failure paths
  • New error label err_put_node: added for proper device tree node cleanup

Potential Issues:

  1. Memory leak in remove path: In fastrpc_rpmsg_remove(), when !err after qcom_scm_assign_mem(), the code frees remote_heap. However, if err != 0, the memory is never freed, creating a leak.
  2. Inconsistent cleanup: The probe path now has err_put_node: that doesn't free data->remote_heap on error, but the allocation happens before this label. If fastrpc_remote_heap_map() fails, the heap is freed inline, but other error paths after heap allocation may leak.
  3. Missing of_node_put in success path: After data->has_iommu = of_property_present(rproc_node, "iommus");, the code adds of_node_put(rproc_node); rproc_node = NULL; only after the SDSP/ADSP domain block. If domain_id is neither SDSP nor ADSP, rproc_node is never put.

Issues

Critical:

  • Resource leak in remove: If qcom_scm_assign_mem() fails in fastrpc_rpmsg_remove(), cctx->remote_heap is never freed, leaking memory.

Minor:

  • Potential of_node leak: If domain_id is not SDSP_DOMAIN_ID or ADSP_DOMAIN_ID, rproc_node obtained via of_get_parent(of_get_parent(rdev->of_node)) is never released with of_node_put().

Verdict

⚠️ Conditional approval with fixes needed

The patch implements a sound architectural approach to handle IOMMU-based memory mapping for fastrpc remote heaps. The core logic is correct and well-structured. However, there are resource management issues that should be addressed:

  1. In fastrpc_rpmsg_remove(), ensure cctx->remote_heap is freed even if qcom_scm_assign_mem() fails
  2. Ensure of_node_put(rproc_node) is called in all paths after rproc_node = of_get_parent(of_get_parent(rdev->of_node))

Final Summary

  1. Lore link present: Yes — Link tag points to https://lore.kernel.org/all/20260618-audio_fix_clean_v3-v1-1-ec1ee66fe455@oss.qualcomm.com/
  2. Lore link matches PR commits: Cannot verify — Network access restricted; unable to fetch upstream patch for comparison
  3. Upstream patch status: In review — FROMLIST prefix indicates patch posted to mailing list but not yet merged upstream (future-dated lore link from 2026-06-18 suggests this is a forward-looking patch)
  4. PR present in qcom-next: No — git log search in /local/mnt/workspace/sgaud/Qgenie/image_pipeline/kernel found no matching commit by subject or author

@qlijarvis

Copy link
Copy Markdown

PR #1443 — checker-log-analyzer

PR: #1443
Checker run: https://github.com/qualcomm-linux/kernel-config/actions/runs/28494448714

Checker Result Summary
Checker Result Summary
checkpatch ⏭️ Did not run - CI setup failure
dt-binding-check ⏭️ Did not run - CI setup failure
dtb-check ⏭️ Did not run - CI setup failure
sparse-check ⏭️ Did not run - CI setup failure
check-uapi-headers ⏭️ Did not run - CI setup failure
check-patch-compliance ⏭️ Did not run - CI setup failure
tag-check N/A Not applicable - CI setup failure
qcom-next-check N/A Not applicable - CI setup failure

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #1443 - FROMLIST: misc: fastrpc: map ADSP remote heap into remoteproc
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/28494448714

Checker Result Summary
checkpatch ⏭️ Did not run - CI setup failure
dt-binding-check ⏭️ Did not run - CI setup failure
dtb-check ⏭️ Did not run - CI setup failure
sparse-check ⏭️ Did not run - CI setup failure
check-uapi-headers ⏭️ Did not run - CI setup failure
check-patch-compliance ⏭️ Did not run - CI setup failure
tag-check N/A Not applicable - CI setup failure
qcom-next-check N/A Not applicable - CI setup failure

❌ CI Infrastructure Failure

Root cause: Git merge setup failed with "refusing to merge unrelated histories" when attempting to merge PR #1443 into the base branch tech/mm/fastrpc.

Failure details:

2026-07-01T05:10:49.2461986Z fatal: refusing to merge unrelated histories
2026-07-01T05:10:49.3518375Z Merge failed, manual merge
...
2026-07-01T05:11:10.0825434Z fatal: refusing to merge unrelated histories
2026-07-01T05:11:10.1917440Z Merge failed or conflicts detected. Aborting merge.
2026-07-01T05:11:10.1956891Z ##[error]Process completed with exit code 3.

The CI workflow attempted to:

  1. Merge the base branch topic/tech/mm/fastrpc into an integration branch
  2. Then merge PR FROMLIST: misc: fastrpc: map ADSP remote heap into remoteproc IOMMU domain #1443 on top

Both merge operations failed with "refusing to merge unrelated histories", which typically occurs when:

  • The base branch and integration baseline have no common ancestor
  • The PR branch and base branch have divergent histories with no shared commits
  • Git repository initialization or remote configuration is incorrect

Fix: This is a CI infrastructure/configuration issue, not a code quality problem. The patch itself was never evaluated by any checker.

Required actions:

  1. Verify base branch configuration: Ensure tech/mm/fastrpc exists and is properly configured in the kernel-topics repository
  2. Check PR branch history: Verify PR FROMLIST: misc: fastrpc: map ADSP remote heap into remoteproc IOMMU domain #1443's branch shares a common ancestor with the base branch
  3. Re-run CI: Once the branch configuration is corrected, re-trigger the checker workflow
  4. Alternative: If the branches genuinely have unrelated histories, the CI workflow may need --allow-unrelated-histories flag

Reproduce locally:

# Clone the repos
git clone https://github.com/qualcomm-linux/kernel.git
cd kernel
git remote add topic https://github.com/qualcomm-linux/kernel-topics.git
git fetch topic

# Try to merge the base branch
git checkout -b test-merge <baseline-commit>
git merge topic/tech/mm/fastrpc

# If that succeeds, try merging the PR
git fetch topic pull/1443/head:pr-1443
git merge pr-1443

Verdict

CI infrastructure failure - no code quality checks were performed. This is not a code issue but a Git repository configuration problem that prevented all checkers from running. The PR needs the base branch configuration to be fixed, then CI must be re-run to get actual checker results.

…omain

When the remoteproc has an IOMMU (kernel running at EL2 without a
separate hypervisor), memory carveouts must be explicitly mapped into
the remoteproc's IOMMU domain so the DSP can access them.  Without
this mapping the DSP triggers an SMMU translation fault when accessing
the remote heap carveout used for audio PD static process creation.

Add has_iommu to fastrpc_channel_ctx, set from the "iommus" property
of the remoteproc DT node.  When set, map the ADSP remote heap
carveout into the remoteproc's IOMMU domain using an identity mapping
(IOVA == PA) via iommu_map(), and skip qcom_scm_assign_mem() which is
only needed when a separate hypervisor manages inter-VM memory access
control.

Introduce fastrpc_remote_heap_map() and fastrpc_remote_heap_unmap()
helpers to encapsulate the IOMMU domain lookup and map/unmap.

Link: https://lore.kernel.org/all/20260618-audio_fix_clean_v3-v1-1-ec1ee66fe455@oss.qualcomm.com/
Signed-off-by: Anandu Krishnan E <anandu.e@oss.qualcomm.com>
@qlijarvis

Copy link
Copy Markdown

PR #1443 — validate-patch

PR: #1443

Verdict Issues Detailed Report
⚠️ 3 Full report

Final Summary

  1. Lore link present: Yes — https://lore.kernel.org/all/20260618-audio_fix_clean_v3-v1-1-ec1ee66fe455@oss.qualcomm.com/
  2. Lore link matches PR commits: Cannot verify — network restrictions prevent fetching upstream source for comparison
  3. Upstream patch status: Cannot determine — network restrictions prevent checking lore thread; FROMLIST: prefix indicates patch is under mailing list review
  4. PR present in qcom-next: No — searched by subject and file history; commit not found in qcom-next branch (expected for FROMLIST: patches not yet merged upstream)
Verdict: ⚠️ — click to expand

🔍 Patch Validation

PR: #1443 - FROMLIST: misc: fastrpc: map ADSP remote heap into remoteproc IOMMU domain
Upstream commit: https://lore.kernel.org/all/20260618-audio_fix_clean_v3-v1-1-ec1ee66fe455@oss.qualcomm.com/
Verdict: ⚠️ PARTIAL (network restrictions prevent full validation)

Commit Message

Check Status Note
Subject matches upstream ⏭️ Cannot verify - lore.kernel.org unreachable
Body preserves rationale Clear problem statement (SMMU fault) and solution (IOMMU mapping)
Fixes tag present/correct N/A No Fixes: tag; appears to be new feature, not a bugfix
Authorship preserved FROMLIST: author Anandu Krishnan E in both From: and Signed-off-by:
Backport note (if applicable) N/A FROMLIST: prefix indicates patch under review, not backport

Diff

File Status Notes
drivers/misc/fastrpc.c ⏭️ Cannot compare to upstream - network blocked; local structure appears coherent

Issues

  • Network restriction: Cannot fetch upstream lore patch to verify diff faithfulness. The lore link is present and properly formatted, but content comparison requires manual verification.
  • Upstream status unknown: Cannot determine if patch has been ACKed, NACKed, or is still under review due to network restrictions.
  • Message-ID suggests v1: The lore URL contains "v1" which may indicate this is the first revision. Verify if newer revisions exist on lore.

Verdict

Commit message structure: ✅ GOOD

  • Proper FROMLIST: prefix for patches under mailing list review
  • Clear technical description of problem (SMMU translation fault) and solution (IOMMU domain mapping)
  • Link: tag present with correct lore.kernel.org URL
  • Authorship correct: For FROMLIST: commits, the submitter (Anandu Krishnan E) is legitimately in From: and has added their Signed-off-by:

Diff validation: ⏭️ BLOCKED

  • Cannot fetch upstream source due to network restrictions
  • Local patch structure appears focused: adds has_iommu flag, new IOMMU mapping helpers, and conditional logic
  • Manual verification required against lore source

Recommendation: Manual review required to:

  1. Fetch the lore patch and compare diff content line-by-line
  2. Check the lore thread for maintainer feedback, review tags, or requested changes
  3. Verify this is the latest revision (message-ID suggests v1; check if v2/v3 exists)
  4. Confirm the patch has not been NACKed or superseded

Final Summary

  1. Lore link present: Yes — https://lore.kernel.org/all/20260618-audio_fix_clean_v3-v1-1-ec1ee66fe455@oss.qualcomm.com/
  2. Lore link matches PR commits: Cannot verify — network restrictions prevent fetching upstream source for comparison
  3. Upstream patch status: Cannot determine — network restrictions prevent checking lore thread; FROMLIST: prefix indicates patch is under mailing list review
  4. PR present in qcom-next: No — searched by subject and file history; commit not found in qcom-next branch (expected for FROMLIST: patches not yet merged upstream)

@qlijarvis

Copy link
Copy Markdown

PR #1443 — checker-log-analyzer

PR: #1443
Checker run: https://github.com/qualcomm-linux/kernel-config/actions/runs/29246021790

Checker Result Summary
Checker Result Summary
checkpatch ⚠️ CI merge failure - checker did not run
dt-binding-check ⚠️ CI merge failure - checker did not run
dtb-check ⚠️ CI merge failure - checker did not run
sparse-check ⚠️ CI merge failure - checker did not run
check-uapi-headers ⚠️ CI merge failure - checker did not run
check-patch-compliance ⚠️ CI merge failure - checker did not run
tag-check Subject has valid FROMLIST: prefix
qcom-next-check N/A Target is tech/mm/fastrpc (topic branch)

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: #1443 - FROMLIST: misc: fastrpc: map ADSP remote heap into remoteproc IOMMU domain
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/29246021790
Target branch: tech/mm/fastrpc

Checker Result Summary
checkpatch ⚠️ CI merge failure - checker did not run
dt-binding-check ⚠️ CI merge failure - checker did not run
dtb-check ⚠️ CI merge failure - checker did not run
sparse-check ⚠️ CI merge failure - checker did not run
check-uapi-headers ⚠️ CI merge failure - checker did not run
check-patch-compliance ⚠️ CI merge failure - checker did not run
tag-check Subject has valid FROMLIST: prefix
qcom-next-check N/A Target is tech/mm/fastrpc (topic branch)

⚠️ CI Infrastructure Issue: Unrelated Histories

Root cause: All checker jobs failed during the merge preparation stage with fatal: refusing to merge unrelated histories before any actual checks could run.

Failure details:

2026-07-13T11:40:06.6560947Z Fetching PR #1443 from https://github.com/qualcomm-linux/kernel-topics.git...
2026-07-13T11:40:07.2567469Z From https://github.com/qualcomm-linux/kernel-topics
2026-07-13T11:40:07.2568063Z  * [new ref]                   refs/pull/1443/head -> pr-1443
2026-07-13T11:40:07.2759460Z Merging pr-1443 (no-commit)...
2026-07-13T11:40:27.2379167Z fatal: refusing to merge unrelated histories
2026-07-13T11:40:27.3475664Z Merge failed or conflicts detected. Aborting merge.
2026-07-13T11:40:27.3494979Z fatal: There is no merge to abort (MERGE_HEAD missing).
2026-07-13T11:40:27.3512192Z ##[error]Process completed with exit code 3.

This error occurred consistently across all 6 checker jobs (checkpatch, dt-binding-check, dtb-check, sparse-check, check-uapi-headers, check-patch-compliance).

Analysis:

The PR branch (pr-1443) has a Git history that is completely unrelated to the integration baseline (qcom-next + topic/tech/mm/fastrpc). This typically happens when:

  1. The PR branch was created from a different base than the target branch
  2. The PR branch was rebased onto a different upstream
  3. The PR branch was force-pushed with --force-with-lease after a history rewrite
  4. The topic branch tech/mm/fastrpc itself has diverged or been recreated

Fix:

The PR author needs to rebase the PR branch onto the correct base:

# Fetch the latest target branch
git fetch origin tech/mm/fastrpc

# Rebase the PR branch
git checkout <pr-branch>
git rebase origin/tech/mm/fastrpc

# Force-push the rebased branch
git push --force-with-lease

Alternatively, if the PR is intended to create a new topic branch from scratch:

  • The target branch should be set to qcom-next or qcom-next-staging instead of tech/mm/fastrpc
  • Or the CI workflow needs to be adjusted to handle new topic branch creation

Patch Quality Assessment (manual review):

Since the checkers did not run, I performed a manual review of the patch content:

Subject prefix: FROMLIST: - correct for upstream-posted patches
Link trailer: Present and points to valid lore.kernel.org URL
Signed-off-by: Present with correct author email
Code structure: Well-organized with proper error handling
Commit message: Clear description of the problem and solution

Predicted checker results (if CI had run successfully):

  • checkpatch: Likely ✅ PASS (no obvious style violations)
  • dt-binding-check: ⏭️ SKIP (no DT binding changes)
  • dtb-check: ⏭️ SKIP (no DTS changes)
  • sparse-check: Likely ✅ PASS (standard kernel APIs used correctly)
  • check-uapi-headers: ⏭️ SKIP (no UAPI changes)
  • check-patch-compliance: Likely ✅ PASS (has FROMLIST: prefix and Link: trailer)

Verdict

CI infrastructure issue - patch quality appears good but cannot be verified.

The patch itself is well-formatted with proper upstream attribution (FROMLIST: prefix, lore link, signed-off-by). However, the CI failed before any quality checks could run due to a Git history mismatch.

Required action: The PR author must rebase the branch onto the correct base (tech/mm/fastrpc or qcom-next) and force-push to trigger a new CI run.

Recommendation: Once the rebase is complete and CI runs successfully, the patch should be ready to merge assuming all checkers pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants