From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67EA74C9D for ; Fri, 30 Jan 2026 00:46:26 +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=1769733988; cv=none; b=BEBwydxI6mDdMh/F7K+xHQvRpfRyK4iC6W0ni8rleqIA7igOm9wjIeeXzr1qEpWutwj33Mni49WX5lCCsMGYcrhVbOev/8hm0q7nFx5i4YBocg/TwaqsCzhyAp73VHq0I7TObDrjZyPXv5LzU4gdXLr7i1mjT8c1U8IBkJZJheA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769733988; c=relaxed/simple; bh=oyyf9ltil4JNZwVDsmmKZ2dGCvGdvBIZLHRNhDRkcJs=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qKqG7bVaZSBgdKi2BCLYNlaC98JjTr3hDD4Lp3Gi4+/ONI6BwOqIZm777QSNtU3sX8XejD6463v/ZwQX4kKmWW5wq0xgaqOABG1dhTSGQZx3x192qvpMDsN1JBFD9XHeJogbtbA+kbKll7ivZVh/TDjecfj1vKnlPb1LKR3AjyU= 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=C+xshvHF; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=DqGZZwik; 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="C+xshvHF"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="DqGZZwik" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 60THo8uT3642541 for ; Fri, 30 Jan 2026 00:46:25 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=nTEddwWbBpyzhGVw7MJf2cPA VoFusYDp1MzoHCuEkZA=; b=C+xshvHFhdoxraRbFX6w53p9LdFOcwFv7XZxRmKJ ubzVKVUri9nEc2dX/u9m3DPxX76/9L55k+zjcRztQLhbUMPcob83HpcUgjDGVIEb ygKeKlPmyIumFfdoigEx/B2WKUfKe0oaU88J0VgbN6QfVxIUTLGyRIcPaw+CpTpM e4lMgMZLf7NyZFvZ2KvTlFQ2pMOBQ+9DKwo6uL7CKXfJGKDm/C7jBJG1kNVbpPT8 jfCSLUGOR7nfVRMBe+cTfWjnnqV0vqA9UahOCKMzk03vGuBTJn4LOl6MJHqsWn5z pkOCbCDnn3KIh25rlj77N7qXIevm55TuxSp/ppUdWJAyBA== Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4c05sr2k5p-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 30 Jan 2026 00:46:25 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-2b7a28264c1so2631172eec.0 for ; Thu, 29 Jan 2026 16:46:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1769733982; x=1770338782; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=nTEddwWbBpyzhGVw7MJf2cPAVoFusYDp1MzoHCuEkZA=; b=DqGZZwikCXToFmMxA8TTq6EL0zwjoQm4Ecgi+c1CK22o+ZfzNM3FtcXhLYmGMND5e8 Vg53cTEcuY4X184Bw/23LPUCEiAdHpGeaS+uEIbPJarH9ZnW9yKwr12kVvSyCLVZfh+m 9o3DvC562CIKwJD5r+oOapULfcr9ikgNoCGGmSYvdH22+2EWFHJImTVtE0hbENVseJKY J24EZlKM1a7MVBNjn1x7HM1fA6fJprqCyJBJjz2kB448xrkj6sx10BJY0gguKdn0YtkV Y2a4WHeDKaPeIVudtdHEyWn3p7MLvoVFsJWtv9G06xD2FuzWIVlLZSDYta0kHQH6l2C0 5zuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769733982; x=1770338782; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nTEddwWbBpyzhGVw7MJf2cPAVoFusYDp1MzoHCuEkZA=; b=VzcrRuDyN9q0qCqVRAF87O9Dm68HkKkvaQrs5Qbq0Jb4zcYJ9z0ylVOC0Ks9w60t35 CCy5o6+AjH56Dk/B+rsWfEXwXh7CJoeFjA70QMam3IRYEhp3Ov+r6Wd1EwqGWD0FFFCU k51MW3G+/ITzAYHMBVIKb2vmwhlhNVzSkyluaPg3KSbd3u+EzZsi4C4TTpUeSQOx+nqz 2XTrPrclzaWZOZri4wRpb+i6678gVHgqlyIJQF+Vk67OCxjHE4cttsaTNEhSep6hco0I GxK2DGlvSnZLUyBq2k2/Vwj4UE0UMtjoYGQTy4Y5E2SGaKpuIPD3nIFReIzAWazm7sfO AmMg== X-Forwarded-Encrypted: i=1; AJvYcCUaFWKMVEcvCPPVwadtW465db/lvKJ+GORKw3g9QqHtO8JljTOMb/++A+syuxB1pciTnKtSJtdDym+w3nE=@vger.kernel.org X-Gm-Message-State: AOJu0YyvRXzzRVZsmqmXUhfZbzCyBanvVRaCASHfjkJtkmKVs3kEkvet 6+H+FU8ZMW8+DwPgNoX0kiS5S7jtXXmyvKTVcD7QOxQNlCo2l6zYs2VAuLDmpZD2PC145nuwi3R 4EA9CWHfNQ7Kt+BVcpR885GWDolyVtcjoaaPe5+CFXOrsi2HIskkm7CpqCzoe5YvIAPw= X-Gm-Gg: AZuq6aLUVnHEdmzpeGT4rwaCAh0qkKqZlOmf9UxJgwlSiwk2gcRAWH8oDgLYh3oV61e aOn3uDN8+x52GPOlecPxiJ/m4+JJfs4NZ+aUJhKFiQMYNuPbvxjfQaBkpO4kxnxOrwwKghoGHV3 btU6rowQ/ybKPTKBUezcB2u4GgBEtnnGcX0TRD4zmxPE1fcW9vYF44MZ9RS0QhM7ZmEfigVAwCh wBEx19VxTsq5xaYE/vsX73dvgg+XXzGGK5jWBOkQvvMFPB/l9gOtw35nVBg8WroeOfDasXplhxr BUqWU9YBhLCHcMo8oEfKTsTNoQjJIE/sTtU951hb6Nkdscto0OYNhE/UfpMM8uOP7kbhCGO1lCW aojrjyUltM4vJ0MD5fYVzRK/LSFTMS/iaI86kfPwf2u821k78Yi1/bBpPNYpoDJo= X-Received: by 2002:a05:7300:bc11:b0:2b7:97b0:82b3 with SMTP id 5a478bee46e88-2b7c8632963mr511567eec.5.1769733982339; Thu, 29 Jan 2026 16:46:22 -0800 (PST) X-Received: by 2002:a05:7300:bc11:b0:2b7:97b0:82b3 with SMTP id 5a478bee46e88-2b7c8632963mr511551eec.5.1769733981756; Thu, 29 Jan 2026 16:46:21 -0800 (PST) Received: from hu-clew-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-2b7a16ec51csm9187299eec.10.2026.01.29.16.46.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Jan 2026 16:46:21 -0800 (PST) Date: Thu, 29 Jan 2026 16:46:19 -0800 From: Chris Lew To: Deepak Kumar Singh Cc: Konrad Dybcio , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, Chris Lew Subject: Re: [PATCH v3 1/2] soc: qcom: smp2p: Add irqchip state support Message-ID: References: <20260127-smp2pv2-v3-0-4060b859b1e2@oss.qualcomm.com> <20260127-smp2pv2-v3-1-4060b859b1e2@oss.qualcomm.com> <1395db8b-c31e-4c09-9b73-30c1e814d769@oss.qualcomm.com> <52d01bf9-2d73-4a7a-a734-2330bc426bd7@oss.qualcomm.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52d01bf9-2d73-4a7a-a734-2330bc426bd7@oss.qualcomm.com> X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTMwMDAwMyBTYWx0ZWRfXxAM7YeYp2OXY veRkZgppV1mRsNwIGhMRNANoro++ETTib7qB5QWGrFwUSgGioAH7Rxe5lCXnELbRVLsP5SWb2zR LuHiFOHYvNfLYhfPr+slodFvednwVP81X6JMdI5D8B4wtgwbg8LZH/E+WxFyxPxtmNA2MSPMZ28 Yxu3dC9nazDPbS/lUat/Ijveng6KIHxO9QaI1hkDLHmOlUgu3HqwI4X+Q2yy/0bIn6Wyt7jK7jw IMmuaKIUVlQuhQOUs0+WDLR29ytM/jgVOVfUD29zvo+rX30L4bfLxG0hqRsnH5UbYkP9lc9bVjk EQ1SYF8HDoLsowtNBh7jrrwE8A4AU1BJhDkKmcJW5iFwkhC6BwJLeZJ8a4ILgx44P/PwWrvftCo RBrY1y9g59+IKWBNOMSEHUJvO25hydpYfFxrIgFcpeqeSLOfEGbvgV3jhUdUNV8AP7t24h813Yp YSQZ/auGnUWHyjNLwEg== X-Proofpoint-ORIG-GUID: _z2Ns3SQZlia2XeHOUN1jY9q17M6VG3l X-Authority-Analysis: v=2.4 cv=UsJu9uwB c=1 sm=1 tr=0 ts=697bff61 cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=kj9zAlcOel0A:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=HqoV7rsciEZpOya5PewA:9 a=CjuIK1q_8ugA:10 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-GUID: _z2Ns3SQZlia2XeHOUN1jY9q17M6VG3l X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-01-29_03,2026-01-29_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 phishscore=0 clxscore=1015 spamscore=0 malwarescore=0 adultscore=0 priorityscore=1501 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2601300003 On Thu, Jan 29, 2026 at 04:26:38PM +0530, Deepak Kumar Singh wrote: > > On 1/27/2026 6:25 PM, Konrad Dybcio wrote: > > On 1/27/26 11:38 AM, Deepak Kumar Singh wrote: > > > From: Chris Lew > > > > > > A remoteproc booted during earlier boot stages such as UEFI or the > > > bootloader, may need to be attached to without restarting the remoteproc > > > hardware. To do this the remoteproc will need to check the ready and > > > handover states in smp2p without an interrupt notification. Create > > > qcom_smp2p_start_in() to initialize the shadow state without notifying > > > clients because these early events happened in the past. > > > > > > Add support for the .irq_get_irqchip_state callback so remoteproc can > > > read the current state of the fatal, ready and handover bits. > > > > > > Signed-off-by: Chris Lew > > > Signed-off-by: Deepak Kumar Singh > > > --- > > > drivers/soc/qcom/smp2p.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ > > > 1 file changed, 55 insertions(+) > > > > > > diff --git a/drivers/soc/qcom/smp2p.c b/drivers/soc/qcom/smp2p.c > > > index cb515c2340c1..c27ffb44b825 100644 > > > --- a/drivers/soc/qcom/smp2p.c > > > +++ b/drivers/soc/qcom/smp2p.c > > > @@ -222,6 +222,39 @@ static void qcom_smp2p_negotiate(struct qcom_smp2p *smp2p) > > > } > > > } > > > +static void qcom_smp2p_start_in(struct qcom_smp2p *smp2p) > > > +{ > > > + unsigned int smem_id = smp2p->smem_items[SMP2P_INBOUND]; > > > + unsigned int pid = smp2p->remote_pid; > > > + char buf[SMP2P_MAX_ENTRY_NAME]; > > > + struct smp2p_smem_item *in; > > > + struct smp2p_entry *entry; > > > + size_t size; > > > + int i; > > > + > > > + in = qcom_smem_get(pid, smem_id, &size); > > > + if (IS_ERR(in)) > > > + return; > > > + > > > + smp2p->in = in; > > > + > > > + /* Check if version is initialized by the remote. */ > > > + if (in->version == 0) > > > + return; > > > + > > > + for (i = smp2p->valid_entries; i < in->valid_entries; i++) { > > > + list_for_each_entry(entry, &smp2p->inbound, node) { > > > + memcpy(buf, in->entries[i].name, sizeof(buf)); > > Is there a reason for this copy at all? > I don't see a compelling reason. This code snippet is same as present in > qcom_smp2p_notify_in(). My understanding was that we do this copy because we don't want to do a strcmp on memory that the remote could change at any time. Maybe it's overkill but I thought it was considered good practice and as Deepak mentioned, it is similarly present in qcom_smp2p_notify_in(). > > [...] > > > > > + /* Check inbound entries in the case of early boot processor */ > > "in case a remote processor has already been started"? > This i can update in case new patch set is required. > > Konrad > >