From nobody Mon Sep 28 23:13:07 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 D3DAA41A93A for ; Sat, 15 Aug 2026 13:25:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800357; cv=none; b=o/hcxoS6KvUecvx3XABoHIGiJgIEPp9JEau/AycZzraPNGJIYftV1ML7Sgkt4P307Tml/s3CxH3veoH8SDLiNOWyNNltkUsmQwkqzXkyUBbyRnEQY5aoQLz9yE6eiYKp9dBBXzC4cI3JJAVLjy/vffgw8BNqBoCrJNsico+W0yk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800357; c=relaxed/simple; bh=QfGSFGB2zUjQpsQr9TXhbDCh5TDz42RLzw1jqZANOg8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q6oae6l+NDWoANDxXZf31F7UGsRcUosl9I3Ydc9NXJYwCvr3yyWQEK/7HstvzbjhwsUMd40yjg5KrTYNHcffUISRgLEhw2+kihXw9BJjjTDRtQYpQl0VHEjOkk4lZoEIJTixrAZU93pdRwzx2AhVmmduacznUFl+FSyP4VASWPQ= 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=n4wl1OrE; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=kp6HHZNQ; arc=none smtp.client-ip=205.220.168.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="n4wl1OrE"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="kp6HHZNQ" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67FDMflk642810 for ; Sat, 15 Aug 2026 13:25:55 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=nn+nmVjR3Vk 7Fg6ZHUBKdnc9okFTEAK8UP/Bxa+B2zA=; b=n4wl1OrEpXCV1JNkjJXrepFx87O 3Qte7hMwYJpMJBhBnBvuqrfl3ZasVCklQro5CStLrxHNh0KJXLHDKk564AQTUGb6 y45U1TGRH3vIzaAGSQycqT2Jl4wRKVr1he6k0j5GJvLLbpeEjfbjcWWoD+1lVGFj iORjk3rUOT4yblKK3CAq4YAk/D2A/hSX/jkDKTNLQptU3rZnnHFhtI+vR7wHgOL4 LcyPbAOmQqmKWD5Mu0sMNJ97wVU3rabt3ghEdm3bMrRncx8YWUJE+PMPGfRTO/5n m7VBo//OrPGZ9TO4FNf5a47asdjWUQLIDbE5kEw0rSmL8adSJo1+TxJ5CsA== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g2ghfryhg-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 15 Aug 2026 13:25:55 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2cc7e86e7c5so33541475ad.3 for ; Sat, 15 Aug 2026 06:25:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786800354; x=1787405154; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=nn+nmVjR3Vk7Fg6ZHUBKdnc9okFTEAK8UP/Bxa+B2zA=; b=kp6HHZNQ/wGLYyaVAKR0IKoyu9GQUb4kOjOFJPz1H2hFXHQq0QYNg6fwHMLGJsAKdv qrHvTOSIjJtQBIG0zV4XHainKm9+dgs/B89hIZe+W2tJ2phjkZC0fUNzRZ6YwGoogTtZ Eil/LCjurazMUx5QvIHmY0L/+oKl6irFviYhTEqiVNnRt4nRE7J1Ne40iu3IJUXzhWGb PRvS8VCTNXOdx0DAUtsk7pmPrc0k01npuaC20kN58CxYt0uY88TlswESMrZ92tx2kxTK PICP3+h1koQdXyllx+DULpzlsngujkcm2aWZ0q4dW4+SPx2nXj9DFyj+YmPalNtQbvAV S1Vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786800354; x=1787405154; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=nn+nmVjR3Vk7Fg6ZHUBKdnc9okFTEAK8UP/Bxa+B2zA=; b=GTeKJev64IQusTb3Ulegb7UYfG5HM9ybiSRDHytoux/kgqiUzdNHAK5OvijZT+X37S Q1Ef9u7BYOVXLUCbw9c4R+xPS8QgS/woSILv6YtISeDR7VgtTXIi9nVb22UuZP1hzoKM 4Ftg/+EqvUvisrHG3inQ4iAF/eIYHWugrBlxgwIA/3lXCcRI0p5/oCLzimUh9VuBD107 MYFr8Bvb9B8IozsZtsA/3bW7xsOkClrJj0gNRvtuov5DiOBS9sE1oae2kUPg87Qycw0R aSe6JrIbU87BL0Nu/xt5rGSFpfzymrNsvT/LA/XqsIvwMz9pn2lKmnSSNLZJXsAqXEtI FRpA== X-Forwarded-Encrypted: i=1; AHgh+Rq8agMU6qhU4iiXBD3wEL4Fvo/9UGrPmCzGVkf6kChLB9f0Wei3Hn+/rXdwhdbvxcWptn/Zu9ouW5pv5Jk=@vger.kernel.org X-Gm-Message-State: AOJu0YybaADlyKp/5PZTttsh7jYDk/C7yXT4uvv0wNd6aWsTp+fWAgw5 PDACgMVVek37ZOtyqkXj1ySp/4yndb/z9ANun1K3o2d0A8fF1jGr25R0zee5njyxDsA9OIQFF/C 1EVBVcqmktPy1hVXkjplUCZncxP9mxdLCGHEFdJL/sc+sT4nfYlsvt6q/cNuVIU1GhV8= X-Gm-Gg: AR+sD10AyjmyiU0bIWrIqRMR/Ke3AvnY7WrPnJNBr+KhQJ0my9KbHsJzyc8tA5qtTi4 j7av6vUx+ml32f6iQ4wLDG32J0+4LWo9AnRdVAmPlxnFseAlzd9At+M1a+RHyfcbQnf6a8eZbmg wmAevrhYARFjmLr4dmQzkMeKXNpxpvitmd2xmtFIv2VEnRLJIcYOlyL9g5QZjwDe8uYD0Ux4sEf lr0lkt2lO2k9YQniqjrnBAtLQy8zdY3S3+bdKaX3egIKPvFfSPOjNZZ2vPr0CHYh1pEdE4wfTa5 pjzZgNrL1bYm1yqXYEYCxCA+PLL2co5T+u2EOlIdIlzzb/opmfr3wX1vhS69bqvMwUg5n4/Ae2b wXPc+ItweDCYr/x5Q2ST6u01v//ef7FyW3OCbJGsCJ+WeuUdVdiPiDM6Jx3HE X-Received: by 2002:a05:6a20:d808:b0:3b1:cce5:9140 with SMTP id adf61e73a8af0-3cc71e3381cmr15339884637.33.1786800354446; Sat, 15 Aug 2026 06:25:54 -0700 (PDT) X-Received: by 2002:a05:6a20:d808:b0:3b1:cce5:9140 with SMTP id adf61e73a8af0-3cc71e3381cmr15339838637.33.1786800354021; Sat, 15 Aug 2026 06:25:54 -0700 (PDT) Received: from QCOM-aGQu4IUr3Y.qualcomm.com (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141386a039asm19313374c88.0.2026.08.15.06.25.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2026 06:25:53 -0700 (PDT) From: Shawn Guo To: Bjorn Andersson Cc: Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bartosz Golaszewski , Mukesh Ojha , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH 1/8] dt-bindings: remoteproc: qcom,nord-pas: Add qcom,cluster-root property Date: Sat, 15 Aug 2026 21:25:34 +0800 Message-ID: <20260815132541.1575121-2-shengchao.guo@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> References: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfX38J4+PaXI7Jf t6hdLpzN/iqDXqciZboBORrMbSxownfNjQwIgYGtqATayEiwrYOzzHWvP28hOFcR9NoFoLPO8FI 4uHhqbMbImoXvcstI4LKDJBzp5BqcO4= X-Proofpoint-ORIG-GUID: 3jndkx1VCuCeskmy_ZmpIEQr4daXApTD X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfX9z4qlyuFya8q 6gYQdqp8gYOkL9eTJffWzkZp1UbON5lVS0jQ3rJwhupNHDr5/9XZbepGum/yshiw5TbCMeDeiJ2 HS2TTC1g/jUOpxVRRxgVvzGobdVSLETcqoYXYIyA1JXPwkgqG1M8CHz0la6WRstz0wLhv0xgllX gc6j6zqREnz2NBItnwqzkeXPKMttm/booduDFiFjdNiwu+5uAybo0REnZXVm7FFushgRSYFDpDG gNdTKvaoMbNmIiM3E4ALUJlcft4Qg67klH4ZZ10Cy+uV1hwjpGfCj/zwSAQqiO2Ok/BdSltK4dS HzjSoQFqnmp5cnigw8UL7pwFkYwDPNMlmLeV2bc7NqLqAbJIwzMQ9Qsc9G7sVplDvI3SGsntkn+ +1qNOlReDMriQtYZguho4EaHQDDkEHsOW3eqAl0MAPhwQ+uud/KiiYuWV9XGEEQXddX1PKNyQBY koDmPNHM6I7gPsl8enw== X-Authority-Analysis: v=2.4 cv=TMJ1jVla c=1 sm=1 tr=0 ts=6a8068e3 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=JpIEW95_PAHRj95Iza8A:9 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-GUID: 3jndkx1VCuCeskmy_ZmpIEQr4daXApTD X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-15_04,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 phishscore=0 clxscore=1015 bulkscore=0 spamscore=0 suspectscore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608150096 Content-Type: text/plain; charset="utf-8" Document the qcom,cluster-root phandle property used to describe HPASS's ADSP0/1/2 cluster relationship. Every member of a cluster carries the property, including the instance owning the shared resources, which references itself; instances referencing the same node form one cluster that boots in order and is torn down as a single unit. The relationship is described with a phandle rather than by containment in a parent node, as ti,k3-r5f-rproc and xlnx,zynqmp-r5fss do, because the hardware does not express it by containment either: the three QDSP6SS blocks are register-independent, with no shared register window for a container node to describe. Also add the qcom,nord-adsp1-pas and qcom,nord-adsp2-pas compatible strings used by the non-root cluster members. Assisted-by: LLM Signed-off-by: Shawn Guo --- .../bindings/remoteproc/qcom,nord-pas.yaml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,nord-pas.yam= l b/Documentation/devicetree/bindings/remoteproc/qcom,nord-pas.yaml index e90d2953ba69..58d88cb07e52 100644 --- a/Documentation/devicetree/bindings/remoteproc/qcom,nord-pas.yaml +++ b/Documentation/devicetree/bindings/remoteproc/qcom,nord-pas.yaml @@ -17,6 +17,8 @@ properties: compatible: enum: - qcom,nord-adsp-pas + - qcom,nord-adsp1-pas + - qcom,nord-adsp2-pas - qcom,nord-cdsp0-pas - qcom,nord-cdsp1-pas - qcom,nord-cdsp2-pas @@ -89,6 +91,19 @@ properties: maxItems: 1 description: The names of the state bits used for SMP2P output =20 + qcom,cluster-root: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Reference to the Peripheral Authentication Service instance that own= s the + resources shared across this DSP's cluster. HPASS shares clock/reset= /NoC + resources between its ADSP0/1/2 QDSP6 instances, and the owning inst= ance + (ADSP0) has to boot first to initialize them before ADSP1/ADSP2 can = cold + boot. Every member of a cluster carries this property, the owning in= stance + included, which references itself; instances whose property referenc= es the + same node form one cluster. A cluster is always brought down as a si= ngle + unit; any member crashing or being stopped forces every other member= to + crash or stop with it. + required: - compatible - reg @@ -101,6 +116,8 @@ allOf: compatible: enum: - qcom,nord-adsp-pas + - qcom,nord-adsp1-pas + - qcom,nord-adsp2-pas then: properties: power-domains: --=20 2.43.0 From nobody Mon Sep 28 23:13:07 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 C4B2841BA61 for ; Sat, 15 Aug 2026 13:25:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800361; cv=none; b=RFkiguBFWSFmqsXSqxR9kEUvldtUO0A8OeecBk/5F8Z1hMRHCdBDCzdD/fOYCX5C1BW+1HEKdnBDwb7iv8luJYZktF2Eq4wcyHVe6uHZ/mLZ6jUBNQ3KCIUqSOQAJyaZEVu2Yzt2JYF6b5E5EoA+JAWrthgAvxqFwbBxNO+7oGg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800361; c=relaxed/simple; bh=3GznvKQYOhzSKPXdcqHPxtsLzm97LoEPV6uvmbuw/Sc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=rY9g+LIAb/Idx+QBjV+FLcLJwXfIwGUE67ydHrb79gwPtIcscb7UUyGBvMCclH+NJMJOoVcI3xPP2vGO+mmYspU8aQBrg6HIErHx9PAQaYLLWLnEXpHNdPQfETGMfZh6L85/VJari6fGRwDf9zhXDaWdniMkw33of8Wr2FY6pCw= 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=oCYVLGvU; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=hFYdtmr/; arc=none smtp.client-ip=205.220.168.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="oCYVLGvU"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="hFYdtmr/" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67FDMYXJ219333 for ; Sat, 15 Aug 2026 13:25:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=jUpVNSst2CU IlrfPT6QW+pK70blfmc9k+1OenQhK2Bc=; b=oCYVLGvUdy6xqJRGZVEulv3wAiQ khnG5hCIaocCDtMPe+xVfCu0S0RdOCOhU3aFs7+9g7dhsGrp+hx8NJaYEScfSooA /rndfiPYjLZHG19NdStQ+sHg+ZL+G70BCcjk9fYa5hWd7GSJnFSKN1td39a0GvUA 5a1Via9FNsqE3s30gzx2yb67pV3xIsbV3ou9ptfkwJVOiH4OagonhnDpQyE82vde 5Q0jcH7HONfb+bsoVkGz47aUihgkHupOIW0rqtVwQzsUqucUS1CHKUZAu7SUuVjg 6b5cz+llabhwQniwjhqQ1a2UpmXsT9bqSSUCjix74WMMvL+Eo37+iMJzVUw== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g2hd7rvqu-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 15 Aug 2026 13:25:58 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38dbe39ce62so1661768a91.0 for ; Sat, 15 Aug 2026 06:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786800358; x=1787405158; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=jUpVNSst2CUIlrfPT6QW+pK70blfmc9k+1OenQhK2Bc=; b=hFYdtmr/0Qt7qt1IRSeVwrRZM9cuvRY9sMURCR3iuBistyMImDzbps1S1l8sdx4gDs kqDCS7NFDOgMQsSspcnsdEmiJwTwe6b/v4Ur07wTa4Ddezn8D0vGBz+9hIqFJ0iYL24H 3umoioXMcncbrI604PpVABFBoU2VCbBOxu5EHv27guG0piIMCjhsgBjS9JwT9SKsHXa0 IDhrSPdZ8CDMG2HlHjNsFc13J4uC4SYaLAUHLChQdwAUYtqlhECe4SHrsW9xSEcfm+gd 6vx4mATyCgpMzcwFVMEwAqKbwhgJbn+lqX2+AgCt29UDVzur3HE3Meb3gQyaQLENS+eY SIVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786800358; x=1787405158; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=jUpVNSst2CUIlrfPT6QW+pK70blfmc9k+1OenQhK2Bc=; b=SWHVlVzuMJoiEINRktnoOhztKp9ZDYIUJFyNA2RHXkaCjkmqoyWcPksvG1m2UKi77+ RR+AnQBGuoGGiISSM54daiLTRcQyYEEM9yROB+Nn9NQMb7PgIlFVUjkbCdml+z3BS20p QLk7h884Ur4H38lshLEc6hkeoZl4bzBbRkU/Wj6JkaJkgTl5opVf/ZzkvT0EPysvrhcD k0gEcbl9mAyyDtlMVC7MYEVung6NYkfkmnHlIS328sN1500w4tLRBwUHR7SZItcydb43 4Z/c+i/b6izoI3CP+vVGQjqbSBp3taHMVldjeQB+BQiGHgrX7lUd87qaZqDzN8ZwKGRY 6eqg== X-Forwarded-Encrypted: i=1; AHgh+RpmKrt+emZorwQJEtewlQM2yiJyyT6alwv88zRbix3+yLsRBATBTuVYu4ik720dKAGBSPSyK47oLZ6Kk88=@vger.kernel.org X-Gm-Message-State: AOJu0YyQZxTzuMT4yNPS2khUIFN6tjDg3CuHiq+hvkmVmkluieGHXqQU XZlqkRTkrMYQxClFu+3EVbd/YDZmcNOfvqrE1Gk2HV33z+llO4MWN+jPUrRux2CeYMOiwiWjsNX QzzcBPXzEzsdyzko+1msSGVAfq8OrwU1rU6akgleREbGZzvuEXrxb8LC6HOrAKy3ccCM= X-Gm-Gg: AR+sD12RLGAfZRgSmD/NSAF2aPriHgyjqeHuBkn0/uCRt0i4B8k4lbC7t1mJ9Ji4rYJ /nO5tsby1HmgfJ4exbHYfO9vYUKuu9NL/hDQt2AdCFNl8FBwr0I6RXSKz7WrX1JSN2JWT8ijexx Myk6ulN/03v9lYkNi4rKh9+qPjxeYjxKxBBM3TzyNfRrHKEsQSrGIJkixC0CJsU+pvhOaVCa/wh Fj+oHQ1lQdwKjj2BUjXAhF7SQguOcGIKl9US2YMZWgBiFrK080ZfwLVTTN49YiTqoLjSxdVaD4a 0BAgVDtCOK0e0POT03ZYRNaEBRK3tqxoQnG2WiU59FiWnNh4D0h/feTp4uWRt+ETtvEu2mX0ZPH ouWOZbaelOPd3C60b/3MwPFLJPtKVIg5aZ2JOYbs9bQMse/lcOwxoWlpYlPPY X-Received: by 2002:a17:90b:288f:b0:380:86d8:8162 with SMTP id 98e67ed59e1d1-3931f5f5fffmr17005638a91.18.1786800358304; Sat, 15 Aug 2026 06:25:58 -0700 (PDT) X-Received: by 2002:a17:90b:288f:b0:380:86d8:8162 with SMTP id 98e67ed59e1d1-3931f5f5fffmr17005593a91.18.1786800357774; Sat, 15 Aug 2026 06:25:57 -0700 (PDT) Received: from QCOM-aGQu4IUr3Y.qualcomm.com (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141386a039asm19313374c88.0.2026.08.15.06.25.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2026 06:25:57 -0700 (PDT) From: Shawn Guo To: Bjorn Andersson Cc: Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bartosz Golaszewski , Mukesh Ojha , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH 2/8] remoteproc: Add cluster field to struct rproc Date: Sat, 15 Aug 2026 21:25:35 +0800 Message-ID: <20260815132541.1575121-3-shengchao.guo@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> References: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfX9IPuYsvhKGaJ E74bZL/77wpeVFq+dZE8xphcK1+WfnBncH585+50RB/aMeVoLzUhJiqE4UvNGT172S2uQ0SwV7o Ru/QO2lbEmMWabBnc5lkmsx1dJaPSyZQNqZZ1qWNEryXK2jn+qVBrljfrX+VMBWTVS1MjDg09g+ UkaZ2QRY4zrRNMUXzbcrkgDilt/2af/9+tU3OjPH9vyVusSx1VJivByckgnujuKgQhPiijZ7AiD yDRGIaIFT3+wdM2PxGvtRMsyWE7xsrUoQASQnvclcRr50pK5/45ihgQveAqee+UXw+7qhFa+yj/ LDJ/sHTIBueKAUR60YiCc/5okj5cJDwxKnn3c20HWV5lCP8ZSmFwTNjL10twKXHRybAzCLDHbvG 2gVpr28PoHFwkBZJ1foaGCOuDSGCk2i8y33dZXxkRLj9b3GNj+eK0KM/TQ//1b/U5xR9LL5ik4I DKTyzH1Ai4gXVggz7Fg== X-Proofpoint-GUID: kMW8CvrpNU6F7Rj3nf2zasIwsCJYEFLZ X-Authority-Analysis: v=2.4 cv=Ja2Ma0KV c=1 sm=1 tr=0 ts=6a8068e6 cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=wfuvY1oYJVSYwsIiQWQA:9 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-ORIG-GUID: kMW8CvrpNU6F7Rj3nf2zasIwsCJYEFLZ X-Proofpoint-Spam-Info: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfX5qL0Rju59oSj X6we28Wfijsca2yZ6JxvMFnmAAiqmIqg1edb37y4CnGkkgvi82KpZkDhS+rXLsrP+HwZSxCiI2J Amzzlv9v7KRhaxo1uXkklv+AvAJBBxo= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-15_04,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 bulkscore=0 impostorscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608150096 Content-Type: text/plain; charset="utf-8" Some Qualcomm SoCs group multiple remote processors into a cluster (e.g. Nord's ADSP0/1/2, which share HPASS-domain PLLs, AG_NOC, RSCp and other resources owned by ADSP0). Firmware on these clusters cannot tolerate the peer-shutdown notifications that qcom_sysmon and qcom_glink_ssr send between independently started/stopped remote processors. Add an opaque cluster identifier to struct rproc so that those notification paths, which live in different subsystems (remoteproc and rpmsg), can recognize siblings in the same cluster and suppress notifications between them, without introducing a module dependency between the two subsystems. Assisted-by: LLM Signed-off-by: Shawn Guo --- include/linux/remoteproc.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index a44368737b39..53e56d53641e 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -254,6 +254,8 @@ enum rproc_features { * @cdev: character device of the rproc * @cdev_put_on_release: flag to indicate if remoteproc should be shutdown= on @char_dev release * @features: indicate remoteproc features + * @cluster: opaque identifier shared by remoteprocs whose SSR notificatio= ns + * should be coalesced (set by the owning rproc driver), or NULL */ struct rproc { struct list_head node; @@ -299,6 +301,7 @@ struct rproc { struct cdev cdev; bool cdev_put_on_release; DECLARE_BITMAP(features, RPROC_MAX_FEATURES); + void *cluster; }; =20 /** --=20 2.43.0 From nobody Mon Sep 28 23:13:07 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 5FCFD41B8D4 for ; Sat, 15 Aug 2026 13:26:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800364; cv=none; b=sK38X3ZyKyJcbx/pkOfxZcqD7c1sk4fWy6y5P5q5aqn+Wsdvs0+lYAJG1N7jTIQuVB/9CfosPt6rrxDol/ssivPVL9s7Z+QMTmtTeQsIc8CQo4YFWdNt29Db0cvTNJEF0ljjSTnT6tSnmHNU32SE7e5ncoquu1QUpjIJjQBdAGA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800364; c=relaxed/simple; bh=1lUVDSkQiiZnlEzObAHR/NuLrBUqSDylFKV22u8kIZk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ACZYU2GiTcNHAT5q6niPsSCi0b87P5uzKZqykiHfBF9Lee67uJMQbbjCHaXMD9MNuyS8SR5m8/NtUS6u5TZr9qWUnKgvac1pHjjzeHGUkb5WAWjm9UJjoCbAPrVpIZcHfI2Y+ugDTLNCusmYrRe0+Xiyc2u4u2s035qKUBQGWyM= 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=PN5e+Wkd; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=dUKRKNBU; arc=none smtp.client-ip=205.220.168.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="PN5e+Wkd"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="dUKRKNBU" Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67FDMpkw643014 for ; Sat, 15 Aug 2026 13:26:02 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=0FsAkefoWCa qjOsHcPE3Yfj3+ChUaoS1Dxd6hBcUqzA=; b=PN5e+WkdzhvqYcJRL6yYPBtIOYf zdjwjBkT7WuObv+/gc9GjQ45zf2KvlVg8tjIjd+MgPFZQ5XE2eAlSG5k0Jk9hfXh 0hub9O1pIxaI9Qi+50zh99TR0PxeakW5dfLDh/MSaDTPunRJB3hV0cnYHBdZeT1O RJjf2vvwzgU3q5vAdRi/xBRoW0hvApBYsZK8TEPdt9EkRFCeY3IonUqwQg1lT7zb drM28PaBJydvkzW4AXo+XfvDiIAfH5MVsXcMfsaFxErxOS+4VaK7JlULquNu5yt7 wPpiJXSmtDHwrj3TaQq6d/HnNdjBKVCnyZGl8qbzv6OlcfoIDsEHjQiqqlw== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g2ghfryhr-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 15 Aug 2026 13:26:02 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-38e25e4b41cso2168856a91.0 for ; Sat, 15 Aug 2026 06:26:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786800362; x=1787405162; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=0FsAkefoWCaqjOsHcPE3Yfj3+ChUaoS1Dxd6hBcUqzA=; b=dUKRKNBUMe91yGwKyZyWhU/hMclJpJYC5ARzY1dlTnZI1IublCzOAnV62cjLAstXae S6TGx7nOatWOcPPvmpTw8mnkJW+YMi29aDtC+CqteisdbnzjmFUOB0qAe2n90CafVaFh sTiM5ppHyK7+GsgolGkR7fQyYgX/f2s/ouRRm3jrDl0jRQXOXUL9Sgs7+LARVIxhZoe7 MsCvdjbEn96ICld2RBRyDtOYExeYbw8zMj67pY7pRbKKgUkaD6WoWb/BHUV+mvvjATKu /Se9xMC0aR6JICxqCm9uo1Wili/AWhyj3YTazm//bxHWcaunK2fEpvT9of/AG9wBSD2N mWlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786800362; x=1787405162; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=0FsAkefoWCaqjOsHcPE3Yfj3+ChUaoS1Dxd6hBcUqzA=; b=bFupPtfU8cvDQnwXzAX/eYKNQ8BKLAFCkeldUL+NkKqSR0xv7Atu1YLEjRd7+x4VAr 7IhZOmcFPuAT/TZW26uec9Goe/uy2CfiRF6kmhg9WHY30rMoEsm5UL4I+4FYkkJ+7Z9T D+04j2wo1RF2GZXgazi/slbPuWmzA/8skyY0blnqQ1iYXQmS8vSP03rV/Ki0SYMZCVrm NidILyTnHp5iKdxBuSOPqhAgjyAyy0HrHKKoYfsl23AVw/TN7iqXpym8ZHXNMACV9Nd9 biWEczIXkUwnX2pXXNspD13+qKhZ7JdhOqa6b5IMyTZjbkwQPgC8Fpp3T+uhV6Kf2mi3 Wn+w== X-Forwarded-Encrypted: i=1; AHgh+RrsI62DHGsve2KWPWr29fncjWGTr6vfcAsvK6ISonL3pYP7E0G0XSdzDgwtqrfPO05ZbKtmLbUjbyAve7A=@vger.kernel.org X-Gm-Message-State: AOJu0YxZTobfn8gRgw2UTgnYGBNddo7P49jVwYTujZPldrxIMxX0hsNp IGfqN5eZBc8f+iN4wLkQCPVR+ZAW+B+fpeDI2U/Y/Qf3Nx7yPtcS4jbsRy6tb6kd66l91vTsRNU eFlpZBoJMyMeENsbH75kkhBtRUjtFXkmkO8A6khXAvGfGpeuBrPaA2TFBuoYWAbA4mKI= X-Gm-Gg: AR+sD1091S/JCqeh3GowqVjl7XD6/XYJltHdA+uxJZMn4etWUt+Y6aYDmdimtlWQhoK 3m6kG+Yt4kVm4ZgxoJnfCipruE/flEKr2LclRqJsd2BvGaPqK5lzgpyrU4YqnAYJp8ihoRGPPuP y2hdekNf1/5RVgHVl5QqviKG8Ilz7WQM7PePXhoLyrdvGCXV5qUP6LvCHQQwFuGhh6pdM6kK6R3 VKStWqpIVTLt1aF4YITWEYXEGIKA82d/oRc6rbikyviqND19RsgV7U8D4YrOtWeyBAnZ2DLCVVK rsY8BHrdZwXTZJAIvexzVfJjeveXLmoyEl8uUeCWlZnaTLw3cd1XCNEk4BVWiTamNy9Ouxe/O+W 5Ome7ldVm6nG32qAZiw8+qNGAhwq5uICpbJQedycN/VmRZ9a++D9gwQJvlFbq X-Received: by 2002:a17:90b:5450:b0:38d:c74d:29c5 with SMTP id 98e67ed59e1d1-3933ed23db1mr14066756a91.19.1786800361937; Sat, 15 Aug 2026 06:26:01 -0700 (PDT) X-Received: by 2002:a17:90b:5450:b0:38d:c74d:29c5 with SMTP id 98e67ed59e1d1-3933ed23db1mr14066725a91.19.1786800361504; Sat, 15 Aug 2026 06:26:01 -0700 (PDT) Received: from QCOM-aGQu4IUr3Y.qualcomm.com (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141386a039asm19313374c88.0.2026.08.15.06.25.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2026 06:26:01 -0700 (PDT) From: Shawn Guo To: Bjorn Andersson Cc: Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bartosz Golaszewski , Mukesh Ojha , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH 3/8] remoteproc: qcom: sysmon: Suppress notify between cluster siblings Date: Sat, 15 Aug 2026 21:25:36 +0800 Message-ID: <20260815132541.1575121-4-shengchao.guo@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> References: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfX23gPMKtms3kE qc+/7O4gGleIRtMaqEOSycDExu4QRmEfpvLORTUZa3ovPSbjAYspCmdMYf0tYKJQd1fUlRqiz9Y kL0eY/IW9V2sLbVJofttVibaMWPLpqo= X-Proofpoint-ORIG-GUID: MFg6OlN2wW8uVb_cGSLbUZJrHx7akN13 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfX+ZxuG9wBkIwB UJYsmjvb6kNVl/hBIyUiREn6Bvw4Z9dOdUOwX/yxYTXh5YYpk+V8nF1l5U5N0L3fVCgzdez79mI IltpAe9Ql41S6Syovm5h9qzK8qEBliUATtUp7hd1RSO+zpaQdvKcpvZRAGeApzz3wpMOJwtyZ6R UPCqcobSHwf8R1lRsnTfnhCgQmIyjLgslmVaDjKOolSs/hGq1xja/KGGV9SqKFD+Nt9uBzrrBOY wE50UPa+pqQa9Efy2YMAKMHkE1sS9DWa87D9+nVLruef5/wRud12ghgZIA7XL21lxwmBlssLFX9 WFG6h912F/d/7KiyAnTynizznJj5G2yQXMOHVo8btEvwfG9Tl4+H5F5s4eH0eROdx5bFtgJ5PAz gQlqkWJaRPB+Cy8wNm48NAImsBhYUpbSCgq9gVby6EAUfJHflTntGzR2yhKzLC0OY3UTOAqFO3V q+FWkbm4nUJs47Qlxew== X-Authority-Analysis: v=2.4 cv=TMJ1jVla c=1 sm=1 tr=0 ts=6a8068ea cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yOCtJkima9RkubShWh1s:22 a=EUspDBNiAAAA:8 a=S0uwIJVnaEaoYlcdocAA:9 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-GUID: MFg6OlN2wW8uVb_cGSLbUZJrHx7akN13 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-15_04,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 phishscore=0 clxscore=1015 bulkscore=0 spamscore=0 suspectscore=0 impostorscore=0 priorityscore=1501 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608150096 Content-Type: text/plain; charset="utf-8" Firmware on clustered remote processors (e.g. Nord's HPASS ADSP0/1/2) cannot handle the SSCTL peer-shutdown notification sysmon sends whenever a sibling in the same cluster starts or stops, and the QMI request instead times out. Skip sysmon_notify() when the notifying and the notified instance share the cluster identifier their owning rproc driver put in rproc->cluster. The suppression is done on the receiving side, so that a cluster member keeps notifying, and being notified by, remote processors outside its cluster. Instances whose rproc has no cluster set are completely unaffected. Assisted-by: LLM Signed-off-by: Shawn Guo --- drivers/remoteproc/qcom_sysmon.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/remoteproc/qcom_sysmon.c b/drivers/remoteproc/qcom_sys= mon.c index 61e1038328e8..5d4443ef3bc1 100644 --- a/drivers/remoteproc/qcom_sysmon.c +++ b/drivers/remoteproc/qcom_sysmon.c @@ -67,6 +67,7 @@ static const char * const sysmon_state_string[] =3D { struct sysmon_event { const char *subsys_name; u32 ssr_event; + void *cluster; }; =20 static DEFINE_MUTEX(sysmon_lock); @@ -473,7 +474,8 @@ static int sysmon_prepare(struct rproc_subdev *subdev) subdev); struct sysmon_event event =3D { .subsys_name =3D sysmon->name, - .ssr_event =3D SSCTL_SSR_EVENT_BEFORE_POWERUP + .ssr_event =3D SSCTL_SSR_EVENT_BEFORE_POWERUP, + .cluster =3D sysmon->rproc->cluster, }; =20 mutex_lock(&sysmon->state_lock); @@ -500,7 +502,8 @@ static int sysmon_start(struct rproc_subdev *subdev) struct qcom_sysmon *target; struct sysmon_event event =3D { .subsys_name =3D sysmon->name, - .ssr_event =3D SSCTL_SSR_EVENT_AFTER_POWERUP + .ssr_event =3D SSCTL_SSR_EVENT_AFTER_POWERUP, + .cluster =3D sysmon->rproc->cluster, }; =20 reinit_completion(&sysmon->ssctl_comp); @@ -536,7 +539,8 @@ static void sysmon_stop(struct rproc_subdev *subdev, bo= ol crashed) struct qcom_sysmon *sysmon =3D container_of(subdev, struct qcom_sysmon, s= ubdev); struct sysmon_event event =3D { .subsys_name =3D sysmon->name, - .ssr_event =3D SSCTL_SSR_EVENT_BEFORE_SHUTDOWN + .ssr_event =3D SSCTL_SSR_EVENT_BEFORE_SHUTDOWN, + .cluster =3D sysmon->rproc->cluster, }; =20 sysmon->shutdown_acked =3D false; @@ -567,7 +571,8 @@ static void sysmon_unprepare(struct rproc_subdev *subde= v) subdev); struct sysmon_event event =3D { .subsys_name =3D sysmon->name, - .ssr_event =3D SSCTL_SSR_EVENT_AFTER_SHUTDOWN + .ssr_event =3D SSCTL_SSR_EVENT_AFTER_SHUTDOWN, + .cluster =3D sysmon->rproc->cluster, }; =20 mutex_lock(&sysmon->state_lock); @@ -588,6 +593,11 @@ static int sysmon_notify(struct notifier_block *nb, un= signed long event, struct qcom_sysmon *sysmon =3D container_of(nb, struct qcom_sysmon, nb); struct sysmon_event *sysmon_event =3D data; =20 + /* Cluster siblings' firmware can't handle peer SSR notify; skip it */ + if (sysmon->rproc->cluster && + sysmon->rproc->cluster =3D=3D sysmon_event->cluster) + return NOTIFY_DONE; + /* Skip non-running rprocs and the originating instance */ if (sysmon->state !=3D SSCTL_SSR_EVENT_AFTER_POWERUP || !strcmp(sysmon_event->subsys_name, sysmon->name)) { --=20 2.43.0 From nobody Mon Sep 28 23:13:07 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 4E6603F9277 for ; Sat, 15 Aug 2026 13:26:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800368; cv=none; b=g5sEBrRhqUA03sdRSMpFqBGckCbLPWsWtWO6fQUVSxA1hsI0o5po+t6DdZQFx8yqNmWhe2d4e+z7P0+6hbhu4qubdcEyzg/LEqVqJ2LLGJlHIO6JiMRiwl3hUkwHFQF6KZZVtCHR5k4yFdPsNF0oNjWeyxSOiis7VpwiuGp8xo0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800368; c=relaxed/simple; bh=DV/mHWWw+foBUxbKi1jvwdFG6sPFv6sDnapjwIOmJ7o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZgCHehv+jscRJ3YlhQEA3ehfvteIqBRR52z4HzysbpjGFMyFA9JY6Ut7Le4aP4hty8+AzrHUfOqkmV/YbVQWXBiP430+Jy7yeM/sg2V59AOBlt8JUnJdyyPsj6F/xQdRoo5vBBPy/YvU9+VuR7gR9PqKQKG7QghDfOEKo7djfTE= 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=Mqb41BEv; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=koBaRyS0; arc=none smtp.client-ip=205.220.168.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="Mqb41BEv"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="koBaRyS0" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67FDMISU1712610 for ; Sat, 15 Aug 2026 13:26:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=Khl0D+QBct+ K3HTRyxoTR13nRgf1wY/4jb7yUDc3/Lk=; b=Mqb41BEvYuPGhrdmW7gWVdiaKlf /467PS9/lHkChZBP6KLm8vztDdFJJd36mOF2jCiyK0qO8B7g4jv8ej8tnQP4nMHM +n5ZW5gd6IBNZ5/pg+Q3yU+E1CAlEeGEqlP9NvaxKVejyIvow5JFb8K3uzlWJtU3 sfOBCmcLNVkc66gpSfgnWg3D8mJK8psE7+VeESLlrKfgfxW5bWhXSFk3KgyWbt00 9Alud0Ugm+r7YyaSOTWiQxm3nKe+YaCpKCjOc3hU/zZv+WAXmD2LXmKp20PONFqD gh1Ebt4TAtujid+6dhh8I6MSVArMVVrsd3oDxvEUCb1GRuoMLmukLHjt8Lg== 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 4g2ghf9002-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 15 Aug 2026 13:26:06 +0000 (GMT) Received: by mail-pj1-f72.google.com with SMTP id 98e67ed59e1d1-38f97b3f853so3277979a91.3 for ; Sat, 15 Aug 2026 06:26:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786800366; x=1787405166; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=Khl0D+QBct+K3HTRyxoTR13nRgf1wY/4jb7yUDc3/Lk=; b=koBaRyS0KEM2I1A4WMJQAXbFKdzk9MJqkMXOtiv6EbQVJVOA5tEAP3xJF0GCPz2TN2 swgUrwV0j94rNt9XDQGTbgPX4sWSVWFER5p14rcrp/rS+VLM4Ec3FrB5kmHfQeUp9qac i29aGHXuc3uwB1zKEBqRtTe5nU56OSCLFRP1JxVhyhD0KVdkG+TjlsDuuXX5190IeX1S Nfcdu5iqJGANHzqszQwBBV98gtNRnUOXiE/9T1XHtiagNxS1kc1Dr+b1Fy8jXbpvBYE3 oz5H07KMIxY031KlqaTvSW5kTDW1rbYOmhOiIxsMtzg5UeE86yQpFJoLdOuYdWbKm4L7 EeRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786800366; x=1787405166; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=Khl0D+QBct+K3HTRyxoTR13nRgf1wY/4jb7yUDc3/Lk=; b=r0GRp9x/PeNwWiEuRo4QZS5TdB0FRb29MptOazEaZAdMiYLUbjvbLm165GPvOHg/ka nqKs2lvffyZqBDwEgoKzYQNVwZ+IxZv8Uoe+1AKh3/wxjQk16snvs5Yjh/MLoigHmav6 7oxPH2TAtbfzzWJROC64UStuUfkBJZTU83U78eNKL22Uf8O0pGZ9O2kkYDaDlDoqMcx1 xquWmD5/T7i2LXwHUyhvj9JbE8u6EN3V6XE6II59klBkU7bgKwxLlpuDAnGb5dse6tBT Ru+ji+64msIX3A8zeX57LsdyqWKoFBY0fnQ08YpiGhY+r7HdxGRm2ei1SVz3YgkYjXWd zvnA== X-Forwarded-Encrypted: i=1; AHgh+RrNKVVb7vB+4yTrZe/aOLopn4fj2BgSLDj42Jpwuqqq5jO2+jru3WOlsotQ8FXtpWFxlmjTGKI6zO+a/Vs=@vger.kernel.org X-Gm-Message-State: AOJu0YxYElJH9LcEbrmXTh8XKQoFgmEN0ZfFe8RwKKzhRKbiRNiOO/dI ozczFU7YU7uqXRsA3HbhDdHMuq6ec+WAEKJeM+10o5wuuunS/ZzEAwVUB/T8/pBLci6qrtpa/wA rJm1mnKKYr8LuHPMX4D/lafVykhzXrsfK5xv65GFn0mdLXhB/sXOIvCdPxm2VFx58YpY= X-Gm-Gg: AR+sD10svd8Dyb0rJwPhG/o0MGcDkme4ffSd/p9GlkIKKjbkxNYdW5OxVwHcA+UOjop xWceVq0CX8NOYE++rDpjvsEYm18VGUeEE46pYYW2bKHpLP4TiEqtmh9orBn6KHQhPug6z8H27k3 HbKs/mDhNNz+PpK0D0n2Uw7RBePCLDn1bzY31RTUO95A7j7qu/t7Lu7sw/3K2lzOima7jeSaHfO pVmD6qOaMms1fr/CjMsBKlD57Tb2uu9e7/+cTsGWPLTk9qRAUp8AZKN7VHEwQPWUb5zavpXfpYC EWTg0aph0vNjENUBuVVUn2gyEkfPms4tvgNCKUnfVZ2qz2qw9f2ijbCT9x9/8z3rHYqVeYxzzuA wE3x8XtQj3wq+pJqqcTkyjItYKdBPlg1EtEFXdHXx+geDQRnYi+IbRv754ZPd X-Received: by 2002:a17:90b:4a4b:b0:38e:bfe:81e9 with SMTP id 98e67ed59e1d1-3933b6ea12fmr13455215a91.1.1786800365863; Sat, 15 Aug 2026 06:26:05 -0700 (PDT) X-Received: by 2002:a17:90b:4a4b:b0:38e:bfe:81e9 with SMTP id 98e67ed59e1d1-3933b6ea12fmr13455185a91.1.1786800365329; Sat, 15 Aug 2026 06:26:05 -0700 (PDT) Received: from QCOM-aGQu4IUr3Y.qualcomm.com (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141386a039asm19313374c88.0.2026.08.15.06.26.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2026 06:26:04 -0700 (PDT) From: Shawn Guo To: Bjorn Andersson Cc: Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bartosz Golaszewski , Mukesh Ojha , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH 4/8] rpmsg: qcom_glink_ssr: Suppress cleanup notify between cluster siblings Date: Sat, 15 Aug 2026 21:25:37 +0800 Message-ID: <20260815132541.1575121-5-shengchao.guo@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> References: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=OZ6oyBTY c=1 sm=1 tr=0 ts=6a8068ee cx=c_pps a=RP+M6JBNLl+fLTcSJhASfg==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=fZP0s7_--jJOlgppkoIA:9 a=iS9zxrgQBfv6-_F4QbHw:22 X-Proofpoint-GUID: 6GWQlP9tI1upTeOJZ099fFx50YJAfHeV X-Proofpoint-ORIG-GUID: 6GWQlP9tI1upTeOJZ099fFx50YJAfHeV X-Proofpoint-Spam-Info: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfX1gT64NWA85r4 NUIE6kEceAszCutIgjIWhQiniDEf540wmCMoJkm3sxfjmYVIunNJbVzP+MJIYRhDKqPLyJbKYZu 6GygCJ8URZOZTiUEwR58gZRgb5hojcg= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfXzPLhLHLkVcUk IJmDM06JuFgmRHNriyv2iW85GRnnziMPhDxkCf05tRiu/6bwW16GZv2T0seiUU17TxBdwMgEWY6 XHU0z9HCdXTO0xI+Nd8fAnSfdyHaobrABAN8M97pipAezQZQxTtw3mpTM3BQlWO804ockNKhavC /K21JtuKVxMxnHBorXXC41z6Lu8J7y0eIScYikcN5n/8G75LrWj/K4RatnfHGJoByHJACKsSGf1 MyE0uIVHBkUYa/WpPPKDhsAmPVwrz9cSVkr7+n4AvFnmIwJ7IT/XoBadiPGAE60g8gCzhSfB6FF KCrj5c7TzPO2nNgdkb9cE4fH0VwjPumSKA7hTPSI05NAaaOAJ3bsba0Z5Kv3h025v2TiGlBwmm5 8JprT2uhaEMCswvfj17by3rKBpZTj0ZWGAYRxIEOmYV+3f+FrrEb3CU/GViV6xQKLDvuwxYutyF JnQS8JopVZEP5CWY8YA== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-15_04,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 malwarescore=0 suspectscore=0 spamscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608150096 Content-Type: text/plain; charset="utf-8" Like qcom_sysmon's SSCTL notify, clustered remote processors (e.g. Nord's HPASS ADSP0/1/2) cannot handle the glink_ssr DO_CLEANUP broadcast sent to siblings whenever one of them starts or stops, leaving qcom_glink_ssr_notifier_call() to time out waiting for CLEANUP_DONE. Pass the stopping remoteproc's cluster identifier through qcom_glink_ssr_notify(), and plumb each edge's own cluster identifier down from the remoteproc that registers it, so that qcom_glink_ssr_notifier_call() can skip the DO_CLEANUP send when the sender and the receiving edge share a cluster. As in qcom_sysmon, the suppression is done on the receiving side, so that a cluster member keeps sending DO_CLEANUP to, and receiving it from, remote processors outside its cluster. Edges with no cluster set are unaffected. The receiving edge's identifier is carried in struct qcom_glink rather than looked up from the rproc that owns it, so that glink_ssr does not have to reach into struct remoteproc: RPMSG_QCOM_GLINK does not depend on REMOTEPROC, and the identifier is deliberately opaque to keep the two subsystems independent of each other. Assisted-by: LLM Signed-off-by: Shawn Guo --- drivers/remoteproc/qcom_common.c | 7 +++--- drivers/remoteproc/qcom_common.h | 2 +- drivers/rpmsg/qcom_glink_native.c | 20 ++++++++++++++++- drivers/rpmsg/qcom_glink_native.h | 5 ++++- drivers/rpmsg/qcom_glink_rpm.c | 2 +- drivers/rpmsg/qcom_glink_smem.c | 5 +++-- drivers/rpmsg/qcom_glink_ssr.c | 36 ++++++++++++++++++++++++++----- include/linux/rpmsg/qcom_glink.h | 10 +++++---- 8 files changed, 69 insertions(+), 18 deletions(-) diff --git a/drivers/remoteproc/qcom_common.c b/drivers/remoteproc/qcom_com= mon.c index 5294e327f158..13458bda6b24 100644 --- a/drivers/remoteproc/qcom_common.c +++ b/drivers/remoteproc/qcom_common.c @@ -217,7 +217,8 @@ static int glink_subdev_start(struct rproc_subdev *subd= ev) { struct qcom_rproc_glink *glink =3D to_glink_subdev(subdev); =20 - glink->edge =3D qcom_glink_smem_register(glink->dev, glink->node); + glink->edge =3D qcom_glink_smem_register(&glink->rproc->dev, glink->node, + glink->rproc->cluster); =20 return PTR_ERR_OR_ZERO(glink->edge); } @@ -234,7 +235,7 @@ static void glink_subdev_unprepare(struct rproc_subdev = *subdev) { struct qcom_rproc_glink *glink =3D to_glink_subdev(subdev); =20 - qcom_glink_ssr_notify(glink->ssr_name); + qcom_glink_ssr_notify(glink->ssr_name, glink->rproc->cluster); } =20 /** @@ -258,7 +259,7 @@ void qcom_add_glink_subdev(struct rproc *rproc, struct = qcom_rproc_glink *glink, return; } =20 - glink->dev =3D dev; + glink->rproc =3D rproc; glink->subdev.start =3D glink_subdev_start; glink->subdev.stop =3D glink_subdev_stop; glink->subdev.unprepare =3D glink_subdev_unprepare; diff --git a/drivers/remoteproc/qcom_common.h b/drivers/remoteproc/qcom_com= mon.h index b0e7e336d363..7136494cbfba 100644 --- a/drivers/remoteproc/qcom_common.h +++ b/drivers/remoteproc/qcom_common.h @@ -14,7 +14,7 @@ struct qcom_rproc_glink { =20 const char *ssr_name; =20 - struct device *dev; + struct rproc *rproc; struct device_node *node; struct qcom_glink_smem *edge; }; diff --git a/drivers/rpmsg/qcom_glink_native.c b/drivers/rpmsg/qcom_glink_n= ative.c index 55793fc18293..06494f4d3a4f 100644 --- a/drivers/rpmsg/qcom_glink_native.c +++ b/drivers/rpmsg/qcom_glink_native.c @@ -122,6 +122,8 @@ struct qcom_glink { unsigned long features; =20 bool intentless; + /* Cluster identifier of the remote processor behind this edge, or NULL */ + void *cluster; wait_queue_head_t tx_avail_notify; bool sent_read_notify; =20 @@ -1889,7 +1891,8 @@ struct qcom_glink *qcom_glink_native_probe(struct dev= ice *dev, unsigned long features, struct qcom_glink_pipe *rx, struct qcom_glink_pipe *tx, - bool intentless) + bool intentless, + void *cluster) { int ret; struct qcom_glink *glink; @@ -1904,6 +1907,7 @@ struct qcom_glink *qcom_glink_native_probe(struct dev= ice *dev, =20 glink->features =3D features; glink->intentless =3D intentless; + glink->cluster =3D cluster; =20 spin_lock_init(&glink->tx_lock); spin_lock_init(&glink->rx_lock); @@ -1937,6 +1941,20 @@ struct qcom_glink *qcom_glink_native_probe(struct de= vice *dev, } EXPORT_SYMBOL_GPL(qcom_glink_native_probe); =20 +/** + * qcom_glink_ept_cluster() - cluster identifier of an endpoint's edge + * @ept: endpoint to query + * + * Return: the opaque cluster identifier of the remote processor @ept talk= s to, + * or NULL if it is not part of a cluster. + */ +void *qcom_glink_ept_cluster(struct rpmsg_endpoint *ept) +{ + struct glink_channel *channel =3D to_glink_channel(ept); + + return channel->glink->cluster; +} + static int qcom_glink_remove_device(struct device *dev, void *data) { device_unregister(dev); diff --git a/drivers/rpmsg/qcom_glink_native.h b/drivers/rpmsg/qcom_glink_n= ative.h index 8dbec24de23e..8544f4f5c545 100644 --- a/drivers/rpmsg/qcom_glink_native.h +++ b/drivers/rpmsg/qcom_glink_native.h @@ -29,12 +29,15 @@ struct qcom_glink_pipe { =20 struct device; struct qcom_glink; +struct rpmsg_endpoint; =20 struct qcom_glink *qcom_glink_native_probe(struct device *dev, unsigned long features, struct qcom_glink_pipe *rx, struct qcom_glink_pipe *tx, - bool intentless); + bool intentless, + void *cluster); +void *qcom_glink_ept_cluster(struct rpmsg_endpoint *ept); void qcom_glink_native_remove(struct qcom_glink *glink); void qcom_glink_native_rx(struct qcom_glink *glink); =20 diff --git a/drivers/rpmsg/qcom_glink_rpm.c b/drivers/rpmsg/qcom_glink_rpm.c index e3ba2c63a5fc..9c1ff05d4a10 100644 --- a/drivers/rpmsg/qcom_glink_rpm.c +++ b/drivers/rpmsg/qcom_glink_rpm.c @@ -346,7 +346,7 @@ static int glink_rpm_probe(struct platform_device *pdev) 0, &rpm->rx_pipe.native, &rpm->tx_pipe.native, - true); + true, NULL); if (IS_ERR(glink)) { mbox_free_channel(rpm->mbox_chan); return PTR_ERR(glink); diff --git a/drivers/rpmsg/qcom_glink_smem.c b/drivers/rpmsg/qcom_glink_sme= m.c index 35bb03e67ae8..938f9575784e 100644 --- a/drivers/rpmsg/qcom_glink_smem.c +++ b/drivers/rpmsg/qcom_glink_smem.c @@ -225,7 +225,8 @@ static void qcom_glink_smem_release(struct device *dev) } =20 struct qcom_glink_smem *qcom_glink_smem_register(struct device *parent, - struct device_node *node) + struct device_node *node, + void *cluster) { struct glink_smem_pipe *rx_pipe; struct glink_smem_pipe *tx_pipe; @@ -345,7 +346,7 @@ struct qcom_glink_smem *qcom_glink_smem_register(struct= device *parent, glink =3D qcom_glink_native_probe(dev, GLINK_FEATURE_INTENT_REUSE, &rx_pipe->native, &tx_pipe->native, - false); + false, cluster); if (IS_ERR(glink)) { ret =3D PTR_ERR(glink); goto err_free_mbox; diff --git a/drivers/rpmsg/qcom_glink_ssr.c b/drivers/rpmsg/qcom_glink_ssr.c index e71d3716c55c..74c671a19af0 100644 --- a/drivers/rpmsg/qcom_glink_ssr.c +++ b/drivers/rpmsg/qcom_glink_ssr.c @@ -11,6 +11,8 @@ #include #include =20 +#include "qcom_glink_native.h" + /** * struct do_cleanup_msg - The data structure for an SSR do_cleanup message * @version: The G-Link SSR protocol version @@ -55,16 +57,34 @@ struct glink_ssr { struct completion completion; }; =20 +/** + * struct glink_ssr_notify_data - payload of an SSR notification + * @ssr_name: name of the remoteproc that has been stopped + * @cluster: cluster identifier of the remoteproc that has been stopped, + * or NULL if it is not part of a cluster + */ +struct glink_ssr_notify_data { + const char *ssr_name; + void *cluster; +}; + /* Notifier list for all registered glink_ssr instances */ static BLOCKING_NOTIFIER_HEAD(ssr_notifiers); =20 /** * qcom_glink_ssr_notify() - notify GLINK SSR about stopped remoteproc * @ssr_name: name of the remoteproc that has been stopped + * @cluster: cluster identifier of the remoteproc that has been stopped, + * or NULL if it is not part of a cluster */ -void qcom_glink_ssr_notify(const char *ssr_name) +void qcom_glink_ssr_notify(const char *ssr_name, void *cluster) { - blocking_notifier_call_chain(&ssr_notifiers, 0, (void *)ssr_name); + struct glink_ssr_notify_data data =3D { + .ssr_name =3D ssr_name, + .cluster =3D cluster, + }; + + blocking_notifier_call_chain(&ssr_notifiers, 0, &data); } EXPORT_SYMBOL_GPL(qcom_glink_ssr_notify); =20 @@ -100,18 +120,24 @@ static int qcom_glink_ssr_notifier_call(struct notifi= er_block *nb, void *data) { struct glink_ssr *ssr =3D container_of(nb, struct glink_ssr, nb); + struct glink_ssr_notify_data *notify_data =3D data; struct do_cleanup_msg msg; - char *ssr_name =3D data; + void *cluster; int ret; =20 + /* Cluster siblings' firmware can't handle peer SSR notify; skip it */ + cluster =3D qcom_glink_ept_cluster(ssr->ept); + if (cluster && cluster =3D=3D notify_data->cluster) + return NOTIFY_DONE; + ssr->seq_num++; reinit_completion(&ssr->completion); =20 memset(&msg, 0, sizeof(msg)); msg.command =3D cpu_to_le32(GLINK_SSR_DO_CLEANUP); msg.seq_num =3D cpu_to_le32(ssr->seq_num); - msg.name_len =3D cpu_to_le32(strlen(ssr_name)); - strscpy(msg.name, ssr_name, sizeof(msg.name)); + msg.name_len =3D cpu_to_le32(strlen(notify_data->ssr_name)); + strscpy(msg.name, notify_data->ssr_name, sizeof(msg.name)); =20 ret =3D rpmsg_send(ssr->ept, &msg, sizeof(msg)); if (ret < 0) diff --git a/include/linux/rpmsg/qcom_glink.h b/include/linux/rpmsg/qcom_gl= ink.h index bfbd48f435fa..6591d016e8cb 100644 --- a/include/linux/rpmsg/qcom_glink.h +++ b/include/linux/rpmsg/qcom_glink.h @@ -8,22 +8,24 @@ struct qcom_glink_smem; =20 #if IS_ENABLED(CONFIG_RPMSG_QCOM_GLINK) -void qcom_glink_ssr_notify(const char *ssr_name); +void qcom_glink_ssr_notify(const char *ssr_name, void *cluster); #else -static inline void qcom_glink_ssr_notify(const char *ssr_name) {} +static inline void qcom_glink_ssr_notify(const char *ssr_name, void *clust= er) {} #endif =20 #if IS_ENABLED(CONFIG_RPMSG_QCOM_GLINK_SMEM) =20 struct qcom_glink_smem *qcom_glink_smem_register(struct device *parent, - struct device_node *node); + struct device_node *node, + void *cluster); void qcom_glink_smem_unregister(struct qcom_glink_smem *glink); =20 #else =20 static inline struct qcom_glink_smem * qcom_glink_smem_register(struct device *parent, - struct device_node *node) + struct device_node *node, + void *cluster) { return NULL; } --=20 2.43.0 From nobody Mon Sep 28 23:13:07 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 2856741D102 for ; Sat, 15 Aug 2026 13:26:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800372; cv=none; b=ZmN4ps1Dv+R91myJsSGb9kONzV/+gvITNs4wzIwJ8hRHWytdl+c5bfBsXkU6kuOlES0UxnwKq7uUEniEaPFmpMxG4FD0LoeeC7H8aSJo8mN5ja/nchmSu075zv7fc2cHGm5GnUvkReVibDRtdS0b8E1vwqyGjwAvq4cyJ0XBWRU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800372; c=relaxed/simple; bh=y7ar12FG8BENdZ3ityGYZ36lZ87KzzyCCpI/by79cdA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PnnODtNqPt3vFK8cuu5UnKM8rB2CLgsLbqdMGX6oqBs0fIXz+/IjptQZLB7J0//VhVhn2BtZWG8jtVWe2/Szrp0LAlFAYJneTcTjicVUl99m2khkFO04YNig+IoX6dkbYOwfQYcO3bM9W9oKYiu9D7K/yaj58J2qfQOPyLnb89M= 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=MkteGfss; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Y8Sh98gr; arc=none smtp.client-ip=205.220.168.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="MkteGfss"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Y8Sh98gr" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67FDMISV1712610 for ; Sat, 15 Aug 2026 13:26:10 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=zOFtAZ+E2b5 BkVLywK82W0fnJDTIl5z2YkSwRx/DLF0=; b=MkteGfssnE62uvp8ajwUd7R2Una Bm3gGBTlVPrQYjGaKyMgrapFRb02w8mNtSSM3oHrCh1ChhbPtXSXbiWZdcZ3WPrj uF+cDDqOGGFNDj5exIZVcSMEvYPdRihk2gK66+3IvvP/JqHBWwqslj9uVOrTGhdR A7tBSQB1h/kammS/if/330DL5ZWbdWpkqUdwt4nudHTKg31G82lor7NgMKZBWZC7 T85/9oumqaL1XASNl9J9CNI04LEkzNn+bOshrbqWY5zx2b8wDxHuKJMcx0KjnuuP WoeOSUQM8Mc3C6BKunRtAOhESeyWUaFveiFi55N1RvOAJV5ehVHafgBSzrw== Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g2ghf9007-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 15 Aug 2026 13:26:10 +0000 (GMT) Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-38e54b6556aso2275348a91.2 for ; Sat, 15 Aug 2026 06:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786800370; x=1787405170; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=zOFtAZ+E2b5BkVLywK82W0fnJDTIl5z2YkSwRx/DLF0=; b=Y8Sh98gr6GpnPw6OhwyY89CgIgs9X9/S0utDaeoRBDQjr4DV44zoXmlJ22ZASyTg0y uClt3c3srJn7llFlYmPnyWu4LUCEwC9Bncks2FIX/2X4KVjuE3j2RY6zQcuyLq9+AM2N jbcQcD+0pfLTDZB0ewLoadfss4v836aT1K91cdlSdnzRvpcepAQq4xlHrPqRI8TA1/Ed gotzV/fHh1oO78K4GW9FltlJRQOuizlwkPIJ5wQ55sRV1qf1AErHOmBn0hCK//3TnYLr 5gSAhI70osx7NZ+q31y/IPnkOsviIlwFD6Ciii+bvdiRByXTRSWSmUT4TggyOgqQzg1H gwPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786800370; x=1787405170; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=zOFtAZ+E2b5BkVLywK82W0fnJDTIl5z2YkSwRx/DLF0=; b=ftwfswfhhB/RKqhCM3NOL0XEvQaxb7NIk1+uvAnj6mrDzvDPYQYLM3Rt/tQ7LXhLkU 1GcXZnzsMToXnUW0bbNMJqhY9FE6cVJ34OGZukCa3IF2wg6Ly3FvJVVvgXFSnaRSLelW 1662fWexWlQmr7rczPDgrC4iSfidclXK5D8EpNEpJh813qr77Cj6BFFDOjudRgjIAUnG N2jV5xgamwQzTngqBGf815UUIL5WHvlsaL/QL4kS/GYe0DfTUWR+csbDps9WEuZ8AN23 8xnLH3fZUN0M5MsRC618DtJYPHJ0AvB7cz2HLh6BgdieBI7SuWKxonYIUjriQp3h/ObU EozQ== X-Forwarded-Encrypted: i=1; AHgh+RqOlHU60kVc5YCOqlb9pFXZ9L6Dy9IvvYR48aifEcFjGobRorNvuFpfc/aDf5S4wGMXCl6zRDuRvq71sXk=@vger.kernel.org X-Gm-Message-State: AOJu0YxOBQFAVZcwN3EI8x8HTXVmZiQdAzBaIVJ6BCssL5iTnCGp5lnv MvwsjWKi3ev6nLKM2gdbnZew01jx/ag5dRrljV07c9Zdpu5J18FhGaqPKJeLNaUQLsvbn/BQth/ Jaot5AzgaFF38SwKIuzLtkOK8+ydFLfnSMuVMwutE+y/WAZHetZcG0S7X4G5y/n3l3JQ= X-Gm-Gg: AR+sD11LKmqlySZN5pbqbrzKU8bENOraXJXA51uwJxiJhVtCwmi1K/L9GnrldL5yxBd lNZOB7PGyN+2R+BgpDp3j3d1Fnrb/uNKWTCJks6e9jy8PwuGQyrbbYoS+CB4TKh/1gloqgq7prZ EP2mv7a6WFZPOBL3VtkQxRJ199w2VQMBLRLD4qgSsnAL/q5n+KrBAzucowh7EoN6wd6raHJqjrN CxHlFqSGdSX2nrH+a/KkGUkz3Jlr8HU7d47ixBXdTN/GKpiwNp53gEZCfKSDbTWeZveT2FdF+WO JxBG4JKJLyV6NrofBF0PcjB5C8Etn2WmBm3jSL/h9K5WiDCJ3LObA0+K5HsKeEwFv/btHZUDyEq Dicgx0IyEvQz2f8mFvM66piUlDZBsGN7QamNunb8q1hX6N2TIr61gZFisj0d9 X-Received: by 2002:a17:90b:1806:b0:381:26f:8f05 with SMTP id 98e67ed59e1d1-3933bd0f310mr14071496a91.3.1786800369585; Sat, 15 Aug 2026 06:26:09 -0700 (PDT) X-Received: by 2002:a17:90b:1806:b0:381:26f:8f05 with SMTP id 98e67ed59e1d1-3933bd0f310mr14071440a91.3.1786800369057; Sat, 15 Aug 2026 06:26:09 -0700 (PDT) Received: from QCOM-aGQu4IUr3Y.qualcomm.com (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141386a039asm19313374c88.0.2026.08.15.06.26.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2026 06:26:08 -0700 (PDT) From: Shawn Guo To: Bjorn Andersson Cc: Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bartosz Golaszewski , Mukesh Ojha , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH 5/8] remoteproc: qcom: pas: Track HPASS ADSP cluster membership Date: Sat, 15 Aug 2026 21:25:38 +0800 Message-ID: <20260815132541.1575121-6-shengchao.guo@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> References: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Authority-Analysis: v=2.4 cv=OZ6oyBTY c=1 sm=1 tr=0 ts=6a8068f2 cx=c_pps a=0uOsjrqzRL749jD1oC5vDA==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=EUspDBNiAAAA:8 a=tpIsOtObft-OYHULcT0A:9 a=mQ_c8vxmzFEMiUWkPHU9:22 X-Proofpoint-GUID: REqkXsoLR9eZ7ejFg05yCabXfHni7wfq X-Proofpoint-ORIG-GUID: REqkXsoLR9eZ7ejFg05yCabXfHni7wfq X-Proofpoint-Spam-Info: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfX79fE9vAmlZLT 3aXkQOnQSSW1eFxqAMN5KQRhCQuWJQbT5DTq6tUM+igxrxuDXrGTBAsxvMWT0nAUOu9qehvmArc 5LmvfHqbPYAIQCWYCABaXP8znriVFGU= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfXzanRI58xv7M/ aGu81FOfbn/Gez0bESWj6sjxQjz1RBnTr2hVTKWMR0kqftDm9wYW7rUPIIU5yF09VvlQazlvZKH ofYKX8mhbTg6zMydbdDPoNTNYuDIajJb71iEaAEWFPOcw9DE7F1CIU749qtpsmU9nouLB+RIkZT DuVwj/VP6tLjbu2d6xrO3Vm6041QA7wX+esGsK7iBkZWbwRUGE4NIPTaPRdHlnyJDoTN/8MMYp/ f0f02YHfhHjX1BSFKlG8R1vRCgdeNDUCTyz52KqGWf9YHdMkEWUftlU9SbrQJOOLRwJLY0gpqd8 OsFbFKPPQL7l2aNzCJYVGXffMJb46au4qZSd/IH7bdqHLjQ+QH1T+t66hDbpUCa15q9THBQFKpg OYsS8GrCJTcOJUiDCnBWVmJ0dRMsnqCRLuxTNjrh0smqYPI+fR3RfEMh09QbcQesP6EIaGHIGrO cbTCRA+wQMgDK0xAwEw== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-15_04,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 clxscore=1015 malwarescore=0 suspectscore=0 spamscore=0 impostorscore=0 phishscore=0 lowpriorityscore=0 priorityscore=1501 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608150096 Content-Type: text/plain; charset="utf-8" On Nord, ADSP0/1/2 share HPASS-domain resources (PLLs, AG_NOC, RSCp, CESTA, THROTTLE, QTMR) owned by ADSP0, and their firmware cannot tolerate one member being started or stopped independently of the others. Modeling that requires each PAS instance to know which other instances it is grouped with. Add a small registry of clusters, keyed by the device_node every member's "qcom,cluster-root" phandle points at, and join it at probe. Membership is answerable from the node being probed alone: every member carries the property, and the one referencing itself is the root, so there is no need to search the device tree for nodes referencing a given instance. A dependent member is rejected at probe if its root is disabled in DT, since its boot could never be sequenced after a root that will not bind. Publish the cluster in rproc->cluster, which is all sysmon and glink_ssr need to stop notifying siblings of each other's SSR events. The cluster is left only after rproc_del() has stopped this member, so that the suppression is still in effect for that stop, and is unwound on every probe error path, since a member freed while still linked into the cluster would be walked by its siblings. Instances without "qcom,cluster-root" are completely unaffected: qcom_pas.cluster stays NULL for them. Assisted-by: LLM Signed-off-by: Shawn Guo --- drivers/remoteproc/qcom_q6v5_pas.c | 152 +++++++++++++++++++++++++++++ 1 file changed, 152 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q= 6v5_pas.c index 8cff0684fe2f..c8e4230bcf2c 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -66,6 +66,8 @@ struct qcom_pas_data { bool needs_tzmem; }; =20 +struct qcom_pas_cluster; + struct qcom_pas { struct device *dev; struct rproc *rproc; @@ -123,8 +125,148 @@ struct qcom_pas { =20 struct qcom_pas_context *pas_ctx; struct qcom_pas_context *dtb_pas_ctx; + + struct qcom_pas_cluster *cluster; + struct list_head cluster_node; + bool is_cluster_root; +}; + +/** + * struct qcom_pas_cluster - state shared by clustered PAS instances + * @node: device_node of the cluster root, the key into the global list + * @list: linkage in qcom_pas_cluster_list + * @lock: protects @members and @root + * @members: list of struct qcom_pas, linked via cluster_node + * @root: the member whose "qcom,cluster-root" points at itself + * @refcount: number of members currently attached to this cluster + * + * PAS instances whose "qcom,cluster-root" phandle points at the same node + * share one of these. + */ +struct qcom_pas_cluster { + struct device_node *node; + struct list_head list; + + struct mutex lock; + struct list_head members; + struct qcom_pas *root; + + int refcount; }; =20 +static LIST_HEAD(qcom_pas_cluster_list); +static DEFINE_MUTEX(qcom_pas_cluster_list_lock); + +static struct qcom_pas_cluster *qcom_pas_cluster_get(struct device_node *n= ode) +{ + struct qcom_pas_cluster *cluster; + + mutex_lock(&qcom_pas_cluster_list_lock); + + list_for_each_entry(cluster, &qcom_pas_cluster_list, list) { + if (cluster->node =3D=3D node) { + cluster->refcount++; + goto out; + } + } + + cluster =3D kzalloc(sizeof(*cluster), GFP_KERNEL); + if (!cluster) + goto out; + + cluster->node =3D of_node_get(node); + mutex_init(&cluster->lock); + INIT_LIST_HEAD(&cluster->members); + cluster->refcount =3D 1; + list_add_tail(&cluster->list, &qcom_pas_cluster_list); + +out: + mutex_unlock(&qcom_pas_cluster_list_lock); + return cluster; +} + +static void qcom_pas_cluster_put(struct qcom_pas_cluster *cluster) +{ + mutex_lock(&qcom_pas_cluster_list_lock); + if (--cluster->refcount =3D=3D 0) { + list_del(&cluster->list); + mutex_unlock(&qcom_pas_cluster_list_lock); + of_node_put(cluster->node); + kfree(cluster); + return; + } + mutex_unlock(&qcom_pas_cluster_list_lock); +} + +/** + * qcom_pas_cluster_init() - join the cluster referenced by @np, if any + * @pas: PAS instance being probed + * @np: of_node of @pas's platform device + * + * Devices without a "qcom,cluster-root" property are not part of a cluste= r; + * @pas->cluster is left NULL and this is a no-op (e.g. cdsp0-3). Cluster + * members all carry the property, the root included, whose phandle points + * back at itself. + * + * Return: 0 on success, negative errno on failure. + */ +static int qcom_pas_cluster_init(struct qcom_pas *pas, struct device_node = *np) +{ + struct device_node *root_node; + bool is_root; + + root_node =3D of_parse_phandle(np, "qcom,cluster-root", 0); + if (!root_node) + return 0; + + is_root =3D root_node =3D=3D np; + + /* + * A non-root member is useless without its root: it can never be + * booted, since its boot has to be sequenced after the root's. Reject + * it here rather than at first boot, so that a DT enabling a dependent + * DSP but not the one owning the shared resources fails loudly and + * early. + */ + if (!is_root && !of_device_is_available(root_node)) { + dev_err(pas->dev, "cluster root %pOF is not enabled\n", root_node); + of_node_put(root_node); + return -ENODEV; + } + + pas->cluster =3D qcom_pas_cluster_get(root_node); + of_node_put(root_node); + if (!pas->cluster) + return -ENOMEM; + + pas->is_cluster_root =3D is_root; + + mutex_lock(&pas->cluster->lock); + list_add_tail(&pas->cluster_node, &pas->cluster->members); + if (is_root) + pas->cluster->root =3D pas; + mutex_unlock(&pas->cluster->lock); + + return 0; +} + +static void qcom_pas_cluster_exit(struct qcom_pas *pas) +{ + struct qcom_pas_cluster *cluster =3D pas->cluster; + + if (!cluster) + return; + + mutex_lock(&cluster->lock); + list_del(&pas->cluster_node); + if (cluster->root =3D=3D pas) + cluster->root =3D NULL; + mutex_unlock(&cluster->lock); + + qcom_pas_cluster_put(cluster); + pas->cluster =3D NULL; +} + static void qcom_pas_segment_dump(struct rproc *rproc, struct rproc_dump_segment *segment, void *dest, size_t offset, size_t size) @@ -862,6 +1004,12 @@ static int qcom_pas_probe(struct platform_device *pde= v) pas =3D rproc->priv; pas->dev =3D &pdev->dev; pas->rproc =3D rproc; + + ret =3D qcom_pas_cluster_init(pas, pdev->dev.of_node); + if (ret) + return ret; + rproc->cluster =3D pas->cluster; + pas->minidump_id =3D desc->minidump_id; pas->pas_id =3D desc->pas_id; pas->lite_pas_id =3D desc->lite_pas_id; @@ -951,6 +1099,7 @@ static int qcom_pas_probe(struct platform_device *pdev) qcom_pas_unassign_memory_region(pas); free_rproc: device_init_wakeup(pas->dev, false); + qcom_pas_cluster_exit(pas); =20 return ret; } @@ -964,6 +1113,9 @@ static void qcom_pas_remove(struct platform_device *pd= ev) =20 rproc_del(pas->rproc); =20 + pas->rproc->cluster =3D NULL; + qcom_pas_cluster_exit(pas); + qcom_q6v5_deinit(&pas->q6v5); qcom_pas_unassign_memory_region(pas); qcom_remove_glink_subdev(pas->rproc, &pas->glink_subdev); --=20 2.43.0 From nobody Mon Sep 28 23:13:07 2026 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 0368741D217 for ; Sat, 15 Aug 2026 13:26:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800376; cv=none; b=DLtDc/XK77FtOaVRxj5HgKSHsDP9et7pmUPWIhLlgJBIXy+Ji5teaZgevY2gxq7UVmqzGfv/RLW3B1yeiLs+zPL3uudDKh0k+n+z9DUHw/SY7aOZNw3tHubkgld6WGJEGky8VEMB3Yhx6ovi4ektZAg/kvXKgde5v6QEdOFoPEQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800376; c=relaxed/simple; bh=V0xJ5rGoDj5iR1dMadfapVH8RgSP9jryHFE8W+hoDXE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fU9UUoaRjLkFrd803KDj/aVlp8Wrm070rNa08Uq5nBtQSO4Z75kTGBUqvij0328CZjIPBFR87olchkHRGM3pLP0IAwuyGqTKfSaIGUSJlGrz/2apl+nxpT5p5WR2jblXcR+pYSxNWs2TxPI/Ekemy0xJBCjpIEmfNYhfg9dOPco= 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=Dob8upJI; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=bW2M26/M; arc=none smtp.client-ip=205.220.168.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="Dob8upJI"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="bW2M26/M" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67FDMZrE219370 for ; Sat, 15 Aug 2026 13:26:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=yR1lFmAjTJo UnDiSDduEbpWfWkdC6wgUbDXk1v75sWU=; b=Dob8upJI1SVnHglxdW3XAWBnKQ3 RUSIpoe/icMPvoc6zCUk3tfLVwNmcaZrDWeiydOaycmO+N6sKGn5qgDnGn5Skn2/ 71oUFLgvM5mHZFU/0mJeWu/rDZBdV/rm9/H//9I3Lvoj2fwDEgTqjMEW6k8wVKrY P2hqjA9/xlDJsb6KsD18uYKs2gf8xH0L+dfmkw1l4UOi0Kb1e4fVAe2Y01LuV/Ah +chIg5fbgv5QXvdZ8GguroN3a2DDe1PeAD3ndLgANSnMoOGkt3eWgptayWD6gXxt JODvwTfkZg9+UDkiZKqMHb418EF3P2QfP/5kjNELjy42xBo3fz1nyjHQDFw== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g2hd7rvrp-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 15 Aug 2026 13:26:14 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-cbb92868263so1246275a12.2 for ; Sat, 15 Aug 2026 06:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786800373; x=1787405173; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=yR1lFmAjTJoUnDiSDduEbpWfWkdC6wgUbDXk1v75sWU=; b=bW2M26/Msw8xwVA2y7HBA1yoED8CfeRT/UTEHkT4QEOFCz1YocH6WQgI9vHaPTznNR XNAVqz0sJBmW165JdmIzfHBPcNaWLu32BMUOJxUT7frueFRrAA1isfchfzDqDAEj6Mlh myRf6hVRIBpENaaNsAlakUYEIS78dG+w+EYOZfQuxCjfKfXPIjVf43FOkATkNh9bmdYy 6q9ebjpktoiBPzojveVP++vXg2CIaNaAP3RK8R7S52dfVCnsFzHSGVwqeoF/MYMk2oxj vbtYxWpecP9oni/ocvnYZmalVHuBOCCeGnfXFR2HAjEJe1WIUXzUwWTeMDhnwu914QpQ ts6A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786800373; x=1787405173; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=yR1lFmAjTJoUnDiSDduEbpWfWkdC6wgUbDXk1v75sWU=; b=TeU+5YW7Jp990ri0H8AgYnqsYu9St5cyWKa5EgxGLWaXVWdlSgvlxlD9v8SmLc2qVZ q7G6v46KbCy8IGJLBcnUoi1GhrMipgwMMVuksWBftIS0WSaSwmv7K2vxHVM0qZKKD1/P WunGUzJVEGEbfuL/eSI+Tb0g5slZlIh0Mg2U46DAuxJy6wzQXEQY7e1EmuZ4B9OW84kX qg1B15fggC8TlcDY8rwyVJxBzEngm7zw3uCGGlTVPY9muHuf4/UeIYqRz6lEjIWZ7eIt HlmJKtKIXcXU8JRN6wl02TS7Yu99Gzk+ywpltykbd4+1sm09t0AKDkfV4MLQ4Lk9u/R5 jWGA== X-Forwarded-Encrypted: i=1; AHgh+RrqmNjBU7YuVbubbza8m561IOUJ3FrXkn9mo/cDjC4Zki4gdt1Bnxi2mj66qgwvGQo2E/v+ABI6u33xZ0g=@vger.kernel.org X-Gm-Message-State: AOJu0YyLU6i3X0PulpPY2xMBDGAIz1DaKoStVaDctmvLl7vYegq9OVuo wCFyQB6r2RWjLAFbkI7KGJMP/1cvwH9+xCMJM+INo3MgBAZemMqagtJyGrqe0VsVqaf2IfrgznQ mUr5daMbhIpfw3nbj+TWqnaoQJyTghBsNYiCfb4ja13d408mWN6lISUDjOnSEngDZoPY= X-Gm-Gg: AR+sD12TLP5HQ6Mtq55focvD6wT07dPQhGryMt2lmcVP+DHiQ2/lPfamJJ2mK6VEkeM QPS64s6fbDwxstuIONeHpupZgCyz/jtIGR6zAFbUOFEG4FbXrDJq1yImgfm00P0dJe+QWjMRtqw PcidmkpiAVJmX1EOCsP2REXP3zoOU/I/bLlqDzDQjdkVnp867m76dJxSIo3SzFJfP+SWPahb8n7 lp2TiD7d2VqA0sZgWwl8hO1IGq4zGxAK0TVgMRCJcByTtoXP++0XE9apqhX10ao/vu3tOCTCsoh Q7gsy1VjCUUJgCTjM0tv2A6z2+ZFurhLS36Ipqmjl7NyrNqOuYgIErlNOdwQuLW8+LPcAVycGN0 d/RYGVdEZ3vluiBGR9i7fYEwJWIRP3rEWSGEQ3PMDAUxM3kaFbF7/Ip9uNCOA X-Received: by 2002:a17:90b:3889:b0:381:11eb:d78e with SMTP id 98e67ed59e1d1-3933b8ace11mr13189662a91.14.1786800373312; Sat, 15 Aug 2026 06:26:13 -0700 (PDT) X-Received: by 2002:a17:90b:3889:b0:381:11eb:d78e with SMTP id 98e67ed59e1d1-3933b8ace11mr13189639a91.14.1786800372740; Sat, 15 Aug 2026 06:26:12 -0700 (PDT) Received: from QCOM-aGQu4IUr3Y.qualcomm.com (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141386a039asm19313374c88.0.2026.08.15.06.26.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2026 06:26:12 -0700 (PDT) From: Shawn Guo To: Bjorn Andersson Cc: Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bartosz Golaszewski , Mukesh Ojha , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH 6/8] remoteproc: qcom: pas: Sequence HPASS ADSP cluster boot root-first Date: Sat, 15 Aug 2026 21:25:39 +0800 Message-ID: <20260815132541.1575121-7-shengchao.guo@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> References: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfX8wzZFL3Phw3I R91qKLFpFUeq0SlrX406GdYULLHnFP9h9NT6aqtAent9oekdmmxoVaVM6x1cDEUY/mV8euA51Bf VBdOuVZTsIZ/I/7ptZg4GqomC6//NreoCQJO0YdoZSWPVHUCiBo7I6/SL9UjZj0a6qTjYKIGRpA 1QYr4QdAtIhTjgsz/LYN2Ubi3AMb7TvfnIkhBn02EqCb327KEx78hKxuyGbZDwuDoHld6yV2KVZ 58G1mZpufxilgXIiMHQgSv8AAZEiULFUGlwfN8CTFezPQ0XMqWDt3xQ01XB8oGbCl5WulXszVg1 X4lKMSw9E8XTyXX0MjOMKd6NztaeU6wDXYA2ycBWUz1ZS6Zc2pirlmG7n8tFCY2InKY7pf1corO TpPak+hZkOH7+43idr+RqSUDtw4upav/zDjFzpV4FLR+JnNOTPUzViU+6pzop3LNpmF59BsW6T2 MDPpLOmkI8fMaWW24tQ== X-Proofpoint-GUID: H9HrGOJY2q_xx4atES_qKyJZkmJSo_dM X-Authority-Analysis: v=2.4 cv=Ja2Ma0KV c=1 sm=1 tr=0 ts=6a8068f6 cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=NQtoXHyzFVGnf705VfcA:9 a=_Vgx9l1VpLgwpw_dHYaR:22 X-Proofpoint-ORIG-GUID: H9HrGOJY2q_xx4atES_qKyJZkmJSo_dM X-Proofpoint-Spam-Info: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfX7WzD1wTHHPF4 pb+drzUjS53m0XQNH7kITW06IthfQaO2hwQmcDPANtRBoR6x89OSktH7poysXFZgRo4XXPn3uzU KPUtNms0oVB1cM9/3bpN5jOGq7b8ea0= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-15_04,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 spamscore=0 suspectscore=0 adultscore=0 bulkscore=0 impostorscore=0 clxscore=1015 phishscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608150096 Content-Type: text/plain; charset="utf-8" The cluster root owns the HPASS resources shared with its siblings and initializes them as part of its own boot, so ADSP1/ADSP2 can only cold boot once ADSP0 is up. Booting a dependent member first leaves it without the clocks, resets and NoC configuration it needs. Gate a dependent member's qcom_pas_start() on the root having started. The root being enabled in DT does not imply it has already bound, as probe order between the two is not guaranteed, so fail the boot if the root has not bound rather than dereferencing it. If the root has bound but is not running yet, wait briefly on a completion the root signals from its own qcom_pas_start(), so that a member racing the root through a restart does not fail outright. The completion starts out signaled, since a member may be attached to already-running firmware at probe, and is only cleared once the root actually goes down. A dependent member's boot racing the root's stop can therefore still observe a stale completion, in which case it falls back to failing on the root's state. Assisted-by: LLM Signed-off-by: Shawn Guo --- drivers/remoteproc/qcom_q6v5_pas.c | 76 ++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q= 6v5_pas.c index c8e4230bcf2c..8231f811c568 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -138,6 +138,7 @@ struct qcom_pas { * @lock: protects @members and @root * @members: list of struct qcom_pas, linked via cluster_node * @root: the member whose "qcom,cluster-root" points at itself + * @root_booted: signaled once @root has started, cleared when it goes down * @refcount: number of members currently attached to this cluster * * PAS instances whose "qcom,cluster-root" phandle points at the same node @@ -150,10 +151,18 @@ struct qcom_pas_cluster { struct mutex lock; struct list_head members; struct qcom_pas *root; + struct completion root_booted; =20 int refcount; }; =20 +/* + * How long a dependent member waits for its root to finish booting before + * giving up, e.g. when it is racing the root through the crash-restart + * cascade. + */ +#define QCOM_PAS_CLUSTER_ROOT_BOOT_TIMEOUT (1 * HZ) + static LIST_HEAD(qcom_pas_cluster_list); static DEFINE_MUTEX(qcom_pas_cluster_list_lock); =20 @@ -177,6 +186,13 @@ static struct qcom_pas_cluster *qcom_pas_cluster_get(s= truct device_node *node) cluster->node =3D of_node_get(node); mutex_init(&cluster->lock); INIT_LIST_HEAD(&cluster->members); + init_completion(&cluster->root_booted); + /* + * Cluster members may be attached to already-running firmware at + * probe, so the root is presumed up until its own qcom_pas_stop() + * reinit_completion()s this the first time it actually goes down. + */ + complete_all(&cluster->root_booted); cluster->refcount =3D 1; list_add_tail(&cluster->list, &qcom_pas_cluster_list); =20 @@ -267,6 +283,51 @@ static void qcom_pas_cluster_exit(struct qcom_pas *pas) pas->cluster =3D NULL; } =20 +/** + * qcom_pas_cluster_wait_for_root() - gate a dependent member's boot on it= s root + * @pas: the non-root cluster member being started + * + * The cluster root owns the resources its siblings need, and initializes = them + * as part of its own boot, so a dependent member can only be started once= the + * root is up. + * + * Return: 0 if the root is up, negative errno otherwise. + */ +static int qcom_pas_cluster_wait_for_root(struct qcom_pas *pas) +{ + struct qcom_pas_cluster *cluster =3D pas->cluster; + struct rproc *root; + + /* + * The root's PAS instance is enabled in DT (checked in + * qcom_pas_cluster_init()) but has not necessarily bound yet, and may + * have unbound again. Without it there is nothing to sequence this + * member's boot against. + * + * Note that nothing refcounts members across unbind, so a root freed + * under a concurrent sibling boot remains unhandled. + */ + mutex_lock(&cluster->lock); + root =3D cluster->root ? cluster->root->rproc : NULL; + mutex_unlock(&cluster->lock); + + if (!root) { + dev_err(pas->dev, "cluster root not bound\n"); + return -ENODEV; + } + + if (root->state =3D=3D RPROC_RUNNING || root->state =3D=3D RPROC_ATTACHED) + return 0; + + if (!wait_for_completion_timeout(&cluster->root_booted, + QCOM_PAS_CLUSTER_ROOT_BOOT_TIMEOUT)) { + dev_err(pas->dev, "cluster root not started\n"); + return -ENODEV; + } + + return 0; +} + static void qcom_pas_segment_dump(struct rproc *rproc, struct rproc_dump_segment *segment, void *dest, size_t offset, size_t size) @@ -424,6 +485,12 @@ static int qcom_pas_start(struct rproc *rproc) struct qcom_pas *pas =3D rproc->priv; int ret; =20 + if (pas->cluster && !pas->is_cluster_root) { + ret =3D qcom_pas_cluster_wait_for_root(pas); + if (ret) + return ret; + } + ret =3D qcom_q6v5_prepare(&pas->q6v5); if (ret) return ret; @@ -494,6 +561,9 @@ static int qcom_pas_start(struct rproc *rproc) if (pas->dtb_pas_id) qcom_pas_metadata_release(pas->dtb_pas_ctx); =20 + if (pas->cluster && pas->is_cluster_root) + complete_all(&pas->cluster->root_booted); + /* firmware is used to pass reference from qcom_pas_start(), drop it now = */ pas->firmware =3D NULL; =20 @@ -549,6 +619,12 @@ static int qcom_pas_stop(struct rproc *rproc) int handover; int ret; =20 + if (pas->cluster && pas->is_cluster_root) { + mutex_lock(&pas->cluster->lock); + reinit_completion(&pas->cluster->root_booted); + mutex_unlock(&pas->cluster->lock); + } + ret =3D qcom_q6v5_request_stop(&pas->q6v5, pas->sysmon); if (ret =3D=3D -ETIMEDOUT) dev_err(pas->dev, "timed out on wait\n"); --=20 2.43.0 From nobody Mon Sep 28 23:13:07 2026 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 770FC41D64C for ; Sat, 15 Aug 2026 13:26:19 +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=1786800381; cv=none; b=jS9bArGDZcmrREY3L4J1OkGYwlAubyTkZKV2P7uVxK7EFMsBurG5HeSN8dRmMYBDdvz22FtvHSdKBziSFnHrOlp3OD0No0Wemp2d/cnekUicp6eSBhtURCL/xLjqRKd13HEof3swH3oEozKUJPfupEl+KG2L2fkFQGoYuxexDKo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800381; c=relaxed/simple; bh=6hJ2Neyqt1yVgVG8m5IVPz9TrIU+IS9JiugWuvi5OwY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=k0m3Wabd4DbZREg2UwtwUlVhZBQxouBf+ERZwwLJ2AkWv9Lu72aPy/aH1AluSnxQ7msmoEujk9Csj+Cz5mehIETPfe11W4XTu8ePPQ1iyQdbFpZae1pyUHQbFJchvu1rr2+ZeC09EUgd6JZD4hkjxBo6UfNYy9jYQ2bYyTuT4F8= 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=hUImqM+0; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=bLVfzZqN; 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="hUImqM+0"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="bLVfzZqN" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67FDNHvX980296 for ; Sat, 15 Aug 2026 13:26:18 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=N4+eWqDVlwc 2a+HPK4I95r2SqBK3eqf9vIWPB4YE/ts=; b=hUImqM+0waN1BmC6MGKR9Yc/4tP ZMyQGeZUCg/SQ9TsB5CPc+vbnklqFtxKqGOr1qvyGalGwbCZBc7JDuqyc6gUolwb nQrVmwBmUAfMYKe7rFOPmRWPs29qjMoxgUpw1R9IpkfJwCAdgIVVzp/jOBl9ZO0Y l5NMiyRiochYNbL2A+OqxkT8HCBT5d8u0o/tZOf9Rg6vboMxsuM+eRY7KLFcApYB GaA6mmcMdvViA/eqcuzTHeVp23p204ndmaRLRQrjJOKtFreyD4EOW5erd23S/pAH izjqDzkQMKC9LCPHFDWUueWrFTiaZFdPZaFwrBYVHoKYVL+UzEuNYEh3F4g== Received: from mail-pg1-f199.google.com (mail-pg1-f199.google.com [209.85.215.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g2ghns12r-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 15 Aug 2026 13:26:18 +0000 (GMT) Received: by mail-pg1-f199.google.com with SMTP id 41be03b00d2f7-cbedbd182f5so1322591a12.1 for ; Sat, 15 Aug 2026 06:26:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786800377; x=1787405177; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=N4+eWqDVlwc2a+HPK4I95r2SqBK3eqf9vIWPB4YE/ts=; b=bLVfzZqN0zKSLsQs+bwJOHIISg1tRK/yMIl0SbsJoMMEs+odlhPM9RTc2ayrJ7H7qE bu+pvU5ejCHUh9JVqI8YYT27xzcAAN4rM2axngyzt4QJIz7sD24kJsRPBYbG15UnNUkW hRipoS4YFEl16rT0aWqQFG2hZ6ws7zCr/2/B+YNA8ahtoyCCYunn1zGhCfIm9zHInCKa cbKMi0+h+kLaGLG6EkAL+rlBPtdj7H26jur9DY4bXREU0HrZoVbBBd+mKh79LPiHw7kb btIOs+yfSePgIYC6fotKze01waWdHx6MjSYMaosgtXPsz66CUpfSz8K8MB8ZI3kIYeAD HJLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786800377; x=1787405177; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=N4+eWqDVlwc2a+HPK4I95r2SqBK3eqf9vIWPB4YE/ts=; b=pC7KipRDnLgrzH6jn7iACsZMTRjPqV0kJLznWoZT+/BVsc0LZp58/F5td1lrW11sL7 o8A4CSDmoQzHgwhlq8F0Kuoe9yqiUrBYi5CBVycmQ4Z25trd/xP76KjhBGYMpqvzy7u9 KoYbAcwp+9BWi0iRZsn2gCYRA3ay0Sj33LDEIVY7KbnP1dUyj5MT44Nx5Cz/yBFfCwdN 4JBmTsvJZhRXcMPmHywh4NEBy1GxcwwItGuWCU1KQiusD7sFB9QJC37N+3pk4GixoDq6 lVHKGarXpoouMW+Im1K8fb8ntmqmfOdqB95o9GK4aHoMxo4oVCS4khRYwZkwFl7FmnLr 8WNg== X-Forwarded-Encrypted: i=1; AHgh+RrR+ORAsLIVJZR4VA9uACu19qgj+6F1XKth6oJ/yuiIfhUKu+p7sYGSjGS3efM0biEeIfbPU3lCw596YUU=@vger.kernel.org X-Gm-Message-State: AOJu0YxbEu66nIVXwFP5yWSGdpnn0/KJPQAgdgCx1KnjTle+eQaWPWXO 9EzLGBaWN/1L8ng8Q/S8pd3zxC6ZaGmGzpHKXTBzh8sS5W3JeBy16xOJ+h8wWEZTbTplSzXdfD1 iapDUyRj1AWDua3W3g7wAmrxTk9cYHdWOZrAWE3w445bBd5LIHEmsNb6t5cmxFzY3yc4= X-Gm-Gg: AR+sD13cKP1R9o3Vy+MW/XlqXRNaKtm/PW7Ou7W+RZTt0ZH47QXMcuNG1eelQrREvbN FF+J9CRqe93lnNmPBDqeFNQr5LEKNWM6gD9JTgKt2atMSVqU+hget4+ZmQpgT2T4I2XEpFsDPL/ i7EgdYRNphZsyARE10PfXbYb2JNV5q65oYS+l0KKLCl9uBYz0ILEVTUaXjy8e9oxCVFfigIRa33 6wavIguV88YPwwJw9IubkbRGc622TXSe2unxkzhyzjWhCwjS+KrmoSqFC+g/DmtweG/ALVSORON xndY10NunvWiTGU72nhKJVV8RKaOJ6aWVq1qRfMJPzI7Nw4K44gvtCp3oXyeuZzeQsu6exfJ+so 6MmM32OBz1A7r6lJaIb0zqPZfyp2i6hCzIzq7UzWKDPBSOZN6DIWkpuSqvrOM X-Received: by 2002:a17:90b:54c3:b0:387:d9cc:7dc3 with SMTP id 98e67ed59e1d1-3931f61cca5mr17122562a91.21.1786800377082; Sat, 15 Aug 2026 06:26:17 -0700 (PDT) X-Received: by 2002:a17:90b:54c3:b0:387:d9cc:7dc3 with SMTP id 98e67ed59e1d1-3931f61cca5mr17122503a91.21.1786800376529; Sat, 15 Aug 2026 06:26:16 -0700 (PDT) Received: from QCOM-aGQu4IUr3Y.qualcomm.com (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141386a039asm19313374c88.0.2026.08.15.06.26.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2026 06:26:16 -0700 (PDT) From: Shawn Guo To: Bjorn Andersson Cc: Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bartosz Golaszewski , Mukesh Ojha , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH 7/8] remoteproc: qcom: pas: Enforce coupled stop/crash for HPASS ADSP clusters Date: Sat, 15 Aug 2026 21:25:40 +0800 Message-ID: <20260815132541.1575121-8-shengchao.guo@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> References: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfXzsMe9iLUVqSc Csv4ayIjo14SCACnCkgRQOW/AF1LHmwck2v55uX/0CAKp4OI3aijDZvqsMdTrSDjabfuYt/IrCd eHQYxkCcAaDpeNMu80nHlSXcivdOAQwt+E8XJlLqiFjBNsHT3zlZkC0CJ+sXHlWKYA8eOJMKk6F nTkYtuWGj6OC8htSDekr1LJFU4B5yT195+lKK0HnNFNLU2EGyg41P9Fe2kgiWA54qliakiaTi3s bGgqJ1oW3wf8AAA+bPVTNVmz0qQim5mOqU3iJYWQlSJivYTmIlNYfIYspCO2Ejk9uUJ+MaXFA1O DdjR2pPqC5Nz2ugAu9aHAJymc92tJF//AlJvNgHhK+lUPBoqu/cjUKGBhIOvtlMkVXWtRbFwWd7 ic2IlS7X01kZPi8A/PdzpBGkfjvR12AT0+wgRNuFG8mmgz8e1TqrJrKclQxxBvo9QIBZPXxVceB haCfF0kLqUlP06WIL0g== X-Proofpoint-ORIG-GUID: ubUQSBTGjCoMVBIY8vzu4BCIukkMhtyv X-Authority-Analysis: v=2.4 cv=QN5YgALL c=1 sm=1 tr=0 ts=6a8068fa cx=c_pps a=Oh5Dbbf/trHjhBongsHeRQ==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=ECmFLyrvDWV1PkQpWfkA:9 a=_Vgx9l1VpLgwpw_dHYaR:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfX3LV1D3h7Zx1H utl47ckS2eWodkX3Vr1XT4w7nE5tIt8cwL+syIy/Q37Urk3iHb1VWcXth/2MJtlDv2K1E1BIX6c 80Cnz0XJikZ+W5B31YMpK9PI+CZsuLI= X-Proofpoint-GUID: ubUQSBTGjCoMVBIY8vzu4BCIukkMhtyv X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-15_04,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 bulkscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608150096 Content-Type: text/plain; charset="utf-8" The firmware of a Nord HPASS ADSP cluster cannot tolerate one member being stopped or restarted independently of the others: doing so leaves sysmon/glink_ssr notify requests to siblings timing out, and the whole cluster unable to recover without manually stopping all three and restarting them in dependency order. Coordinate an explicit stop or crash of any member across the whole cluster in two phases, since hardware testing showed that whichever member's PAS/TZ hardware power-off happens chronologically last always fails its own graceful shutdown ack (both the sysmon SSCTL QMI ack and the SMEM-bit/IRQ ack), regardless of whether that member is the cluster root. Phase 1 fans the stop out to every participant concurrently via a per-member work item and waits, at a barrier, for every participant to finish requesting and awaiting its own graceful ack while the whole cluster is still fully powered. Only once every participant has cleared the barrier does phase 2 let each of them proceed to its actual PAS/TZ hardware power-off, so no member is ever asking firmware to ack a shutdown after a sibling's hardware is already gone. The fan-out has to be deferred to a work item rather than calling rproc_shutdown() inline, because qcom_pas_stop() runs with the remoteproc core holding the stopping member's own rproc->lock, and reaching for a sibling's rproc->lock from inside that critical section would risk an ABBA deadlock against a concurrent operation on that sibling. Membership in a round is decided once, by qcom_pas_cluster_member_stops(), and recorded per member, so that the participant count and the two counters it seeds can never diverge. The crashed member that triggered the round is a participant even though its rproc->state is still RPROC_CRASHED -- the core only sets RPROC_OFFLINE after ops->stop() returns -- while a sibling crashing concurrently is deliberately excluded, being already torn down by its own recovery. On a crash, cascade the stop the same way but also auto-restart the whole cluster root-first once every participant has fully powered off, reusing the root_booted completion to keep non-root members' qcom_pas_start() from racing ahead of the root's boot. An explicit stop leaves the ordered restart to users or higher-level policy. Devices without "qcom,cluster-root" are completely unaffected, since qcom_pas.cluster stays NULL for them. Assisted-by: LLM Signed-off-by: Shawn Guo --- drivers/remoteproc/qcom_q6v5_pas.c | 252 +++++++++++++++++++++++++++++ 1 file changed, 252 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q= 6v5_pas.c index 8231f811c568..0cf0a31f1f1d 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -28,6 +28,7 @@ #include #include #include +#include =20 #include "qcom_common.h" #include "qcom_pil_info.h" @@ -128,7 +129,9 @@ struct qcom_pas { =20 struct qcom_pas_cluster *cluster; struct list_head cluster_node; + struct work_struct stop_work; bool is_cluster_root; + bool in_cluster_stop; }; =20 /** @@ -139,6 +142,13 @@ struct qcom_pas { * @members: list of struct qcom_pas, linked via cluster_node * @root: the member whose "qcom,cluster-root" points at itself * @root_booted: signaled once @root has started, cleared when it goes down + * @cascade_work: deferred work that restarts the cluster after a crash + * @cascade_origin: member whose stop or crash triggered the current round + * @cascade_crashed: true if @cascade_origin crashed, rather than being st= opped + * @stop_in_progress: re-entrancy guard: a coordinated stop is in flight + * @stop_pending: participants still owing a phase-1 graceful-ack attempt + * @stop_barrier: released once @stop_pending reaches 0 + * @stop_done_pending: participants still owing a phase-2 hardware power-o= ff * @refcount: number of members currently attached to this cluster * * PAS instances whose "qcom,cluster-root" phandle points at the same node @@ -153,6 +163,15 @@ struct qcom_pas_cluster { struct qcom_pas *root; struct completion root_booted; =20 + struct work_struct cascade_work; + struct qcom_pas *cascade_origin; + bool cascade_crashed; + bool stop_in_progress; + + int stop_pending; + struct completion stop_barrier; + int stop_done_pending; + int refcount; }; =20 @@ -163,9 +182,78 @@ struct qcom_pas_cluster { */ #define QCOM_PAS_CLUSTER_ROOT_BOOT_TIMEOUT (1 * HZ) =20 +/* + * How long a member waits at the phase-1 barrier for the rest of the clus= ter, + * in case a participant never reaches it at all (e.g. rproc_stop() bails = out + * before calling ops->stop). + */ +#define QCOM_PAS_CLUSTER_STOP_TIMEOUT (20 * HZ) + static LIST_HEAD(qcom_pas_cluster_list); static DEFINE_MUTEX(qcom_pas_cluster_list_lock); =20 +static void qcom_pas_stop_work_fn(struct work_struct *work) +{ + struct qcom_pas *pas =3D container_of(work, struct qcom_pas, stop_work); + + rproc_shutdown(pas->rproc); +} + +/** + * qcom_pas_cluster_cascade_work() - restart a crashed cluster, root first + * @work: the cluster's cascade_work + * + * Only ever scheduled from qcom_pas_cluster_stop_complete(), i.e. only af= ter + * every participant has finished its own phase-2 hardware power-off, and = only + * when the round that just finished was a crash; explicit stops never + * auto-restart. + */ +static void qcom_pas_cluster_cascade_work(struct work_struct *work) +{ + struct qcom_pas_cluster *cluster =3D container_of(work, struct qcom_pas_c= luster, + cascade_work); + struct qcom_pas *pas, *origin, *root; + + mutex_lock(&cluster->lock); + origin =3D cluster->cascade_origin; + root =3D cluster->root; + mutex_unlock(&cluster->lock); + + /* + * Membership is stable here: qcom_pas_cluster_exit() always + * cancel_work_sync()s this work before touching cluster->members, so no + * member can join or leave while this work item is running. + * + * If @origin is itself the root, its own crash-recovery thread + * (rproc_boot_recovery()) is already booting it directly -- never call + * rproc_boot() on @origin from here. The root has to be booted before + * any other member, since a dependent member's qcom_pas_start() blocks + * on cluster->root_booted: were we to boot it first from this + * single-threaded work item, it would wait out its timeout on a root + * boot this same thread has not issued yet. + */ + if (root && root !=3D origin) { + int ret; + + ret =3D rproc_boot(root->rproc); + if (ret) { + dev_err(root->dev, "failed to restart cluster root: %d\n", ret); + return; + } + } + + list_for_each_entry(pas, &cluster->members, cluster_node) { + int ret; + + if (pas =3D=3D origin || pas =3D=3D root) + continue; + + ret =3D rproc_boot(pas->rproc); + if (ret) + dev_err(pas->dev, "failed to restart cluster sibling: %d\n", ret); + } +} + static struct qcom_pas_cluster *qcom_pas_cluster_get(struct device_node *n= ode) { struct qcom_pas_cluster *cluster; @@ -187,6 +275,8 @@ static struct qcom_pas_cluster *qcom_pas_cluster_get(st= ruct device_node *node) mutex_init(&cluster->lock); INIT_LIST_HEAD(&cluster->members); init_completion(&cluster->root_booted); + init_completion(&cluster->stop_barrier); + INIT_WORK(&cluster->cascade_work, qcom_pas_cluster_cascade_work); /* * Cluster members may be attached to already-running firmware at * probe, so the root is presumed up until its own qcom_pas_stop() @@ -256,6 +346,7 @@ static int qcom_pas_cluster_init(struct qcom_pas *pas, = struct device_node *np) return -ENOMEM; =20 pas->is_cluster_root =3D is_root; + INIT_WORK(&pas->stop_work, qcom_pas_stop_work_fn); =20 mutex_lock(&pas->cluster->lock); list_add_tail(&pas->cluster_node, &pas->cluster->members); @@ -273,6 +364,9 @@ static void qcom_pas_cluster_exit(struct qcom_pas *pas) if (!cluster) return; =20 + cancel_work_sync(&pas->stop_work); + cancel_work_sync(&cluster->cascade_work); + mutex_lock(&cluster->lock); list_del(&pas->cluster_node); if (cluster->root =3D=3D pas) @@ -328,6 +422,153 @@ static int qcom_pas_cluster_wait_for_root(struct qcom= _pas *pas) return 0; } =20 +/* + * A member takes part in a coordinated stop if its hardware is still powe= red: + * either it is running or attached, or it is the crashed member that trig= gered + * the round, whose rproc->state is RPROC_CRASHED and only becomes + * RPROC_OFFLINE once its ops->stop() has returned. + * + * A sibling that crashes concurrently is deliberately not a participant: = it is + * already being torn down by its own recovery, and pulling it into this r= ound + * would leave the two rounds fighting over the same counters. + */ +static bool qcom_pas_cluster_member_stops(struct qcom_pas *member, + struct qcom_pas *origin) +{ + if (member =3D=3D origin) + return true; + + return member->rproc->state =3D=3D RPROC_RUNNING || + member->rproc->state =3D=3D RPROC_ATTACHED; +} + +/** + * qcom_pas_cluster_trigger_stop() - begin a coordinated cluster stop + * @pas: the member that is being stopped or has crashed + * @crashed: true if @pas crashed, rather than being stopped explicitly + * + * Marks every member whose hardware is still powered as a participant of = this + * round and fires off each *other* participant's own full stop concurrent= ly + * via its stop_work, instead of one after another. This lets every + * participant's phase-1 graceful-ack attempt (see qcom_pas_stop()) run wh= ile + * all of them are still fully powered, so nobody is asking firmware to ac= k a + * shutdown after a sibling's hardware is already gone. + * + * A no-op if a coordinated stop is already in flight, e.g. when @pas is a + * sibling whose own stop was itself triggered by this same round: @pas is + * already marked as a participant and just goes on to take part in it. + * + * Must not call rproc_shutdown()/rproc_boot() directly from here: this ru= ns + * from inside qcom_pas_stop(), which the remoteproc core calls with @pas'= s own + * rproc->lock held, and taking a sibling's rproc->lock synchronously from + * within that critical section would risk an ABBA deadlock against a + * concurrent operation on the sibling. + */ +static void qcom_pas_cluster_trigger_stop(struct qcom_pas *pas, bool crash= ed) +{ + struct qcom_pas_cluster *cluster =3D pas->cluster; + struct qcom_pas *member; + int active =3D 0; + + mutex_lock(&cluster->lock); + if (cluster->stop_in_progress) { + mutex_unlock(&cluster->lock); + return; + } + + cluster->stop_in_progress =3D true; + cluster->cascade_origin =3D pas; + cluster->cascade_crashed =3D crashed; + + list_for_each_entry(member, &cluster->members, cluster_node) { + member->in_cluster_stop =3D qcom_pas_cluster_member_stops(member, pas); + if (member->in_cluster_stop) + active++; + } + + cluster->stop_pending =3D active; + cluster->stop_done_pending =3D active; + reinit_completion(&cluster->stop_barrier); + + /* + * Fan out while still holding the lock, so that membership cannot + * change between counting the participants and scheduling them, and so + * that a stop_work running immediately blocks in + * qcom_pas_cluster_stop_barrier() until the counters above are in + * place. schedule_work() does not sleep, so it is safe from here. + */ + list_for_each_entry(member, &cluster->members, cluster_node) { + if (member =3D=3D pas || !member->in_cluster_stop) + continue; + + schedule_work(&member->stop_work); + } + mutex_unlock(&cluster->lock); +} + +/** + * qcom_pas_cluster_stop_barrier() - wait for the whole cluster's phase-1 = ack + * @pas: the member calling this from inside its own qcom_pas_stop() + * + * Blocks this member's own hardware power-off until every other participa= nt + * has also finished its phase-1 graceful-ack attempt (see qcom_pas_stop()= ). + * Bounded by QCOM_PAS_CLUSTER_STOP_TIMEOUT, proceeding to phase 2 anyway + * rather than hanging forever. + * + * A member that is not a participant of the current round, having already= been + * powered off before it started, has no ack to contribute and must not to= uch + * the counters. + */ +static void qcom_pas_cluster_stop_barrier(struct qcom_pas *pas) +{ + struct qcom_pas_cluster *cluster =3D pas->cluster; + + mutex_lock(&cluster->lock); + if (!pas->in_cluster_stop) { + mutex_unlock(&cluster->lock); + return; + } + if (--cluster->stop_pending =3D=3D 0) + complete_all(&cluster->stop_barrier); + mutex_unlock(&cluster->lock); + + if (!wait_for_completion_timeout(&cluster->stop_barrier, + QCOM_PAS_CLUSTER_STOP_TIMEOUT)) + dev_warn(pas->dev, "timed out waiting for cluster stop barrier\n"); +} + +/** + * qcom_pas_cluster_stop_complete() - record this member's phase-2 complet= ion + * @pas: the member calling this from inside its own qcom_pas_stop() + * + * The last participant to call this, i.e. the last to finish powering off= its + * own hardware, ends the round and, if it was triggered by a crash, sched= ules + * the root-first restart cascade. + */ +static void qcom_pas_cluster_stop_complete(struct qcom_pas *pas) +{ + struct qcom_pas_cluster *cluster =3D pas->cluster; + bool crashed; + + mutex_lock(&cluster->lock); + if (!pas->in_cluster_stop) { + mutex_unlock(&cluster->lock); + return; + } + pas->in_cluster_stop =3D false; + + if (--cluster->stop_done_pending !=3D 0) { + mutex_unlock(&cluster->lock); + return; + } + cluster->stop_in_progress =3D false; + crashed =3D cluster->cascade_crashed; + mutex_unlock(&cluster->lock); + + if (crashed) + schedule_work(&cluster->cascade_work); +} + static void qcom_pas_segment_dump(struct rproc *rproc, struct rproc_dump_segment *segment, void *dest, size_t offset, size_t size) @@ -625,10 +866,18 @@ static int qcom_pas_stop(struct rproc *rproc) mutex_unlock(&pas->cluster->lock); } =20 + if (pas->cluster) + qcom_pas_cluster_trigger_stop(pas, rproc->state =3D=3D RPROC_CRASHED); + + /* Phase 1: request and await this member's own graceful ack */ ret =3D qcom_q6v5_request_stop(&pas->q6v5, pas->sysmon); if (ret =3D=3D -ETIMEDOUT) dev_err(pas->dev, "timed out on wait\n"); =20 + if (pas->cluster) + qcom_pas_cluster_stop_barrier(pas); + + /* Phase 2: the whole cluster has acked, power the hardware off */ ret =3D qcom_pas_shutdown(pas->pas_id); if (ret && pas->decrypt_shutdown) ret =3D qcom_pas_shutdown_poll_decrypt(pas); @@ -653,6 +902,9 @@ static int qcom_pas_stop(struct rproc *rproc) if (pas->smem_host_id) ret =3D qcom_smem_bust_hwspin_lock_by_host(pas->smem_host_id); =20 + if (pas->cluster) + qcom_pas_cluster_stop_complete(pas); + return ret; } =20 --=20 2.43.0 From nobody Mon Sep 28 23:13:07 2026 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 C0A093DF008 for ; Sat, 15 Aug 2026 13:26:22 +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=1786800384; cv=none; b=WPA4VFW33SCot38HXrmFuKqziZf5mcS4URkaQeNvfnJ0yg2Q4zXP56Lbo9m2q8o6GaB2fiFcLzJnMyfnMOu+ED4mHVp4dMQcpdBvI1DSCC7JxzQ+LW8gmFmjNOcEB6iYBaZpcuBPZ/RsqKCV0JgokBvU9RDqn4kjFinjJhUkkg0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786800384; c=relaxed/simple; bh=lJR6G5HF4bl1M1j9qzIr9Pod7FQ6Wv8te8xQH+WXaCI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MZgLUqha5vv5meED+icEkqXqL/0jXE43/lOyRlrzw8b3HXsdag5WG9g227H0UlmTpUTZrTS//QSdSp1nL7lKsFSCi8ytWIbTXtSkuy8Ko2A2Dhtk1CuDomAeyrOs0YvRDEgnAjPYcpO4q/XAoB/Iw3A+jT1sW4X1cTlI1KuMPEs= 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=jl3M/2sE; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=htWd0/8z; 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="jl3M/2sE"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="htWd0/8z" Received: from pps.filterd (m0279872.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67FDNHWT248736 for ; Sat, 15 Aug 2026 13:26:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:date:from:in-reply-to:message-id :mime-version:references:subject:to; s=qcppdkim1; bh=GXUsTUTY9OU wECVz/6AHbVUjWEzJ2lKqUl+uPQfQqfY=; b=jl3M/2sE6jyZJXYGTyQwxyOvhVN XHBtGcbQOM8vrtknabBv/o483i3QR3H4N/zJDxupzXNZU5lq3CmPJJsLCqmOS0Ph T8KPaKm+NJ5uPFsyoatMi1hlh4MWpNcI612fo98P2YKMLlIboXBpZSiMv13+EEvY v5aOlRim3qe4ce5JALxjHjnhMNMamdaenowmsgMnSCR7ddZVGVy9/+HY59UNaeb5 9B1R2tiuz59QZ+J9PoGt1zJgO2QbLTZN0ylhIogTwQ7Z1OYhQ9tV/TE4Ck2Iku1r 2FfOnayIzG8Y7i3Wx1g/lHmQysnwR1hFXSYRqZ9ADnM3pqZWb/yQPlynbLw== 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 4g2ghf91q3-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sat, 15 Aug 2026 13:26:21 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-cbedc1899f7so1151802a12.2 for ; Sat, 15 Aug 2026 06:26:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786800381; x=1787405181; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=GXUsTUTY9OUwECVz/6AHbVUjWEzJ2lKqUl+uPQfQqfY=; b=htWd0/8zB3P0VgiId1mYUBu9UpHzrQS+q5DUo1/roytAOfmJ0e1T5xkZoTkNt2i9yT ddpVBjdpfVJx28uByNI/CTJEsa0txRZyQ8zOrx3rhp2yyOg0nGVyd7kbX5VSCI7X9Xyy 0uR9uMDPuGYd9SRorSqlQouzauBkjWoRuOgIflFwwKf28uHnxGCZPC/6N9zdL0ztD5UT K6Sv8RN7T9J0PaMGaXCu53f7oir7MJv+3rx/cPCKA7d8Qz7eTn9pn2zIkqzE2wUlUwzo /0EBGmZxaZ6RjThSJmcenZUeICwbEIK9/wPAsyUNeRIeOi3eYTlQbquIuqyrqP2v5eVd TVyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786800381; x=1787405181; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=GXUsTUTY9OUwECVz/6AHbVUjWEzJ2lKqUl+uPQfQqfY=; b=Q147s9hUGH4D4DLzr4et5bYnCWxAhTlYOxGI8po5XNeBYGPUBtevRExjuXEinq8X1S 3k5k2Opu3soytbmLnNoA7BW6blFrHQ9N8FerVb5WuIL0NIfM/nqVuLa9Nksal/pWJGuc o1Ue4RzraRdSYKGJQ8ZdWLYT241BIjHC28kDJCk6kribDXhz9xQlhsQy7GDj8CQOMUED RimYw9K19rR8x3neCbMZhRYDI0v5m9+9R6mBbXnzOIJ9ROZ7sQecY+co4Jz3FiCTa1C5 M04qfAxgunXVltDmu+8w7dAXnBOfUEM8MESQbyV7op4vwX1jvhYQqd6IdtmUYz8CGGWG pwgw== X-Forwarded-Encrypted: i=1; AHgh+Rq3Rpp+Nuq3XU1SLxTRcMlU68Img4eChUAyuLsFVbAy0sfBCJ1zQJMnC/zIgXhlw65QJOJo9hvPw64dsrY=@vger.kernel.org X-Gm-Message-State: AOJu0YyRtN9fxWFnboSEx0liwBJvjHy5igImyxJk1GjxXgjEFkLhyaLZ zfr2k3FNnLQTeAzdCNSj6SunSU+gLEOVlrySHLfUw+sZP+Zk4EFtCt6ZAszjFMkjsXRPGurbkeP woECVkHuWS0SGr6ufb0hRXveXRCWR+BpgfT4vaBPZEdjazSZ/8FCQ94+mzExib7NAKu9gHoJfRT wjzg== X-Gm-Gg: AR+sD12QhPilK3yvwtFPTqwSGV4YXXs3KvJkbRnENCf6KDLdTv2Hz/QSPWlnfxHUY4S coeZaPy414AdACXJbUQm7dUJoQ4JeiCTGvTrK/MAyJQrH3qRW0Qnciy6K7DDtTABnM6r1gPiJjs I+m6cBZqG6VmbbHVfWuziJmpN/ApOgMdEVweRUqydfREOt9xO/IDcCu6fmdjSCaMq+ndMrDuPWr 4md+63+ubXQ0tlVd2+oMxvp0wml5iQfl9m1yFqlsPCA+sTJ1jvwEb5ahoDVXxG3tF9N2qvGIi3y JDDhY/C2MEBlchtAask4nGfEtNxjgeRlOvAwWGltnHUJsa6PHYzsFKgIcKnxfM5KWGHoh0lfo+h 7/j2XcWLO/PWVUyKwWmC9C8lmfrAl0sdqOghD7sc5MFBQnK8hifgNc4goZ3NR X-Received: by 2002:a17:90b:33c2:b0:38f:bbc:6a0f with SMTP id 98e67ed59e1d1-3933bd0c033mr12646168a91.1.1786800380703; Sat, 15 Aug 2026 06:26:20 -0700 (PDT) X-Received: by 2002:a17:90b:33c2:b0:38f:bbc:6a0f with SMTP id 98e67ed59e1d1-3933bd0c033mr12646140a91.1.1786800380243; Sat, 15 Aug 2026 06:26:20 -0700 (PDT) Received: from QCOM-aGQu4IUr3Y.qualcomm.com (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-141386a039asm19313374c88.0.2026.08.15.06.26.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Aug 2026 06:26:19 -0700 (PDT) From: Shawn Guo To: Bjorn Andersson Cc: Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bartosz Golaszewski , Mukesh Ojha , linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Shawn Guo Subject: [PATCH 8/8] remoteproc: qcom: pas: Add Nord ADSP1/2 support Date: Sat, 15 Aug 2026 21:25:41 +0800 Message-ID: <20260815132541.1575121-9-shengchao.guo@oss.qualcomm.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> References: <20260815132541.1575121-1-shengchao.guo@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-Spam-Info: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfX2+vvjBrRIiSd yXxyc6XlZX5l6zQQBQmFwtjHNWRGyveqcl8oKrQY2t4TckmusCARxt51MskChauT01P/hN+D/43 uHykg2D7549weJ8eCBBfXeLCDqPAMno= X-Proofpoint-ORIG-GUID: fMQsx1J66tUiu3Eia9yDSjQzsb65vDTQ X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE1MDA5NiBTYWx0ZWRfXzI5ye/l2RkTY AVJodu2wG39uGFEXAa2xRsXHjrJcpp1FKo5u3JYpuVkdhb3p/rXodsLgo0LKs0D6KRbVoQ0WIFZ ulaIUr3iRjnadgXJZRtCfAN1ShTrV/S9Y2Aox7SIUo+XTMJLHiSh33Sd54Pt6r0WS03O4dQKvyw wdY0DY1dxJXyVKoyGPlwG6IlKPkROt1hCZyBWTP16UDz4kkJNIM2dcvWUNvqXHJJbMl1laiShEm nEIRO8ZeWCYltEhoN0nSXwMEYX+MYIb1OZz7OA3kIVdSsnJhBPiSztRjN5iCohHBc1hHy5zIXxg kyh4qoFDgBgb0odtbxH8tqYvi5iQMWOZVPTox5JfJDmFIztz/mGxXHBFT0H+joW7IA+Xn4e47XQ 1PW1MaZxguHg1TNRq8j1ObypdAK3u/yoB2a+apsabCmr7xjLLmgnCzTmZs354UVAcci31ZQ9nZQ x8MMHn1MUQGs0Mjha8Q== X-Proofpoint-GUID: fMQsx1J66tUiu3Eia9yDSjQzsb65vDTQ X-Authority-Analysis: v=2.4 cv=I/dVgtgg c=1 sm=1 tr=0 ts=6a8068fd cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=Y5oKQx0N-h3E-Ucf2xsA:9 a=bFCP_H2QrGi7Okbo017w:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-15_04,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 malwarescore=0 adultscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608150096 Content-Type: text/plain; charset="utf-8" Add support for additional Hexagon ADSP cores on Nord (adsp1/adsp2), which sit alongside the existing adsp0 as HPASS cluster members. Signed-off-by: Shawn Guo --- drivers/remoteproc/qcom_q6v5_pas.c | 44 ++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q= 6v5_pas.c index 0cf0a31f1f1d..96e2a7c74927 100644 --- a/drivers/remoteproc/qcom_q6v5_pas.c +++ b/drivers/remoteproc/qcom_q6v5_pas.c @@ -1937,6 +1937,48 @@ static const struct qcom_pas_data nord_adsp_resource= =3D { .smem_host_id =3D 2, }; =20 +static const struct qcom_pas_data nord_adsp1_resource =3D { + .crash_reason_smem =3D 663, + .firmware_name =3D "adsp1.mbn", + .dtb_firmware_name =3D "adsp1_dtb.mbn", + .pas_id =3D 53, + .dtb_pas_id =3D 55, + .minidump_id =3D 21, + .auto_boot =3D true, + .early_boot =3D true, + .proxy_pd_names =3D (char*[]){ + "cx", + "mx", + NULL + }, + .load_state =3D "adsp1", + .ssr_name =3D "lpass1", + .sysmon_name =3D "adsp1", + .ssctl_id =3D 0x1d, + .smem_host_id =3D 66, +}; + +static const struct qcom_pas_data nord_adsp2_resource =3D { + .crash_reason_smem =3D 664, + .firmware_name =3D "adsp2.mbn", + .dtb_firmware_name =3D "adsp2_dtb.mbn", + .pas_id =3D 54, + .dtb_pas_id =3D 56, + .minidump_id =3D 22, + .auto_boot =3D true, + .early_boot =3D true, + .proxy_pd_names =3D (char*[]){ + "cx", + "mx", + NULL + }, + .load_state =3D "adsp2", + .ssr_name =3D "lpass2", + .sysmon_name =3D "adsp2", + .ssctl_id =3D 0x1e, + .smem_host_id =3D 130, +}; + static const struct qcom_pas_data nord_cdsp0_resource =3D { .crash_reason_smem =3D 601, .firmware_name =3D "cdsp.mbn", @@ -2316,6 +2358,8 @@ static const struct of_device_id qcom_pas_of_match[] = =3D { { .compatible =3D "qcom,msm8998-adsp-pas", .data =3D &msm8996_adsp_resour= ce }, { .compatible =3D "qcom,msm8998-slpi-pas", .data =3D &msm8996_slpi_resour= ce_init }, { .compatible =3D "qcom,nord-adsp-pas", .data =3D &nord_adsp_resource }, + { .compatible =3D "qcom,nord-adsp1-pas", .data =3D &nord_adsp1_resource }, + { .compatible =3D "qcom,nord-adsp2-pas", .data =3D &nord_adsp2_resource }, { .compatible =3D "qcom,nord-cdsp0-pas", .data =3D &nord_cdsp0_resource }, { .compatible =3D "qcom,nord-cdsp1-pas", .data =3D &nord_cdsp1_resource }, { .compatible =3D "qcom,nord-cdsp2-pas", .data =3D &nord_cdsp2_resource }, --=20 2.43.0