misc: fastrpc: avoid duplicate DMA mappings in fastrpc_create_maps() - #1437
misc: fastrpc: avoid duplicate DMA mappings in fastrpc_create_maps()#1437Jianping (Jianping-Li) wants to merge 1 commit into
Conversation
🔨 Build Failure Analysis — PR #1437PR: #1437
VerdictThis is not a compilation failure. The build failed during the integration/automerge phase due to merge conflicts between this PR and other topic branches. The PR changes to 📎 Detailed analysis: Full report |
🔨 Build Failure Analysis — PR #1437PR: #1437
VerdictThis is NOT a build failure caused by the PR. The failure occurred during the merge phase of the CI workflow when attempting to integrate the PR branch with the baseline integration branch. The merge conflicts in 📎 Detailed analysis: Full report |
PR #1437 — validate-patchPR: #1437
Final Summary
|
PR #1437 — checker-log-analyzerPR: #1437
Detailed report: Full report
|
The merge-base changed after approval.
d167cb0 to
7afcba9
Compare
21df30e to
aad9070
Compare
🔨 Build Failure Analysis — PR #1437PR: #1437
VerdictBoth failures are merge conflicts, not compilation errors. The conflicts are pre-existing integration issues between the PR's changes to 📎 Detailed analysis: Full report |
🔨 Build Failure Analysis — PR #1437PR: #1437
VerdictThis is not a compilation failure. The build failed during the merge/integration phase before compilation could begin. The PR introduces changes to 📎 Detailed analysis: Full report |
PR #1437 — validate-patchPR: #1437
Final Summary
|
PR #1437 — checker-log-analyzerPR: #1437
Detailed report: Full report
|
aad9070 to
351a95b
Compare
🔨 Build Failure Analysis — PR #1437PR: #1437
VerdictThe build failed during the automerge/integration phase, not during compilation. The PR introduces function signature changes to 📎 Detailed analysis: Full report |
🔨 Build Failure Analysis — PR #1437PR: #1437
VerdictThis is not a compilation failure. The build failed during the automerge/integration step due to merge conflicts. 1 conflict is directly related to PR changes ( 📎 Detailed analysis: Full report |
PR #1437 — validate-patchPR: #1437
Final Summary
|
PR #1437 — checker-log-analyzerPR: #1437
Detailed report: Full report
|
7afcba9 to
bff2f47
Compare
351a95b to
76ba89b
Compare
🔨 Build Failure Analysis — PR #1437PR: #1437
VerdictThis is NOT a compilation failure. The build failed during the automerge/integration step before compilation began. The PR introduces changes to 📎 Detailed analysis: Full report |
🔨 Build Failure Analysis — PR #1437PR: #1437
VerdictThe build failed during the automerge/integration phase due to merge conflicts. 1 conflict is directly caused by this PR's changes to fastrpc function signatures; 1 conflict is pre-existing in an unrelated file. 📎 Detailed analysis: Full report |
PR #1437 — validate-patchPR: #1437
Final Summary
|
PR #1437 — checker-log-analyzerPR: #1437
Detailed report: Full report
|
|
Pre-merge CI results — patch Build Failure Logs❌ Build failure: kaanapali-mtp❌ Build failure: lemans-evk❌ Build failure: qcs8300-ride❌ Build failure: sm8750-mtp❌ Build failure: qcs615-ride❌ Build failure: monaco-evk❌ Build failure: qcs6490-rb3gen2 |
76ba89b to
56fb4b3
Compare
🔨 Build Failure Analysis — PR #1437PR: #1437
VerdictThis is not a compilation failure. The build failed during the pre-build automerge step due to a merge conflict in 📎 Detailed analysis: Full report |
🔨 Build Failure Analysis — PR #1437PR: #1437
VerdictThis is not a compilation error. The build failed during the pre-merge integration step when attempting to merge the PR with the 📎 Detailed analysis: Full report |
PR #1437 — validate-patchPR: #1437
Final Summary
|
PR #1437 — checker-log-analyzerPR: #1437
Detailed report: Full report
|
The merge-base changed after approval.
55a9e74 to
1bc7df1
Compare
56fb4b3 to
793b294
Compare
|
Dev Completion validation failed CR: 4550248 The change task for this CR could not be moved to Dev Complete because of the error above. Please resolve the issue in Orbit and re-run the failed Orbit check. |
793b294 to
d90069e
Compare
|
Dev Completion validation failed CR: 4550248 The change task for this CR could not be moved to Dev Complete because of the error above. Please resolve the issue in Orbit and re-run the failed Orbit check. |
d90069e to
85c35b6
Compare
|
Dev Completion validation failed CR: 4550248 The change task for this CR could not be moved to Dev Complete because of the error above. Please resolve the issue in Orbit and re-run the failed Orbit check. |
1bc7df1 to
fab5742
Compare
…te_maps() DMA handles passed as invoke arguments (scalars beyond nbufs) may refer to the same dma_buf fd as an input/output buffer argument. Taking an extra reference for such DMA handle maps leads to duplicate mappings and an unbalanced reference count, since DMA handle maps are released separately when the DSP returns the fd through the fdlist. Fix this by not taking an extra reference for DMA handle arguments (take_ref = false) and tagging them with FASTRPC_MAP_DMA_HANDLE. As these maps are borrowed references, fastrpc_get_args() re-validates the map via fastrpc_map_lookup() before dereferencing it, so it is not used after being freed. fastrpc_put_args() only releases maps flagged as FASTRPC_MAP_DMA_HANDLE and clears the flag to guarantee the map is freed exactly once. Also reject FASTRPC_MAP_DMA_HANDLE in fastrpc_req_mem_map(), since such handles are already mapped implicitly during the remote invoke call and must not be mapped again through the explicit MEM_MAP path. Link: https://lore.kernel.org/all/20260805060940.41414-1-jianping.li@oss.qualcomm.com/ Fixes: 10df039 ("misc: fastrpc: Skip reference for DMA handles") Cc: stable@kernel.org Signed-off-by: Jianping Li <jianping.li@oss.qualcomm.com>
85c35b6 to
4019297
Compare
|
Dev Completion validation failed CR: 4550248 The change task for this CR could not be moved to Dev Complete because of the error above. Please resolve the issue in Orbit and re-run the failed Orbit check. |
fastrpc_create_maps() performs map lookup only for buffer arguments (i < ctx->nbufs) via fastrpc_map_create(). For
arguments beyond this range, no lookup is performed, which can result in duplicate DMA mappings for the same file descriptor.
Additionally, if the same file descriptor is passed multiple times within a single invocation, performing lookups with
reference counting would increment the reference multiple times, while fastrpc_put_args() would release it only once,
leading to an imbalanced reference count.
Fix this by allowing fastrpc_map_create() to control whether the lookup should take a reference. For arguments beyond
ctx->nbufs, the lookup is performed without taking a reference, ensuring that existing mappings are reused without introducing duplicate DMA mappings or reference count imbalance.
CRs-Fixed: 4550248