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 CE413395DB7 for ; Thu, 5 Feb 2026 09:04:43 +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=1770282284; cv=none; b=bCHkU6OLFKUrB5SDheRuBsF4j1qcRi0dQRZis/KlsVv1r2OBClABoBVk9ZnPkfWqpoTPiSvZNGRRdD9GvAP/t/mxh8ekMC9/DdJWp+86EmJOfcH04cnqypolC4W+YxAGg2bJqhtOCLoIW+G2rokKjJuyoUWKhvvUNwZP7a8wTAU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770282284; c=relaxed/simple; bh=Krv9fO3Rxovb62iG+JbCuDQ52AHKuJ4On8QLflhEybM=; h=Message-ID:Date:MIME-Version:Subject:To:References:From:Cc: In-Reply-To:Content-Type; b=b2+z6S7suyiwdleZzQ5fUQXdaBR05M49NnDqiZSe81LBDCOhEdeU6bKbrnErVe/x4yQ7GG25dG+cEZk8g4v+KHrAZb6VJNrOKz1TpYzoIT+1hirrvOOR7fgY2jqg+53kffbO5245y3Eaon08eejU9dSYK1/BUvpLwYAJUEysGaA= 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=aYzPURQU; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=koDBWlj9; 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="aYzPURQU"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="koDBWlj9" 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 6153e2T32158111 for ; Thu, 5 Feb 2026 09:04:42 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= LByn2VpBX5A4tuU5+bD1nh0xOghUOXhc6iS2XDov8zA=; b=aYzPURQU3nY/tKTC tJDlUa7yIyknTjAi+coZKgJ3rSfqCJKG4Ks7vlW4W5f9eYhoywHJyRTLCcVWSpuj 1r1lwiYUuq+kkqYqJGTB6XoR3H+wyn2W8XZkrVPXnLOOkKP/MQX4GKXRIXVQ2fa1 yhDtdPeKS11Lbts2oerydXWlP5ABSemXix1dVhXykovgJBxcDSNqbrV3Qd+5Cb16 MGaVcfVyxSK2GMboeai3L851AW8C2pYZAv/Fxbw/Gs/TdwwoCXNvmi2j3sHcABBb oigkC9V+y55u3kxlBr9Lq0ItzcoNaRBm8aHj0p9I+NeJwncdvyv90vOcUa1IAVHU 1X/EHg== Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c4gyns95w-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 05 Feb 2026 09:04:42 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-c551e6fe4b4so458481a12.3 for ; Thu, 05 Feb 2026 01:04:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1770282281; x=1770887081; 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=LByn2VpBX5A4tuU5+bD1nh0xOghUOXhc6iS2XDov8zA=; b=koDBWlj9JArCOBmR3vgsNprEVg9Izo/lUnNfOIXbYp7z5tPuYIBY12lROF1AhRpeoT PL6fR6XChoL75LBBWG+l+RQ1Neqxto+im2POhurjeDAlnsdsvAyS9kYoGhyNjpuRvF0d pfv4nzqm4/CMCJOs0JvgWc7uMRGaM66kjV7SmPrV5V0jmUSEC1uvOgrIRa4QzuJg/4nv bXJqNfUj+zXCWi7Ln7l8tXaTKysBKMBYAyR5DKiZABKoV+VlCQwtYk1A6CPF40/f4c6r xrl+l4vqEKKbOQjpYpsP3PT+4uFEpg2pqe+2sO+qNU9rYx5pC0P5J5lvRBkOrDD5d7e1 dSjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770282281; x=1770887081; 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=LByn2VpBX5A4tuU5+bD1nh0xOghUOXhc6iS2XDov8zA=; b=fBP60wn6i1IFzruZdxLdF/J3WbEp7kyEiqjTIdVoaPXPmkaVKFHBculbPgzCJl+xr3 pg0W3gidsaMl0/FGWhBIHxadPl/KQESjrQTFEFnSHNzW/ziKcPSt7nAJ3/f/aPKjKbJe uhJExnIWIEuJ58nFpFjlJoFwFJAMsN2kPhi2nk6J0Z/j1+ilQHI9BjKBxM3fW95a8yiN Q+/Y56im9QqB2d8u3mQr3YkN5hzL5Jj5WHD/BxCIIPq8F35fMXQWpp5ZHmu6oMjb0LyY My4057bPMH+/Tae+cmNEG7mSZkKN31xwNPdIjPFDYYSNb6NxbkAm8r4taY/xM+RevYBN 060w== X-Forwarded-Encrypted: i=1; AJvYcCXRSO1o5CJzMkqf1PSeuTbmHPN3GK8Pl0HWF5/h2Vj+Po+J88zUpPm2HtrGyscbfs+uMpMSvgoX9jp4QSw=@vger.kernel.org X-Gm-Message-State: AOJu0YxUH0KiYIMWK2x/66EbjzLLcCCDwewxCK6xsRSOXehSqPDWWi7I Pih7G5ffzTQMdORLpMfYp993LFwevJHCTUaPVtYK5nFHNtL8EQVYWyF1ZVuywZXGy6SXPYRthEc znn1UA7qO01IS8LcJ22+xcXh5/w582yYsvEkc63Fg88oxcLDprj/6bez6vWnUyG2SoWc= X-Gm-Gg: AZuq6aJ/UZKzBO/btTWuoESnJwy7wv7GPINI84/4sVUkm9enajsZ8cG1oQvOvIQhFW2 P/J+7Ou62UT/AjGHt/vp69oz+Sy96+BNAdT+gOvPeAwVGyU5vampcieo0CNBBdRUsrLb5hT3bq+ qbXPVNu6B2XVcIxONAm5FfPYxSwSVEuMx9Btyqwh4m/Y2dYcsaeBBn5Nu4ZNLTJT12R5XuVuUuN MOpjr92ouzyEDNymkiRW9GKDQuHOJgHRMM2z9l65uUc4pl6tSTxn300nEqszRl95rjoVHsyuybk C+3uA8XA2d+8m0Lfv+jSj/4ofGXR7kSkZcnL9LTgLUQ4PTpLhXuRNfFmm83W3btk1uX/Th4f3uc G0nnzpI9C5I26FN9yd+4Zq6iuuSA8dFLQsph3zzTOwFxWZOTP5lVA22Vklfm5NOBSryxc3WvIuC V1GogP X-Received: by 2002:a05:6a21:6e48:b0:343:af1:9a57 with SMTP id adf61e73a8af0-39372486619mr5352464637.56.1770282281458; Thu, 05 Feb 2026 01:04:41 -0800 (PST) X-Received: by 2002:a05:6a21:6e48:b0:343:af1:9a57 with SMTP id adf61e73a8af0-39372486619mr5352428637.56.1770282280933; Thu, 05 Feb 2026 01:04:40 -0800 (PST) Received: from [10.133.33.108] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a933850f36sm46175105ad.10.2026.02.05.01.04.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 05 Feb 2026 01:04:40 -0800 (PST) Message-ID: Date: Thu, 5 Feb 2026 17:04:35 +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 v2 4/4] misc: fastrpc: Allocate entire reserved memory for Audio PD in probe To: Bjorn Andersson References: <20260115082851.570-1-jianping.li@oss.qualcomm.com> <20260115082851.570-5-jianping.li@oss.qualcomm.com> <3ba77da6-4a43-4e2b-b4d6-3d58c403ca0e@oss.qualcomm.com> <4hnmij6jufkomwlb47fgg7ahwsjkamkaqx6h2t5cxoshfcdlpr@uh6n5tqofxdo> Content-Language: en-US From: Jianping Cc: Dmitry Baryshkov , srini@kernel.org, amahesh@qti.qualcomm.com, arnd@arndb.de, Greg KH , linux-arm-msm@vger.kernel.org, thierry.escande@linaro.org, abelvesa@kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, quic_chennak@quicinc.com, Ekansh Gupta In-Reply-To: <4hnmij6jufkomwlb47fgg7ahwsjkamkaqx6h2t5cxoshfcdlpr@uh6n5tqofxdo> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjA1MDA2NSBTYWx0ZWRfX4c8MT7NDMR1Q cGVF70bVGIZJ2hbfMaYfXfh4roxr2UBQ1FOrRv24sT/yFq/XP+j9Mkh7xwyyB3VZ9cXIwebl0/A daDczD6h7DB/7txcfZrEQDLkeIsaIHj+qB1lumTWH4iTyz7rsd/252TXcytlAavOW4m3nvkRn1t 7qpji9yB9AJstk0DXxhK0FJikbREo+YuXCbauJS+/c2xYhQqMWeFOGboihQhOxI1DvuUF+GOrIp KhD6WkA09AS+ugw5Vn1OLnV54Wc2LDOdgDuRQ9+vpJoXYyNpHDBlNySDEB3CvzR3H6TdSf1+Klr A6/BVjin7Ft9yFcqa3+3GlVhPXnn9jzIn70ni50i9Q1O4b2e6YW0JS7zYtJlOwuFH253jNsD5Y2 +yn8yFE9eLt/eD88+tElAEdZ1vkHJpc5mf7+V/IevM/desPqwxzO7PxoKB85cz8x6yNl7JvT4iF G+CSn54zRrK1eu/pQrg== X-Authority-Analysis: v=2.4 cv=GdcaXAXL c=1 sm=1 tr=0 ts=69845d2a cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VwQbUJbxAAAA:8 a=RXZXvM6syZh7F40latoA:9 a=QEXdDO2ut3YA:10 a=-_B0kFfA75AA:10 a=bFCP_H2QrGi7Okbo017w:22 X-Proofpoint-ORIG-GUID: tr2k3eWESYGWPnewEDz_wJJlFdNkQcfI X-Proofpoint-GUID: tr2k3eWESYGWPnewEDz_wJJlFdNkQcfI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-05_01,2026-02-05_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 suspectscore=0 malwarescore=0 bulkscore=0 phishscore=0 impostorscore=0 clxscore=1015 priorityscore=1501 spamscore=0 adultscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602050065 On 2/4/2026 5:42 AM, Bjorn Andersson wrote: > On Tue, Feb 03, 2026 at 11:19:39PM +0200, Dmitry Baryshkov wrote: >> On Mon, Feb 02, 2026 at 03:06:59PM +0800, Jianping wrote: >>> >>> >>> On 1/16/2026 4:49 AM, Dmitry Baryshkov wrote: >>>> On Thu, Jan 15, 2026 at 04:28:51PM +0800, Jianping Li wrote: >>>>> The entire reserved-memory region is now assigned to DSP VMIDs during >>>>> channel setup and stored in cctx->remote_heap. Memory is reclaimed in >>>>> rpmsg_remove by revoking DSP permissions and freeing the buffer, tying >>>>> heap lifecycle to the rpmsg channel. >>>> >>>>> @@ -1370,8 +1346,15 @@ static int fastrpc_init_create_static_process(struct fastrpc_user *fl, >>>>> args[1].length = inbuf.namelen; >>>>> args[1].fd = -1; >>>>> - pages[0].addr = fl->cctx->remote_heap->dma_addr; >>>>> - pages[0].size = fl->cctx->remote_heap->size; >>>>> + if (!fl->cctx->audio_init_mem) { >>>>> + pages[0].addr = fl->cctx->remote_heap->dma_addr; >>>>> + pages[0].size = fl->cctx->remote_heap->size; >>>> >>>> Do we need a flag? Can't we assume that remote_heap is always to be >>>> allocated to the PD? >>> We do need the audio_init_mem flag. >>> Once the PD starts and daemon takes the memory for the first time, PD will >>> start using the memory, >>> meanwhile, the daemon can be killed and restarted. In this case, the memory >>> is still with the PD and the next >>> daemon connection should not take any memory for the next request. This flag >>> is maintained to ensure that. >>> The memory needs to be resent only if Audio PD on DSP restarts(due to >>> PD-restart or Subsystem-restart) >> >> This needs to be explained in the changelog. >> > > Not in the "changelog", in the commit message. > > > @Jianping please read https://docs.kernel.org/process/submitting-patches.html#describe-your-changes > > Your commit messages should "Describe your problem". From this > description it should be clear why the change is needed and why the > change is done in the specific way. > > Regards, > Bjorn Thanks Bjorn for the reminder, I will revise my commit message. Thanks, Jianping > >>> >>>> >>>>> + fl->cctx->audio_init_mem = true; >> >> What if there are two racing IOCTLs, trying to init AudioPD process? >> >>>>> + inbuf.pageslen = 1; >>>>> + } else { >>>>> + pages[0].addr = 0; >>>>> + pages[0].size = 0; >>>>> + } >>>>> args[2].ptr = (u64)(uintptr_t) pages; >>>>> args[2].length = sizeof(*pages); >> >> -- >> With best wishes >> Dmitry >>