Skip to content

WORKAROUND: misc: fastrpc: flush IOMMU TLB after releasing DSP process#1164

Open
ajainp01 wants to merge 1 commit into
qualcomm-linux:tech/all/workaroundfrom
ajainp01:workaround
Open

WORKAROUND: misc: fastrpc: flush IOMMU TLB after releasing DSP process#1164
ajainp01 wants to merge 1 commit into
qualcomm-linux:tech/all/workaroundfrom
ajainp01:workaround

Conversation

@ajainp01
Copy link
Copy Markdown

When a FastRPC session is closed, an INIT_RELEASE is sent to the DSP which begins an asynchronous ASID teardown. If a new INIT_CREATE arrives before teardown completes, the DSP returns AEE_EQURTBADASID (0x8000054f) because the ASID entry is still being torn down.

This is likely a DSP firmware issue where the ASID teardown is not completed synchronously before acknowledging the INIT_RELEASE. As a workaround, flush the IOMMU TLB for the session's SMMU context bank immediately after sending INIT_RELEASE. The SMMU hardware TLB invalidation broadcast acts as a synchronization point that causes the DSP firmware to complete its ASID teardown synchronously before the flush returns, eliminating the reuse race.

Workaround will be reverted once the fix is provided in Fastrpc driver/ Dsp Firmware side.

When a FastRPC session is closed, an INIT_RELEASE is sent to the DSP
which begins an asynchronous ASID teardown. If a new INIT_CREATE arrives
before teardown completes, the DSP returns AEE_EQURTBADASID (0x8000054f)
because the ASID entry is still being torn down.

This is likely a DSP firmware issue where the ASID teardown is not
completed synchronously before acknowledging the INIT_RELEASE. As a
workaround, flush the IOMMU TLB for the session's SMMU context bank
immediately after sending INIT_RELEASE. The SMMU hardware TLB
invalidation broadcast acts as a synchronization point that causes the
DSP firmware to complete its ASID teardown synchronously before the
flush returns, eliminating the reuse race.

Workaround will be reverted once the fix is provided in Fastrpc driver/
Dsp Firmware side.

Signed-off-by: Anvesh Jain P <anvesh.p@oss.qualcomm.com>
@qcomlnxci qcomlnxci requested review from a team, aiquny, mukeshojha-linux and shashim-quic and removed request for a team May 18, 2026 05:50
@sgaud-quic
Copy link
Copy Markdown
Contributor

🔨 Build Failure Analysis — PR #1164

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

# Error File:Line PR-introduced? Root Cause
1 CONFLICT (content): Merge conflict in drivers/misc/fastrpc.cgit merge pr-1164 --no-commit fails with exit code 1 (both build / build and build_rt / build jobs) drivers/misc/fastrpc.c (around fastrpc_device_release()) Yes PR #1164 modifies fastrpc_device_release() in drivers/misc/fastrpc.c. The CI integration branch already contains the tech/all/workaround topic branch which touches the same region of the same file. Git cannot auto-resolve the overlapping hunks, causing a content conflict before the compiler is ever invoked.

Verdict

1 of 1 failure is introduced by this PR: the PR's changes to drivers/misc/fastrpc.c conflict with the already-merged tech/all/workaround topic branch that modifies the same region of the same file.

📎 Detailed analysis: Full report

@sgaud-quic
Copy link
Copy Markdown
Contributor

🔨 Build Failure Analysis — PR #1164

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

# Error File:Line PR-introduced? Root Cause
1 CONFLICT (content): Merge conflict in drivers/misc/fastrpc.cbuild / build drivers/misc/fastrpc.c Yes (indirectly) CI pipeline merges the PR's topic branch (tech/all/workaround) into the integration tree first, then attempts to merge pull/1164/head (the same commit) a second time, producing a self-conflict. No compiler stage was reached.
2 CONFLICT (content): Merge conflict in drivers/misc/fastrpc.cbuild_rt / build drivers/misc/fastrpc.c Yes (indirectly) Identical double-merge issue in the RT build variant.

Verdict

Both failures are caused by the CI pipeline attempting to merge the PR's own branch (tech/all/workaround) twice — once as a topic branch and once as the PR head — producing a self-conflict in drivers/misc/fastrpc.c; the PR's code changes themselves are not the root cause and no compiler errors were observed.

📎 Detailed analysis: Full report

@sgaud-quic
Copy link
Copy Markdown
Contributor

