FROMLIST: misc: fastrpc: Add missing bug fixes#433
FROMLIST: misc: fastrpc: Add missing bug fixes#433Jianping-Li wants to merge 4 commits intoqualcomm-linux:qcom-6.18.yfrom
Conversation
…emory pool The initial buffer allocated for the Audio PD memory pool is never added to the pool because pageslen is set to 0. As a result, the buffer is not registered with Audio PD and is never used, causing a memory leak. Audio PD immediately falls back to allocating memory from the remote heap since the pool starts out empty. Fix this by setting pageslen to 1 so that the initially allocated buffer is correctly registered and becomes part of the Audio PD memory pool. Link: https://lore.kernel.org/all/20260407100508.1027-2-jianping.li@oss.qualcomm.com/ Fixes: 0871561 ("misc: fastrpc: Add support for audiopd") Cc: stable@kernel.org Co-developed-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com> Signed-off-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com> Signed-off-by: Jianping Li <jianping.li@oss.qualcomm.com>
this is failing because mainline component in the CR has not been associated with valid mainline changes. |
@Jianping-Li please update CR with mainline changes |
Test Matrix
|
…tion fastrpc_req_munmap_impl() is called to unmap any buffer. The buffer is getting removed from the list after it is unmapped from DSP. This can create potential race conditions if any other thread removes the entry from list while unmap operation is ongoing. Remove the entry before calling unmap operation. Link: https://lore.kernel.org/all/20260409062617.1182-3-jianping.li@oss.qualcomm.com/ Fixes: 2419e55 ("misc: fastrpc: add mmap/unmap support") Cc: stable@kernel.org Co-developed-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com> Signed-off-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com> Signed-off-by: Jianping Li <jianping.li@oss.qualcomm.com>
drivers/misc/fastrpc.c
Outdated
|
|
||
| if (domain_id == ADSP_DOMAIN_ID) { | ||
| data->remote_heap = | ||
| kzalloc_obj(*data->remote_heap, GFP_KERNEL); |
There was a problem hiding this comment.
check if kzalloc_obj is supported on 6.18-y
There was a problem hiding this comment.
will replace it with kzalloc
sgaud-quic
left a comment
There was a problem hiding this comment.
Compilation errors please fix :
https://github.com/qualcomm-linux/kernel-config/actions/runs/24238326456/job/70766462532
/opt/actions-runner/_work/kernel-config/kernel-config/drivers/misc/fastrpc.c: In function ‘fastrpc_init_create_static_process’:
/opt/actions-runner/_work/kernel-config/kernel-config/drivers/misc/fastrpc.c:1448:43: error: ‘struct fastrpc_buf’ has no member named ‘dma_addr’
1448 | !fl->cctx->remote_heap->dma_addr ||
| ^~
/opt/actions-runner/_work/kernel-config/kernel-config/drivers/misc/fastrpc.c:1455:54: error: ‘struct fastrpc_buf’ has no member named ‘dma_addr’
1455 | pages[0].addr = fl->cctx->remote_heap->dma_addr;
| ^~
/opt/actions-runner/_work/kernel-config/kernel-config/drivers/misc/fastrpc.c: In function ‘fastrpc_rpmsg_probe’:
/opt/actions-runner/_work/kernel-config/kernel-config/drivers/misc/fastrpc.c:2464:42: error: ‘struct fastrpc_buf’ has no member named ‘dma_addr’
2464 | data->remote_heap->dma_addr = res.start;
| ^~
/opt/actions-runner/_work/kernel-config/kernel-config/drivers/misc/fastrpc.c: In function ‘fastrpc_rpmsg_remove’:
/opt/actions-runner/_work/kernel-config/kernel-config/drivers/misc/fastrpc.c:2574:60: error: ‘struct fastrpc_buf’ has no member named ‘dma_addr’
2574 | err = qcom_scm_assign_mem(cctx->remote_heap->dma_addr,
| ^~
make[7]: *** [/opt/actions-runner/_work/kernel-config/kernel-config/scripts/Makefile.build:287: drivers/misc/fastrpc.o] Error 1
… in probe Allocating and freeing Audio PD memory from userspace is unsafe because the kernel cannot reliably determine when the DSP has finished using the memory. Userspace may free buffers while they are still in use by the DSP, and remote free requests cannot be safely trusted. Allocate the entire Audio PD reserved-memory region upfront during rpmsg probe and tie its lifetime to the rpmsg channel. This avoids userspace- controlled alloc/free and ensures memory is reclaimed only when the DSP shuts down. Link: https://lore.kernel.org/all/20260409062617.1182-4-jianping.li@oss.qualcomm.com/ Signed-off-by: Jianping Li <jianping.li@oss.qualcomm.com>
Make fastrpc_buf_free() a no-op when passed a NULL pointer, allowing callers to avoid open-coded NULL checks. Link: https://lore.kernel.org/all/20260409062617.1182-5-jianping.li@oss.qualcomm.com/ Co-developed-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com> Signed-off-by: Ekansh Gupta <ekansh.gupta@oss.qualcomm.com> Signed-off-by: Jianping Li <jianping.li@oss.qualcomm.com>
eda869a to
d1a141e
Compare
Test Matrix
|
sgaud-quic
left a comment
There was a problem hiding this comment.
@Jianping-Li smmu test failed on RB8 device, please check :
https://lava-oss.qualcomm.com/scheduler/job/73414#results_5356
+ /lava-73414/0/tests/0_qcom-next-ci-premerge-tests/Runner/suites/Kernel/Baseport/smmu/run.sh
[INFO] 2026-04-13 18:59:32 - -----------------------------------------------------------------------------------------
[INFO] 2026-04-13 18:59:32 - -------------------Starting smmu Testcase----------------------------
[INFO] 2026-04-13 18:59:32 - === Test Initialization ===
[FAIL] 2026-04-13 18:59:32 - smmu : Test Failed
[INFO] 2026-04-13 18:59:32 - Writing to ./smmu.res
+ true
+ /lava-73414/0/tests/0_qcom-next-ci-premerge-tests/Runner/utils/send-to-lava.sh /lava-73414/0/tests/0_qcom-next-ci-premerge-tests/Runner/suites/Kernel/Baseport/smmu/smmu.res
[ 357.887290][ T132] spmi spmi-0: disallowed SPMI write to sid=0, addr=0x6146
[ 357.994867][ T619] read descriptors
[ 357.998591][ T619] bcdVersion must be 0x0100, stored in Little Endian order. Userspace driver should be fixed, accepting 0x0001 for compatibility.
[ 358.012163][ T619] bcdVersion must be 0x0100, stored in Little Endian order. Userspace driver should be fixed, accepting 0x0001 for compatibility.
[ 358.025747][ T619] read strings
<<<LAVA_SIGNAL_TESTCASE TEST_CASE_ID=smmu RESULT=FAIL>>>
Test Matrix
|
This patch series adds the listed bug fixes that have been missing in QLI2.0 fastRPC driver.
following fixes:
Link: https://lore.kernel.org/all/20260407100508.1027-1-jianping.li@oss.qualcomm.com/
CRs-Fixed: 4483711