From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: misc: fastrpc: Fix initial memory allocation for Audio PD memory pool Date: Thu, 04 Jun 2026 13:11:15 +1000 Message-ID: In-Reply-To: <20260602071750.526-2-jianping.li@oss.qualcomm.com> References: <20260602071750.526-1-jianping.li@oss.qualcomm.com> <20260602071750.526-2-jianping.li@oss.qualcomm.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review **Purpose:** Fix a bug where `inbuf.pageslen` is always 0, so the initially allocated buffer is never registered with the Audio PD. **Analysis:** In the current upstream code (line 1355), `inbuf.pageslen = 0` is set unconditionally *after* the remote heap allocation block. The remote heap buffer is allocated and SCM-assigned, but pageslen stays 0, meaning the DSP never learns about the allocated page. This is a real bug. The fix moves the `inbuf` field initialization *above* the `if (!fl->cctx->remote_heap)` block, and conditionally sets `inbuf.pageslen = 1` inside the `if (fl->cctx->vmcount)` block after a successful `qcom_scm_assign_mem`. ```c + inbuf.client_id = fl->client_id; + inbuf.namelen = init.namelen; + inbuf.pageslen = 0; if (!fl->cctx->remote_heap) { ... + inbuf.pageslen = 1; } } - inbuf.client_id = fl->client_id; - inbuf.namelen = init.namelen; - inbuf.pageslen = 0; ``` **Verdict:** Looks correct. The logic is: default pageslen to 0, and only set it to 1 when the memory was freshly allocated and SCM-assigned in this call. On subsequent calls where `remote_heap` already exists, pageslen stays 0, which is the intended behavior (don't re-register already-registered memory). The Fixes tag and stable CC are appropriate. --- --- Generated by Claude Code Patch Reviewer