PR #1164 — validate-patch

PR: #1164

Verdict Issues Detailed Report
0 Full report
Verdict: ✅ — click to expand

🔍 Patch Validation

PR: PR #1164WORKAROUND: misc: fastrpc: flush IOMMU TLB after releasing DSP process
Upstream commit: N/A — WORKAROUND: prefix; no upstream lore link expected
Verdict: ✅ PASS (validation not applicable — vendor-only workaround)


Step 1 — Lore Link Check

No lore.kernel.org URL, Link:, or Patch-mainline: tag is present in the commit message. The commit carries a WORKAROUND: prefix, which by convention indicates a temporary, vendor-only fix not suitable for upstream submission. Per the validate-patch skill rules, WORKAROUND: commits have no upstream lore link by design — lore validation is skipped.


Commit Message

Check Status Note
Subject matches upstream N/A WORKAROUND: — no upstream posting
Body preserves rationale Clear description of the ASID teardown race, root cause hypothesis (DSP firmware async teardown), and the synchronisation mechanism used (IOMMU TLB flush as sync point)
Fixes tag present/correct N/A No Fixes: tag; acceptable for a workaround with no single upstream commit to blame
Authorship preserved Single author Anvesh Jain P <anvesh.p@oss.qualcomm.com> with matching Signed-off-by:
Backport note (if applicable) N/A Not a backport
Co-developed-by misuse Not present; no issue
Revert-intent documented Commit body explicitly states "Workaround will be reverted once the fix is provided in Fastrpc driver/Dsp Firmware side"

Minor style note: The last sentence of the commit body ("Workaround will be reverted once the fix is provided in Fastrpc driver/ Dsp Firmware side.") has a stray space before the line break (driver/\nDsp). Not a blocker, but worth cleaning up for readability.


Diff

File Status Notes
drivers/misc/fastrpc.c Adds #include <linux/iommu.h> and a 6-line guard in fastrpc_device_release() that calls iommu_flush_iotlb_all() after fastrpc_release_current_dsp_process()

Diff hygiene observations:

  • The new code is correctly guarded: fl->sctx && fl->sctx->dev null-checks before dereferencing, and domain is checked before calling iommu_flush_iotlb_all(domain). No unsafe dereferences.
  • iommu_get_domain_for_dev() + iommu_flush_iotlb_all() are standard IOMMU API calls; <linux/iommu.h> include is correctly added.
  • The hunk is inserted at the right location — immediately after fastrpc_release_current_dsp_process(fl) and before the spin_lock_irqsave that removes the session from the list, which is the correct ordering.
  • No unrelated changes; diff is minimal and focused.

Upstream Patch Status

Commit Community Verdict
WORKAROUND: misc: fastrpc: flush IOMMU TLB after releasing DSP process ⏭️ Skipped — WORKAROUND: prefix; not posted upstream by design

Dependency Check

  • The patch depends only on iommu_get_domain_for_dev() and iommu_flush_iotlb_all(), both part of the standard <linux/iommu.h> API already present in the kernel tree. No additional prerequisite patches are required.

qcom-next Presence

Commit Status
WORKAROUND: misc: fastrpc: flush IOMMU TLB after releasing DSP process ⏭️ Skipped — vendor-only workaround; qcom-next presence check not applicable

Issues Found

None blocking. One cosmetic note:

  1. Commit body trailing whitespace/line-break: "Fastrpc driver/ Dsp Firmware side" — stray space before the newline in the last sentence. Recommend: "Fastrpc driver/DSP firmware side" (also capitalise "DSP" consistently with the rest of the message).

Verdict

WORKAROUND: commit with no upstream lore link — validation is not applicable. The commit message clearly explains the race condition and the synchronisation rationale, authorship and Signed-off-by: are consistent, the diff is minimal and correctly guarded, and the revert intent is documented. Safe to merge as-is; the cosmetic wording nit in the last sentence is optional to fix.


Final Summary

  1. Lore link present: No — WORKAROUND: prefix; no lore.kernel.org link expected or required
  2. Lore link matches PR commits: N/A — validation skipped for WORKAROUND: commits
  3. Upstream patch status: ⏭️ Skipped — vendor-only workaround, not posted to any mailing list
  4. PR present in qcom-next: ⏭️ Skipped — not applicable for WORKAROUND: commits

@sgaud-quic
Copy link
Copy Markdown
Contributor

PR #1164 — checker-log-analyzer

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

