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 303F73112BC for ; Wed, 20 May 2026 10:18:41 +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=1779272327; cv=none; b=D+jV2hfj7Mwg6iIm6BnooTgExad7/pGBN+8dYAlK3aUPgEZ7PoboeGIvDEMrkd18OoA/YKZKZwd61mlfpiy7Vc8dBZqi33Cq11k4pOEWfQrrhNbs6VKssGbfWHkgt0acicKi4qYevc36pkbhv0ug1FLWe6Hby9Y+Wnh9qZVh0Lk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779272327; c=relaxed/simple; bh=9GvTCEpKamo7Puzjy5EVV1bfnNMCGtFBMZiQDoyLqgE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QQJxtCuVkkXGhD6f5mTM/9Ab8rdQ9PvawzFH5ccgntiwbrQW2r9Xg0dmrzcegn08lYhmlWz1hOnKFeTD891ZOhTQpkhkxJC3OcP5+YHhq1mSZhrdw4cuNa0O954zRKgYma+J4a5KRSIecZ4uYT9ZaGw5fXmCXn0CzJIEYsjYuwg= 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=T5A5FBU8; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=ku1N3QbL; 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="T5A5FBU8"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="ku1N3QbL" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64K9lguU267045 for ; Wed, 20 May 2026 10:18:39 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=+k+oT4e6hBc5LIJSb/AfTwEM WHG0zOLB6Gqph0QfZLc=; b=T5A5FBU8B4Q49FYw6rsT+wuTQ1paFOGadPVRhIXk /I44B6NrnHNaxKO8yFIc2n1wxV/1tAfgq0BLZoOwssO+FBr2294U/r0rcjgCjWPH qSs28psZkfWx+V5KMxH1aB5icaQKhc0Wi5vTKnNk4iT+kxPFDSr5pEVt4gSvrbA1 D7Q0F61L9IJu30hwCYZ55/wFWJZf1jtsnyjWGQInP9v2TQchtGLqPnKmmglfHmZh mCPIyD3lXpioILVw1HmEcyNWXBL9PDMnMhjSW2e2IT8oPvedqy5F99X8C4xYzF6T dG6TQYwPk+CNhK+Yuj/ExUV0fv7f3QBuDB8JIh+O7aJ4ig== 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 4e9amxr3rb-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 20 May 2026 10:18:38 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-3041ab826ddso597663eec.0 for ; Wed, 20 May 2026 03:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779272318; x=1779877118; 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=+k+oT4e6hBc5LIJSb/AfTwEMWHG0zOLB6Gqph0QfZLc=; b=ku1N3QbLSrdyrL+/Pb3++SEhkOor2R3bg8JMZl9PmDcNsSaFd4rYgc3nvESeCHY/cU 0/vUNlv0PvB9oeRGEmnnxx2cCDocW3tifXazvFYc76fQCqCJq+2vVINAC8Mi720kaxH+ lXILxisaj4DFseLO5Ze8CMo/08UA8GVOW/4NUvd6x4IUR1QUCZaM7DORnI/t6P0F1TYJ ab2H8Kv+0/LapooyV3cm8d4Ikdyu5j0tIIMVzY2VR0pfCSnztuKz19vg0MfK6mg6HcP7 GxtBPAAyBINonjqqfKtB3598RxqvuRewPMV68OpJxYptUfigmE/WJRepOucK4CD4KqaP HSKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779272318; x=1779877118; 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=+k+oT4e6hBc5LIJSb/AfTwEMWHG0zOLB6Gqph0QfZLc=; b=W80tOg+8qpcSQJoib95gEA57Nt7jULmilI6Oz2V0PUwenZ3+yXBC2pwERpDIELTF8J kk/WUkrQGOHCl4Q7iX+mmbv5/sihqxVq0prjA1IWpQA/eex1/YisCMypVGzqpqx9biyI zMZ4aG5TLyD89WXaSCxdeUGoPMzifkhp66+Nhfa6KFcjpa0RZEb7KYgvrUtVR6H1oXnh 9V5irusjQP5AzhsmDbi3cZmVMalw/h9KKm4+MwdlltEczDwO/Ipid4KUmS3LhhQcBmQ3 X950v1gld3wuIHpgAcgbxczORz6Ix+5CUmqukHryojulMPjVSemrEUHSfRm0yffxuDek xxOA== X-Forwarded-Encrypted: i=1; AFNElJ9M8QrkgL2Gmn604mBDSTGDm/nD+t7Utess+9wfxTE3yBjgi8gZWK0HhZkY8cjgmiO1/eDZYkmqg/8F96k=@vger.kernel.org X-Gm-Message-State: AOJu0Yzl8LPjNaXti90DI7caRLFdUX46SzVvKB3RJDRJ1Njl4FVKoK4p q6k1N4TVcIZU1jba4RJXkcVLfOk5aaUUZT84NBeGAK6muipqz9M0q6rJRSk9DNICnsCGBgV9apQ vUyXsnRKE8g9aAt0Mt7k0aqXwoV/i+0E5LVU1cw2wcqFzDqov0tnZlfTLZ7eLkluAUNJM6y49FM OKug== X-Gm-Gg: Acq92OHpEPXVezlBzqREIRVEit8WOr4RQ0tWU9c+Xr90vItsGOu1UE0kJVsJVon25ke /3Y2kcYE6MnuVabRqN+hmfIcOe8sFLTk6vXhIQ99mI1FHJdzkoYEq0S4Y9xaN1GDS5bwryR+PqU n3prn5dkkzhd6IUyKR4VoYpCwI5g/XHFn48wzyeGu17XYlrIW5wWHvdAbVedi+pCOlU7g2t7edi PPXPFOJnRll3G6DBzs2lpX0BS8TjsLrbewRrk35/NeSrvT1UdeH+WFbsi2yavmTKOvgxAkYaQ/O x8Ezz6a3HMMX+/epUcSyNeLdtHtQ1gCH3U+7yv+8WE9pdl0V8wM9e1z9G4UVEZk9MyQlPlPYyJ5 92jQIBsKkohKkS/S5pd3LnU25gsp2t+D1BhHVy3ewkOUr8/jemESREWexxUcSmlat X-Received: by 2002:a05:7300:e430:b0:2c1:558c:16e1 with SMTP id 5a478bee46e88-303982865cfmr10691303eec.4.1779272317894; Wed, 20 May 2026 03:18:37 -0700 (PDT) X-Received: by 2002:a05:7300:e430:b0:2c1:558c:16e1 with SMTP id 5a478bee46e88-303982865cfmr10691266eec.4.1779272317278; Wed, 20 May 2026 03:18:37 -0700 (PDT) Received: from QCOM-aGQu4IUr3Y (i-global052.qualcomm.com. [199.106.103.52]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3041ab8282bsm1006139eec.31.2026.05.20.03.18.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 May 2026 03:18:36 -0700 (PDT) Date: Wed, 20 May 2026 18:18:29 +0800 From: Shawn Guo To: Mukesh Ojha Cc: Jingyi Wang , Bjorn Andersson , Mathieu Poirier , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Manivannan Sadhasivam , Luca Weiss , Bartosz Golaszewski , Sibi Sankar , Konrad Dybcio , aiqun.yu@oss.qualcomm.com, tingwei.zhang@oss.qualcomm.com, trilok.soni@oss.qualcomm.com, yijie.yang@oss.qualcomm.com, linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Gokul Krishna Krishnakumar Subject: Re: [PATCH v6 5/6] remoteproc: qcom: pas: Add late attach support for subsystems Message-ID: References: <20260519-knp-soccp-v6-0-cf5d0e194b5f@oss.qualcomm.com> <20260519-knp-soccp-v6-5-cf5d0e194b5f@oss.qualcomm.com> <20260520082747.7seyyua4gfv256ev@hu-mojha-hyd.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: <20260520082747.7seyyua4gfv256ev@hu-mojha-hyd.qualcomm.com> X-Proofpoint-GUID: doNxjFxxMKt6YRkuZ69ZumZDA89SW3Ct X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIwMDA5OCBTYWx0ZWRfXwjeOouYeEdxr hDTEqX65l2arywNF1Sn8yluoG8nQ5NwS6SVJdR8DwJii9IvLglEgV1GX98qi8HUK3fNlEV1DIUW nV/RbdpPUvJ9QVXxLSB62GKSkhgjlYAbH9RNRTAgvNPAl+717AzTWrYT0Lk4yb0PHK6tGsrC8hg 95Po1t68cga7zR0eA7nBxm87BA/1nO9n2LOqwddMPVnYCJ8vtYHm7x5scXkXjkuSyzOc1BZ0VZe agJugVQ5UhnVZU19oa5Kyq+YqqB/eKSkDl33l8ckED6xh+3sNLeFRo+4P3d3e9/iObD5uenvJs7 yzXHuDzp6GQNi3BqePGsEwxb/4QDtU4Tkr/2OZbB4aslUqlzNCHWy2zFf3IJrLu9RJONR9XYZBL 7eVQR8z4wCYh5ZMpiRmVj8Y9Ms4Qo31C1I7YxCaUaIfl1C1PGa4Luo+wkumvoZ+AVwDhiKmHswL 8rpggljeSAlirHhUIuQ== X-Authority-Analysis: v=2.4 cv=TO11jVla c=1 sm=1 tr=0 ts=6a0d8a7e cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=b9+bayejhc3NMeqCNyeLQQ==:17 a=kj9zAlcOel0A:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=aI_LCnMVjoIqU1kGItIA:9 a=CjuIK1q_8ugA:10 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-ORIG-GUID: doNxjFxxMKt6YRkuZ69ZumZDA89SW3Ct X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-20_02,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 suspectscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605200098 On Wed, May 20, 2026 at 01:57:47PM +0530, Mukesh Ojha wrote: > On Tue, May 19, 2026 at 12:24:23AM -0700, Jingyi Wang wrote: > > Subsystems can be brought out of reset by entities such as bootloaders. > > As the irq enablement could be later than subsystem bring up, the state > > of subsystem should be checked by reading SMP2P bits. > > > > A new qcom_pas_attach() function is introduced. if a crash state is > > detected for the subsystem, rproc_report_crash() is called. If the ready > > state is detected, it will be marked as "attached", otherwise it could > > be the early boot feature is not supported by other entities. In this > > case, the state will be marked as RPROC_OFFLINE so that the PAS driver > > can load the firmware and start the remoteproc. > > > > Co-developed-by: Gokul Krishna Krishnakumar > > Signed-off-by: Gokul Krishna Krishnakumar > > Signed-off-by: Jingyi Wang > > --- > > drivers/remoteproc/qcom_q6v5_pas.c | 58 ++++++++++++++++++++++++++++++++++++++ > > 1 file changed, 58 insertions(+) > > > > diff --git a/drivers/remoteproc/qcom_q6v5_pas.c b/drivers/remoteproc/qcom_q6v5_pas.c > > index da27d1d3c9da..ac2a00aacd2e 100644 > > --- a/drivers/remoteproc/qcom_q6v5_pas.c > > +++ b/drivers/remoteproc/qcom_q6v5_pas.c > > @@ -60,6 +60,7 @@ struct qcom_pas_data { > > int region_assign_count; > > bool region_assign_shared; > > int region_assign_vmid; > > + bool early_boot; > > }; > > > > struct qcom_pas { > > @@ -510,6 +511,57 @@ static unsigned long qcom_pas_panic(struct rproc *rproc) > > return qcom_q6v5_panic(&pas->q6v5); > > } > > > > +static int qcom_pas_attach(struct rproc *rproc) > > +{ > > + int ret; > > + struct qcom_pas *pas = rproc->priv; > > + bool ready_state; > > + bool crash_state; > > + > > + pas->q6v5.handover_issued = true; > > + enable_irq(pas->q6v5.handover_irq); > > + > > + pas->q6v5.running = true; > > + ret = irq_get_irqchip_state(pas->q6v5.fatal_irq, > > + IRQCHIP_STATE_LINE_LEVEL, &crash_state); > > + > > + if (ret) > > + goto disable_running; > > + > > + if (crash_state) { > > + dev_err(pas->dev, "Subsystem has crashed before driver probe\n"); > > + rproc_report_crash(rproc, RPROC_FATAL_ERROR); > > I am not sure if this is already discussed, but what if it is the first > crash with recovery and coredump enabled? What would be in the dump, > nothing? As there is no segment, is it expected since Linux did not load > this? > > This is even true if it is a crash after a successful attach. Good point, Mukesh! I guess we can have a check in qcom_pas_minidump() to do nothing in case state is RPROC_ATTACHED? Shawn