From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF2E635E94E for ; Tue, 9 Jun 2026 02:59:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780973990; cv=none; b=tL7siBhW4v+a0iZH9XLYzmk9dFX7o8TkrcJzrqS4aJ9xeG6ETuFUU2GiG+3AdAxvcNsIVuJGtmsm6SHCYEW5Bmq0Yu8W0x3Y3SQZjB448w9pgHRUwe7ja1HmW049WYvrFVaH4wTkAThTcQRayM8zq2Nv66B9zdIhnVxNqDn8xrI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780973990; c=relaxed/simple; bh=pxG9S1C8F/EdOXg/my2/Ig9rtt5BF7XRTqYBXZre2zs=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=ETW6foxXRrgaeo47QHZ14vaMG9viaDK54bMSu01EXv5CRaUj+It72GnAxKVES6tFQCYf/Hfa0qmAWnMWKmUB0XeJe0y0z53kVKD/heARNe8YPRQFrQqd7O0+BKbt0EesvjFaFlppQRaivbaNz/4Uj6Dw1zU4XXi2fH/WPpVyOYI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=mKBQS0ya; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=kgmdOXUe; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="mKBQS0ya"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="kgmdOXUe" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6590sFX5996103 for ; Tue, 9 Jun 2026 02:59:47 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:message-id:mime-version :subject:to; s=qcppdkim1; bh=ATfqrK83DCS8vP1sxQooyW+tmeEThP3HfRL fmcmX9k0=; b=mKBQS0yahjpgtjrb6F2pR9TEurOZkiuuNcMTHNmGkVK/Qa3/bDz dJrA3XWIVX98ui6q9mXxk11BYEepXOH1S8FtZi4aoDDX8gkUa+cbmWdMiJdymDr4 S7799A+6B/8D12n0J9swyWBsf2HPj/yyEiy4Pla0HecngwerxlhHTZvXNKInvrVd GJINw6n/k+IlmNedOtWo0iuzgmRaCaeydaKZKDy3ABhUwnv5QbE+PxfaKhd/4YUm FJflm8oJeWF7apbl5d2enjiTgWimRNX9tBTs3Pqh1M+0jTxUH6jsXU1zMBooGLHl ob/g92+uxR0JLx+1rYXEVPkmhWWOTG7Auvg== Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4enx2rudxw-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 09 Jun 2026 02:59:47 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-36d6389bbf4so4700116a91.3 for ; Mon, 08 Jun 2026 19:59:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1780973987; x=1781578787; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ATfqrK83DCS8vP1sxQooyW+tmeEThP3HfRLfmcmX9k0=; b=kgmdOXUersLzBzCawakDXW/dCm0vfyZaYbXrWk1wQrWtNHPynaDp89Easf5U9PiJ66 k0fid7c2wYEsjHiPgMLDK2mirNEJKQR/3wX1qntaOqdS51Re6TkljNxTA5TPGg4tcZdK lnqGiG0wH0JLh3aA35VuYTeEfpmBR3/xYZzqwR9boYTQFVHBaj4WqHwS4JyB/1ajS9Gg L6fstw8jZ0a45Qujio7vKypNM8Urw2mYKPR/sNVQhuvCM0qEazilktQD2N4id7i8EINO 6paJDwb3JF21jtYUbWT09Z9Mqqnw8IiohL4qGi0R3FgWh0w6gtHXqyQjY1GTB4U6XOwD Uh7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780973987; x=1781578787; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ATfqrK83DCS8vP1sxQooyW+tmeEThP3HfRLfmcmX9k0=; b=PA2B8fFLxn6Pt+Eaeq8OtC2FXqRH5ikt8H3XoW9dk3dvS+SQ1Gg0xEQitog1o41CaY 5Zhj1G76c0HWKamTHLO383joNyLfVgF42dzv05fHX1q6nBEap4qyaed5rl/c/Mmc9Zhx Yb5qvKMWC9lxHz9wYbTLfPvcx3863ZSwsKM5smm7R/fXIAcKXWAofTjF9hGugMvdabaU K6Bv9pmRSKzvCCJzezbjE1TejrII2HgsPJcpBw/Xs+zXULRpTYNnhKtOlc4CeEXdLhn7 UXUa2Mbltdp05P3Avc66jMPXsabFHG8agBWMhqLOG3gJj0RKMDCaA+vlJ4pclYr4AwLw Qfcw== X-Forwarded-Encrypted: i=1; AFNElJ9m53LN/fL4DzsTAeaxslWUyygqckRDzQmXgPcWVw8vNVIOwAGpgwk/9LK2H/G4WlRDX3lRoyYXch87MQw=@vger.kernel.org X-Gm-Message-State: AOJu0YzWBpve9yG7g8qCOlzmzZ5nK84b46vnkDSsoPBzXBPxswNJsgrC shQOZHvigilttJszF/EeeCt4p+4EZ7XPn0yDAN2esZkudJ2Ic6K+r/jF9+azBw90/x4lHitKoYQ VTEpx+pyiWVsesMCDzPi/iv161y8DwyS4gSjpuyQsnf9J9pfxQ1KTugycGo02Ue3D1y0= X-Gm-Gg: Acq92OGZrMjyBNJVtb6TzC/TKwpNJNWqJKeZXmRApaAy+Lr5fX94rJASHXSpPfns+q7 jPRM6O6b6Kg2HvSJW/K92XEts1WjcLo6Gr0y1wudPSGhDiKTHLEb1T4zGtY+P1RSWkdH7zM1k9K jhva3w3GhFRp4hMx6TSMeUuqEwuXLZM9SHdcBrVloOKiPidfPslgSC0KSOaKmFeV/UekXuKHYcZ Yh8EPNXInGIBn/njeW1XVrKsOIdmCBd6tZ1W8L0Q7TIDOKGyWQbvNXtdpoBhf0MVZxlEp/XGKXo R8/TsKEO52vfXaQFJ2KV3syOKCAb+CssS7REp3+O5pL+MHCVivL1NZ2vZTbnrL6J7FoOPj4JmOO HCDBZPIIfAwtnOq84TW8rbHBJXMyjXBijIOrcsPboBf045fMWg2xnXsi1hnxWzYIyvFTwm9AlBB f6IXd9On0D2W9f2VVphwABCoXKPjVN X-Received: by 2002:a17:90b:4a08:b0:36b:71e6:3df1 with SMTP id 98e67ed59e1d1-370ee447dd2mr20935862a91.3.1780973986613; Mon, 08 Jun 2026 19:59:46 -0700 (PDT) X-Received: by 2002:a17:90b:4a08:b0:36b:71e6:3df1 with SMTP id 98e67ed59e1d1-370ee447dd2mr20935841a91.3.1780973986188; Mon, 08 Jun 2026 19:59:46 -0700 (PDT) Received: from QCOM-SocCW5bzXR.qualcomm.com (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3712fcb2607sm8713835a91.0.2026.06.08.19.59.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 08 Jun 2026 19:59:45 -0700 (PDT) From: Jianping Li To: Srinivas Kandagatla , Amol Maheshwari Cc: Jianping Li , Arnd Bergmann , Greg Kroah-Hartman , Abel Vesa , Jorge Ramirez-Ortiz , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, ekansh.gupta@oss.qualcomm.com, quic_chennak@quicinc.com Subject: [PATCH v8 0/4] misc: fastrpc: Add missing bug fixes Date: Tue, 9 Jun 2026 10:59:34 +0800 Message-Id: <20260609025938.457-1-jianping.li@oss.qualcomm.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: JvkYqlu4QNhWueDGv60lzbsBTO8qVJa- X-Proofpoint-ORIG-GUID: JvkYqlu4QNhWueDGv60lzbsBTO8qVJa- X-Authority-Analysis: v=2.4 cv=JdqMa0KV c=1 sm=1 tr=0 ts=6a2781a3 cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=QQhtNXlrgi-O-yTIfioA:9 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjA5MDAyNSBTYWx0ZWRfX9EWnorPfDdCg 8IyKaVkq1PsbVLqrBg1d/SLIzctHE5PGA3nC/44Gx+q+Ti/rVNWTPFxueyL6pwZkvpf4z7YSP8P qYNq59urS1Z0ll588/rgsXBtbYpssCqFb3HwyUC8MSy2zB5ju6g9n7X+9mLXYJBTceWlwN51kOJ Y3Yxz1kif91fdUKsQU0d8aOWI5OUA5Un9d/NIiL0IRzZfCixpZ+PjCCzql0omUjGAj/ySjmzwy6 q6QoNSfm2oDE9M4DmSwQzOCEFzFISs+ynGBy6J1ukBC8wB9qgEZGuF4KYgfiF6VYQN2g69DCjbb 6X35SnrK/svDHMQ87TN2du0oANKiVBhf2jGQAB4SofpZ+6C9BB80VyJhbTlGqtnzWny05Ol7sJo 6NIpeJJn58n05jyQlncrUOxQ6Zrp0qWG4iL/RrNQccoQda3iWh3WRwrFIwhiXEvyp2NRjQMB/il 572kjgANB5s+iqhiZ9g== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-08_06,2026-06-09_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 phishscore=0 adultscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605210000 definitions=main-2606090025 Add missing bug fixes in memory areas. This patch series fixes multiple memory handling issues in the FastRPC driver, primarily around the Audio PD remote heap. The Audio PD uses a reserved memory-region that is shared between HLOS and the DSP. Allocating and freeing this memory from userspace is unsafe, as the kernel cannot reliably determine when the DSP has finished using the buffers. To address this, the entire reserved memory-region for the Audio PD is now fully assigned to the DSP during remoteproc boot-up, and its lifetime is tied to the rpmsg channel. Patch [v7]: https://lore.kernel.org/all/20260602071750.526-1-jianping.li@oss.qualcomm.com/ Change in v8: - Squashed "Fail Audio PD init when reserved memory is missing" into "Allocate entire reserved memory for Audio PD in probe" as the validation check depends on the probe allocation - Fixed error path in probe: use goto err_free_data instead of bare return when kzalloc_obj fails - Added kfree(data->remote_heap) in err_free_data path - Made kfree(cctx->remote_heap) unconditional in rpmsg_remove, not tied to vmcount or qcom_scm_assign_mem result - Used local cctx variable consistently instead of fl->cctx Change in v7: - Removed duplicate remote heap validation check; keep it only at the beginning of fastrpc_init_create_static_process() Change in v6: - Separate the handling of err_copy - Place the check for remote_heap at the beginning of the function Change in v5: - Split reserved-memory handling into separate patches Change in v4: - Fail Audio PD static process creation when no reserved memory-region is present, instead of silently proceeding Change in v3: - Adjusted the order of the series, placing NULL check changes that are not bug fixes at the end - Modified the commit message to describe the bug background in detail - Switch buf->list_lock back to fl->lock - Add locking to the operation of audio_init_mem Changes in v2: - Remove the if check outside fastrpc_buf_free - Store the spinlock pointer in the struct fastrpc_buf instead - Allocate entire reserved memory to audio PD through remote heap Ekansh Gupta (3): misc: fastrpc: Fix initial memory allocation for Audio PD memory pool misc: fastrpc: Remove buffer from list prior to unmap operation misc: fastrpc: Allow fastrpc_buf_free() to accept NULL Jianping Li (1): misc: fastrpc: Allocate entire reserved memory for Audio PD in probe drivers/misc/fastrpc.c | 137 ++++++++++++++++++++++------------------- 1 file changed, 75 insertions(+), 62 deletions(-) -- 2.43.0