Checker Result Summary
Checker Result Summary
checkpatch Merge conflict in drivers/misc/fastrpc.c — checker never ran
dt-binding-check Merge conflict in drivers/misc/fastrpc.c — checker never ran
dtb-check Merge conflict in drivers/misc/fastrpc.c — checker never ran
sparse-check Merge conflict in drivers/misc/fastrpc.c — checker never ran
check-uapi-headers Merge conflict in drivers/misc/fastrpc.c — checker never ran
check-patch-compliance Merge conflict in drivers/misc/fastrpc.c — checker never ran
tag-check Commit subject starts with WORKAROUND: — valid prefix for branch tech/all/workaround
qcom-next-check N/A Target branch is tech/all/workaround, not qcom-next

Detailed report: Full report

Checker analysis — click to expand

🤖 CI Checker Analysis (checker-log-analyzer)

PR: WORKAROUND: misc: fastrpc: flush IOMMU TLB after releasing DSP process (#1164)
Source: https://github.com/qualcomm-linux/kernel-config/actions/runs/26015988476

Checker Result Summary
checkpatch Merge conflict in drivers/misc/fastrpc.c — checker never ran
dt-binding-check Merge conflict in drivers/misc/fastrpc.c — checker never ran
dtb-check Merge conflict in drivers/misc/fastrpc.c — checker never ran
sparse-check Merge conflict in drivers/misc/fastrpc.c — checker never ran
check-uapi-headers Merge conflict in drivers/misc/fastrpc.c — checker never ran
check-patch-compliance Merge conflict in drivers/misc/fastrpc.c — checker never ran
tag-check Commit subject starts with WORKAROUND: — valid prefix for branch tech/all/workaround
qcom-next-check N/A Target branch is tech/all/workaround, not qcom-next

❌ All Checkers — Merge Conflict (Pre-Check Failure)

Root cause: Every checker job failed at the CI sync step before any actual checking occurred — the PR's changes to drivers/misc/fastrpc.c conflict with the topic/tech/all/workaround topic branch that is merged first to build the integration tree.

Failure details (identical across all 6 checker logs):

Auto-merging drivers/misc/fastrpc.c
CONFLICT (content): Merge conflict in drivers/misc/fastrpc.c
Automatic merge failed; fix conflicts and then commit the result.
Merge failed or conflicts detected. Aborting merge.
##[error]Process completed with exit code 3.

The CI workflow:

  1. Checks out qualcomm-linux/kernel at baseline tag 9f3cbcbfaa5a143d339bcabf1a6a6ac98107e084
  2. Merges topic branch topic/tech/all/workaround into an integration branch
  3. Then attempts to merge PR WORKAROUND: misc: fastrpc: flush IOMMU TLB after releasing DSP process #1164this step fails because both the topic branch and the PR touch drivers/misc/fastrpc.c in conflicting ways

What the PR changes: Adds #include <linux/iommu.h> and inserts an iommu_flush_iotlb_all() call in fastrpc_device_release() in drivers/misc/fastrpc.c.

Fix: Resolve the merge conflict between PR #1164 and the existing topic/tech/all/workaround topic branch content in drivers/misc/fastrpc.c. Steps:

  1. Identify what topic/tech/all/workaround changes in drivers/misc/fastrpc.c:
    git log --oneline topic/tech/all/workaround -- drivers/misc/fastrpc.c
    git diff <baseline>..topic/tech/all/workaround -- drivers/misc/fastrpc.c
  2. Rebase or re-apply the PR patch on top of the merged topic branch:
    git checkout -b integ <baseline_sha>
    git merge topic/tech/all/workaround
    git cherry-pick <pr_commit_sha>   # resolve conflict if needed
  3. Ensure the final fastrpc_device_release() function incorporates both sets of changes correctly, then push the updated PR branch.

Reproduce locally:

git checkout -b integ 9f3cbcbfaa5a143d339bcabf1a6a6ac98107e084
git merge origin/topic/tech/all/workaround
git merge pr-1164   # will conflict in drivers/misc/fastrpc.c

Verdict

1 blocker: All 6 checkers failed due to a merge conflict in drivers/misc/fastrpc.c between PR #1164 and the topic/tech/all/workaround topic branch. No actual patch-quality issues were detected (checkers never ran). Resolve the conflict and re-trigger CI — the patch itself (WORKAROUND: prefix, single clean commit, Signed-off-by present) looks well-formed.

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.

3 participants