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 8206B3FF1 for ; Fri, 22 May 2026 07:47:39 +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=1779436060; cv=none; b=If+eOm3dubaj7SZwrUVCcPG9TvQ7RJdRu1CA/HQotU/Ea5gIzHhEm46FQYfJpX88QWSm0qTAIh2mM5x8R+4YV+U1aLSED7Piewm77zGikG9K14gAHBfhtFP9djJvmm/ku5Qi1V/RzwS9qBTBwz/RPKo7eeApAyb8/IhRSZqDuGs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779436060; c=relaxed/simple; bh=5KMfQqM5yIRy01sPruuWrSoPgsJF1BXuLYYNHGbg5ME=; h=Message-ID:Date:MIME-Version:Subject:To:References:From:Cc: In-Reply-To:Content-Type; b=e+ts4RqN3yj86MubY3Y5xDeX0Aon/dFh1NXzv0l3MXNEqSDgrtxHZfia8F3tVM8ZYSZafMMYOtqemr77LWrdpdptpm8N2Kufa2P9v7K8fJ7hm4svBdATxn9tFXkOsL47n6CXSh032s4Mcoo4IJ/1eXPUmYomLWbc/73Syn5PLoo= 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=fDDYluL0; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=TMJNQAFW; 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="fDDYluL0"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="TMJNQAFW" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64M7NXlk778825 for ; Fri, 22 May 2026 07:47:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= HStTuWaVOAJ9glhTw5Ili583PqBxaZli5bgevCDJEdc=; b=fDDYluL0Ud6xeXny WL3CL8yX1+0c7XeRp/6jO4d2cgAA8afXq3PZK1oL82GZXsyAr0AblWltaFcQ9eIv btxrgl5TXDhhWWYT5X5jaF2SUbop6QnzI28fyVHRtdb9bXZOdiLtm9AX1oW6nsnw IICCCuXuIsrNOKSdJFrQhDjc3mCYKonKxtQqGvZbO8mBuqEIYMTsF7U3WbNEwIPS XWe7lhLmTCmBa0AWNpnJ/jvWdQaFITsTvQNbK1GU9qlFSg85dahHD59geBDyTOLL adAFHSe/NBYBaQ/UxT0716IYjWOgSYzM5uUaRcw0yp5hNQ+VuYvpDADG1Qh700qV zzPxBw== Received: from mail-pl1-f197.google.com (mail-pl1-f197.google.com [209.85.214.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4eac7ase0e-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 22 May 2026 07:47:38 +0000 (GMT) Received: by mail-pl1-f197.google.com with SMTP id d9443c01a7336-2bc763c7256so161572205ad.3 for ; Fri, 22 May 2026 00:47:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779436057; x=1780040857; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:cc:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=HStTuWaVOAJ9glhTw5Ili583PqBxaZli5bgevCDJEdc=; b=TMJNQAFW16BSdQp7q30ChulazCTYGcc9pdvI2tnAuJd/OkB4X7a5/sNEEZ2yI23sjo cXCvgECVt/wRFXBuLadAimnH1BeS7X7Jk7yj4SZyiC42QY/MpNaDNInHwXofdoNhXGTV HVxYvpuSqxTywfVaFHh0zjWWQ1OQ00JURpH8kGM2sAlllAwkmypCF6H/ZqhHXmQs98YO WwRh5daiWDrKsAsK5fUgsQCkqc1G/tPpfp3R/FihrbjHO4yRtw59U0VirmtNVlPTUUxO w5bWVfuGIUHzu5LcGefjxjVsiHs4jOyGQsRJ5FAcHCw7cDyjmTS1KgkoKgnlK2GdxAUf QasQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779436057; x=1780040857; h=content-transfer-encoding:in-reply-to:cc:from:content-language :references:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HStTuWaVOAJ9glhTw5Ili583PqBxaZli5bgevCDJEdc=; b=rVZX1ypI2i+53V9xjyGLxxZDGKEuHpewLB8wQw+VAp0iNNFPDuG4blu1DyAhFezY5f 3TJdnNlG99QhnPn85kVz8FkEOidB6NNF+6t0bV/fw3bGZl8XJaGFIoO8sRsrU6JiUkFZ 0a50PikHK0gPI/vlTTpwbyVrcX2iGGEyOaEI0IlJOocjbRQGMYuwCmY0WJwZRdOzl04G bvm6cXRXCHkNKXy0K69bCU35cZvuFT4x2f7qGXJFsOa9HBGdQ+8Hqr6V6zabluL+Shxs hnUQ6JvIOsxzJAAK8osmOQm+PuxLytyomNhazZT0jy/KHWSxzkii4q0GAZk+kGjsy/1y L5xA== X-Forwarded-Encrypted: i=1; AFNElJ9zFREFb5IuLnUkNcUmIL7jheELzFGCJZMi9L9XLNT4tl74v+lVyOh7/uMMSgSFGfCfYbkqCpfWqlFKWuE=@vger.kernel.org X-Gm-Message-State: AOJu0Yz6JyIUu04GeTzScjCBQz6bXw4aj6FV5fdBdYqJkvxosqn9wwga cNDf5bW1TeFijngGjsqd88WPCA7kHdstlo0ZE6Jhc+o3bKP+WVWGl+l8Rz1NaISR7mhhbPUOdOE mvYnoND0VBo5cgy+hniOtt8QPUgxhEehnzeviEKCz/KSthwmH5nZY/wbOIQJkQV3Uvt4= X-Gm-Gg: Acq92OFXi9mzGUnUXw1BzlYjkjr3+RreXfbFaEOkvHfeNDShpKHiVlpXiQ1pp0WG06+ +1ds9Uo+jnklbZ/KWlaHAWFJ0L0powmws0MQbnW8KzmzyDrCaT+j8216wEq1ErbWYq/xRiS97Di XNmkGQGHEJLvVzzaL4TRGCtCxvFzNs9Uv6/9NRPM4T7oqMWWDoJwXp3uMfVbBpEQQAAFPyfpSVV jRjhkVdudiswk4lwydyX4wUNHoDBXfb8RrpoeR3X4bhTf+n8IRpA13zHm1DUNAw85N8iSyF8kC0 w6Qc9OVtKCe0+LXCLhas18z1834565EVoazyFIZZqfcTTtQQHSOQ0vl60kyLeO6/is8jK9CtL+x BJ01MkARhqrPh6m8gLim6VBmF6H9kItIzjBxW2W1NSNW0M3rNQUPyVrMDsD9XCtWFhX46PQyXLc zDLvY7Y5dlZv6V2cqb2LkjBC23vAg= X-Received: by 2002:a17:902:d2c1:b0:2bd:b6f6:3446 with SMTP id d9443c01a7336-2beb0633f1emr28086865ad.3.1779436057432; Fri, 22 May 2026 00:47:37 -0700 (PDT) X-Received: by 2002:a17:902:d2c1:b0:2bd:b6f6:3446 with SMTP id d9443c01a7336-2beb0633f1emr28086605ad.3.1779436056988; Fri, 22 May 2026 00:47:36 -0700 (PDT) Received: from [10.133.33.160] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2beb5924211sm7030285ad.84.2026.05.22.00.47.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 May 2026 00:47:36 -0700 (PDT) Message-ID: Date: Fri, 22 May 2026 15:47:31 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 4/5] misc: fastrpc: Allocate entire reserved memory for Audio PD in probe To: Dmitry Baryshkov References: <20260515124217.20723-1-jianping.li@oss.qualcomm.com> <20260515124217.20723-5-jianping.li@oss.qualcomm.com> Content-Language: en-US From: Jianping Li Cc: srini@kernel.org, amahesh@qti.qualcomm.com, arnd@arndb.de, gregkh@linuxfoundation.org, abelvesa@kernel.org, jorge.ramirez-ortiz@linaro.org, linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Ekansh Gupta , quic_chennak@quicinc.com In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: lhRMjnD4PfZ5nCZ6MseB_gB5knqv_PaH X-Authority-Analysis: v=2.4 cv=JrbBas4C c=1 sm=1 tr=0 ts=6a100a1a cx=c_pps a=cmESyDAEBpBGqyK7t0alAg==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=gttq3t2AYlGpivilpbwA:9 a=QEXdDO2ut3YA:10 a=1OuFwYUASf3TG4hYMiVC:22 X-Proofpoint-GUID: lhRMjnD4PfZ5nCZ6MseB_gB5knqv_PaH X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIyMDA3NSBTYWx0ZWRfX2XEX9gFQ16jE md2uHNwPqu0z+IBh7efSXSsU3wO8qHDZ/AjRUZPPJ5cGfZVArwehVG1DRLAB20+w8gPBPO9h41e f4eFRbVKy+HkGtYAlDFuMH7kmgjyoHxoL8fx0K0RTKAfVpO+uFivzx4rP1zlWb2J7/EnpASfjGW dL9U98fv47AvEKHXObO/h30O2xRvjPAaddvRl4u5agsDdzuwEZDtmDPF3sWzqQfxl9CPoi3eTDs 2hOhPBeG7CbOpN1bvRv5pJQOzcn+WktP51C+Paj/06iQc8jLFQIUfnpBbICGfBGqWS8TiSLdW7+ HawNItzz7rZIFhjNsvO/aXCwmBr5G1Qv6Gq0K/AqzSyFcA0yniZ3JRoeaivDpTjMj7TTWrwY9fz MbZ03SwkOhb2Z4fxjoHAgspgn7tn3VPF1lbuv2yB0GX81Aiuy28I5W7ZW7gidMZtjW0Ik+V8E/1 7HSIKwD41ihEsjVPhsA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-22_01,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 suspectscore=0 clxscore=1015 adultscore=0 lowpriorityscore=0 spamscore=0 malwarescore=0 phishscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605220075 On 5/15/2026 9:38 PM, Dmitry Baryshkov wrote: > On Fri, May 15, 2026 at 08:42:16PM +0800, Jianping Li wrote: >> 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. > So, is this a bugfix or not? Is it possible to make the kernel misbehave > without this patch being applied? Yes, this is a bug fix. Because currently after the audio PD requests to grow the heap, the current kernel does not support shrinking the heap, which will all cause memory leaks. The current modification is to allocate in advance and release uniformly, which will avoid this error. Thanks, Jianping. > >> Signed-off-by: Jianping Li >> --- >> drivers/misc/fastrpc.c | 107 +++++++++++++++++++---------------------- >> 1 file changed, 49 insertions(+), 58 deletions(-) >>