From nobody Mon May 25 03:33:27 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 C38123CDBBF for ; Tue, 19 May 2026 07:20:11 +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=1779175213; cv=none; b=tQEBObkNQEniILZElcFp4Wp2pRxDhSIybeHGn6VOhe+V/v6hPGCiIKygNV+3TjyrbeIJYPAut1tr0XbCW++p0qfNPowv9JWzbin8xE49jAsVdEVufit3MY+ZzowvdcBxUDpP8F7cLc9/vlBfrmLoKbz7pHJwyAZwtrwrSqRRrq8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779175213; c=relaxed/simple; bh=5/YYTLp1zAR4H3spzhY8pV6SUs8HH6oSJSjbicSvo6s=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UcXeVC2+JXa5UxoK/9tLXfABMquovUDit+NSvIZvVKzQvWKkBB4LjMtkesuKbwa59td/lDQqodMee6tv/t5+tI7Lgz3wb2v1PrXwGyE3WQSg2+rS2clRP0Blb2HPTMxctSA8ci/jctWcXuc+uJwFgBoYg6l/QARaJ3oACWqVOrQ= 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=mbTe3uNa; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=bITmxeyV; 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="mbTe3uNa"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="bITmxeyV" 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 64J5aBPe867066 for ; Tue, 19 May 2026 07:20:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 21K8Mc/xhIM1en5LPTDDB47G9k6kQVJxaoQeABOBpdo=; b=mbTe3uNasYNaDbAy OVoWHJcC++oGkcW7eEUtnPmVrJJDvxJZxtfKHc5kXf3pwcT3KxuRwZDhBFf7tbvX 9RYZ9/pzjqMmXJxTZTozJUthmjaqpcOFLR3g66e9QScBVMnYcOScGF4hZtosYPUw 7j8JC9lQ6cj7tqm7dMwkdKXi9Cvfes8lLHd1DnuBIJEd3ow75tNKyZgcOtfEPsKc 6Vr80mHhrRp/kZmi3vgtqX9niRcJRASauqTOCwPKall9HgwNX7dbvwdMG/i5fgGD jGhMvEMfGe7wFpU3ShGkM97u12daqYe7saqZfHknvT78G2h1upO+tnsn5rxiMk+y 64XoDw== 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 4e8hv1gdxa-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 19 May 2026 07:20:10 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-2c16233ee11so4400934eec.1 for ; Tue, 19 May 2026 00:20:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779175209; x=1779780009; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=21K8Mc/xhIM1en5LPTDDB47G9k6kQVJxaoQeABOBpdo=; b=bITmxeyVC2HXI6JtAeaqLkRilEco/zszBlzDaVI0/E6VmHF5y+9CDQdWm18ZUvxFUV QxDTufLoNtl8gOYa8ED3+5Ug+5bFjm48T/eqZf23c4MhLLRjwaWmRNjhRFOBa0kvsDsP xp34hA0BaYwIisqByJLUR9efa9YPFnTznsXMT8oVhPrs3EURltodgB/p1FkNhUraEd/M DSuMlruNLkymjLvEdEFExVEfgvHBc18Fw10UM/YJaUF7GzoYOr3qZHXqlB4/KAEpCiD9 iT0WkwsJkDtS91PAE5mRouiUtZGHZ25LPXCJNN2SNQm7zhWFY0FKbi91KKQru44HSqXE I1Ng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779175209; x=1779780009; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=21K8Mc/xhIM1en5LPTDDB47G9k6kQVJxaoQeABOBpdo=; b=tX2b4W6ViwcA8R4HHhf1/qGQ0OdPwD2LIGUu2WS+czSh9/ll1mRoH1iKokxgpzTXzy 1ehBmHJK10XpOx1NfwAvvxEnT/WPKwhDIGt11ID/lgta1r5Nzt//jboAKveJKDvANTRN yA90gEzQCQmPwYDmp49QQHH4fE24MZyEx1pxLciGmO2/s8H5yx1N046FIMNFrHDLZ1Wk BGqWKvF3UiKiSE/quKxkBQS0XGpXXbafXoEm2k23QvhkUgZC5ci6IXsC1QthbCBbZ18Q czROFIAt5djf0L9prgdt6yK023R/dBnWfpN559eIemmnAPZHDdUwA+C8sjo93X/fkcXo k9NA== X-Forwarded-Encrypted: i=1; AFNElJ/YdicaLPWzQcBxvEkXxc6SmnDvt31fNGTj4tnKSDWgLe9Hj2uwbM4uDPJXlOJcS24Bf10m0YN2N88lPNg=@vger.kernel.org X-Gm-Message-State: AOJu0YxKdmGKnQh4FfikqCUdfb7E4XXqU8DXfd+mgi45m8BV/SQX1cQ/ YxLSB74egDKzcBrnEKhasWKx7t8M8kShamUuEHyjadOOf3ki+isvvc3L+x+nt+8ouegnfHLigc+ ZtTcTIc45hPcdWaN8GnnwtKLHLowR4f5XQIH6cxF00GJVrPtzOglAoNLHkcKwlYcMIRpbVUMg2r VCzw== X-Gm-Gg: Acq92OEHtSCOcrut8Pqezq/KrNFZ+Hz544OoTsR1/zJRwir+U6wTJx5PdoN4pxR2gP/ gmGu4Q+Ew3XcwxihmoqjNnyreEnL9T4gwP1Qt2N0IHfP9mpiSY5wDikxbYxdPQg1ZZeCTbCVuSE YyKC0IsAzvce0Pwx5KR1lTL5ytsSqZXI0TCCJzWAa1Qp4mjQlferiEFiebUsP5VcIBAR9cQ/1nx Rk4KuLaG7R3tA5yukE93/2Sruu2g7d9Lpqki561mrDBHFOZb43LPRGAAq2ygG0y2LBQu+GpeKSF b4oDjkgIOyoZDKj+1miRQl5rb8m41SfisIcqqYzuKTxQsKdBcAECtJh9KE/oWCJQ2Li9rLt1EyN TUOXdCdGDRBMK7I2BH4B6aV9k1t2SeK+WMdyfOm7O98QC8OKgYMc1twyAi0w084gMZUhyJJYo X-Received: by 2002:a05:7300:a94b:b0:2ed:a64:a457 with SMTP id 5a478bee46e88-303986552f6mr7933044eec.20.1779175209418; Tue, 19 May 2026 00:20:09 -0700 (PDT) X-Received: by 2002:a05:7300:a94b:b0:2ed:a64:a457 with SMTP id 5a478bee46e88-303986552f6mr7933024eec.20.1779175208899; Tue, 19 May 2026 00:20:08 -0700 (PDT) Received: from hu-jingyw-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-302973bcd0csm16438595eec.24.2026.05.19.00.20.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 00:20:08 -0700 (PDT) From: Jingyi Wang Date: Tue, 19 May 2026 00:20:02 -0700 Subject: [PATCH v2 1/3] remoteproc: core: Attach rproc asynchronously in rproc_add() path via schedule_work() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260519-rproc-attach-issue-v2-1-caa1eaf75081@oss.qualcomm.com> References: <20260519-rproc-attach-issue-v2-0-caa1eaf75081@oss.qualcomm.com> In-Reply-To: <20260519-rproc-attach-issue-v2-0-caa1eaf75081@oss.qualcomm.com> To: Bjorn Andersson , Mathieu Poirier Cc: aiqun.yu@oss.qualcomm.com, tingwei.zhang@oss.qualcomm.com, trilok.soni@oss.qualcomm.com, yijie.yang@oss.qualcomm.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Jingyi Wang X-Mailer: b4 0.15-dev-3d134 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779175207; l=3261; i=jingyi.wang@oss.qualcomm.com; s=20250911; h=from:subject:message-id; bh=5/YYTLp1zAR4H3spzhY8pV6SUs8HH6oSJSjbicSvo6s=; b=OLWN+lF0gBUyIbfvyYuyLukLJgISeBoSG+ePG46Mit2Dh7hW+NnhebTUjgHbqXbKIsEJFA2y4 DQU25JliA+oDU0riUjW4+rSP2YQBUUnPwVhiiLEt7S3I0QZ+fCex/vS X-Developer-Key: i=jingyi.wang@oss.qualcomm.com; a=ed25519; pk=PSoHZ6KbUss3IW8FPRVMHMK0Jkkr/jV347mBYJO3iLo= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTE5MDA3MCBTYWx0ZWRfXyUnxfEa59qf5 6cL2CT6/B9379Jd7Yg8j8kDc9RRT9GzyRUzhKouK5q8Xop2EDkEkG3TcumR7eR8eqHtMl0oP/bt vaftRQjTEBKJ9QchaJoFv5WH1L3hwIbhrU13elA/gWElihtkU6Qau/tg4gySfZTQitP1CLULSRM SGJqKRAl3spE6FM+LpgMRIw1mwLLujYGtU+KVfdFv5pZ0B8SzlbGElTzip4EHF4IrYdNi5LLbgB TL7S8JFaM0+xAeLrmUNamsYyNvcnNUYjUqYeAk86MLTnOYWeqwjbqSGVwAqxO9y0LDyPvfzaf8f EO5ttJY3qHni5cfy2y9y6XMWN7QACSQxo1VfYgvyqRlUqhXeS/ELOZGH1jm2PeQ4H8A84C6rbOU Ok8eVCFRh/JHT9m45jRtFtjFWJ7C+IdFWq4WIdXmz9cg5lTKkCSvRD0+MCfPbAGbcKf3qCm3fS+ to38YlkRYD99khw4GRA== X-Proofpoint-GUID: P0O0KW0K-7ABOODDDFipwNhxwpWMmvzv X-Proofpoint-ORIG-GUID: P0O0KW0K-7ABOODDDFipwNhxwpWMmvzv X-Authority-Analysis: v=2.4 cv=WZM8rUhX c=1 sm=1 tr=0 ts=6a0c0f2a cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=SwIuEO_x4BL_LcR9stwA:9 a=QEXdDO2ut3YA:10 a=PxkB5W3o20Ba91AHUih5:22 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-19_02,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 phishscore=0 spamscore=0 impostorscore=0 adultscore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605190070 Unlike the remoteproc firmware load path where rproc_add() call rproc_auto_boot_callback() asynchronously and ignores the return value of rproc_boot(), the attach path calls rproc_boot() synchronously and propagates its return value back to rproc_add(). This means a failure during rproc_attach() causes rproc_add() to fail and triggers resource release, removing the remoteproc from sysfs and making it unavailable for recovery or further boot attempts. Align the remoteproc attach path with the firmware load path by introducing attach_work and scheduling rproc_boot() asynchronously via schedule_work(). This keeps the remoteproc registered and available in sysfs even if the initial attach attempt fails, and avoids blocking rproc_add() on the attach result. Signed-off-by: Jingyi Wang --- drivers/remoteproc/remoteproc_core.c | 20 ++++++++++++-------- include/linux/remoteproc.h | 2 ++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remo= teproc_core.c index b087ed21858a..f02db1113fae 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1673,18 +1673,21 @@ static void rproc_auto_boot_callback(const struct f= irmware *fw, void *context) release_firmware(fw); } =20 +static void rproc_attach_work(struct work_struct *work) +{ + struct rproc *rproc =3D container_of(work, struct rproc, attach_work); + + rproc_boot(rproc); +} + static int rproc_trigger_auto_boot(struct rproc *rproc) { int ret; =20 - /* - * Since the remote processor is in a detached state, it has already - * been booted by another entity. As such there is no point in waiting - * for a firmware image to be loaded, we can simply initiate the process - * of attaching to it immediately. - */ - if (rproc->state =3D=3D RPROC_DETACHED) - return rproc_boot(rproc); + if (rproc->state =3D=3D RPROC_DETACHED) { + schedule_work(&rproc->attach_work); + return 0; + } =20 /* * We're initiating an asynchronous firmware loading, so we can @@ -2512,6 +2515,7 @@ struct rproc *rproc_alloc(struct device *dev, const c= har *name, INIT_LIST_HEAD(&rproc->dump_segments); =20 INIT_WORK(&rproc->crash_handler, rproc_crash_handler_work); + INIT_WORK(&rproc->attach_work, rproc_attach_work); =20 rproc->state =3D RPROC_OFFLINE; =20 diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index b4795698d8c2..580d324a1e8f 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -526,6 +526,7 @@ enum rproc_features { * @subdevs: list of subdevices, to following the running state * @notifyids: idr for dynamically assigning rproc-wide unique notify ids * @index: index of this rproc device + * @attach_work: workqueue for attaching rproc * @crash_handler: workqueue for handling a crash * @crash_cnt: crash counter * @recovery_disabled: flag that state if recovery was disabled @@ -568,6 +569,7 @@ struct rproc { struct list_head subdevs; struct idr notifyids; int index; + struct work_struct attach_work; struct work_struct crash_handler; unsigned int crash_cnt; bool recovery_disabled; --=20 2.34.1 From nobody Mon May 25 03:33:27 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 7814A3CF661 for ; Tue, 19 May 2026 07:20:12 +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=1779175214; cv=none; b=VynmceShFQXXApdz0MyFqn6dnbDJo72lrfP2qfierxrRhXz3A9lrxu8u+ri5jNySfojwV61n6V9pxBVt+thWGRki2cIn5BG3/d5ZanDC5XK1wxqjKdNuaPWyByRUnQzl93VAxbXxz4ldhfHTl2lBcXxO2m9FDA6Uh1NiHzJK+rc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779175214; c=relaxed/simple; bh=bscwrSlVpz4MNHSHLLAXg90Xfda+9OYWIvmhkgv3eb4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=NRlj4dPw+MyM9uRC4t50LrhW7BLoZug+t35hPCuaIdfruAenzCS/xARp51wf7fpA4/yLef9j51afvc+uc3/Q61rpXo9omWy2SWMlE8UsUPOrarXH2d3iInQHbrWPh1bRLFiqHIrAZAvoTWO6kyWeWsaXJXWMU0uOM8X5+8HGeBU= 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=CKAc4p9g; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=dFre4VJx; 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="CKAc4p9g"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="dFre4VJx" 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 64J5a7J6867004 for ; Tue, 19 May 2026 07:20:11 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= O1S35uCyDNCtXUX3buUrp0I7Z6/lE+g8Tviz/lzBaZw=; b=CKAc4p9gnBjwH9JL eORX2pCQ0AvZGNqBpWzoB2ngw3KUf4/xOpogpDuiwsC+e+iSA1nKkU8Ague2fxRf YhCmoEsCG06bo4IC5lqhQJsef2Vr2+RQx8xva11EFiKwZx6o6iRVBkhDbC0MKjCy 4W3FopKzqH74Ueaj96YQUOGUNWF38GNBDqzcMSBYNXN6zJM45GHVI5812YadE7zZ Y1XWiNgVhQiqZGjsXxSROKHIdLSyAR08kPAfVAYjvggxSR7X9MSPvpTab/syGz8L HOV3iRoOuQxI9epLCV03dOcXHgPrm5S1SMk84ekKmjkAAHDKSFQwEDXWJkLOlEmi UW5ZQg== Received: from mail-dy1-f198.google.com (mail-dy1-f198.google.com [74.125.82.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e8hv1gdxd-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 19 May 2026 07:20:11 +0000 (GMT) Received: by mail-dy1-f198.google.com with SMTP id 5a478bee46e88-2ee34588671so3722649eec.0 for ; Tue, 19 May 2026 00:20:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779175210; x=1779780010; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=O1S35uCyDNCtXUX3buUrp0I7Z6/lE+g8Tviz/lzBaZw=; b=dFre4VJxzpzWEUNsIEY6NS3zWugL3ML1voTbbeKdHJtSlm6ymvIrMZeOqN5K8NdP0o 3L/1vGg8HmRTfFg5iPstpy2KpHS+EivdTkUMBihtJBoy360HyvFaLbt8JecA5PPSd35Y 9cjrEWwdDHqo0InonzpykuWCPgsDKqvLPW3iptnU6Qp0Rfe12Aw8SORzl+7XDizl/Y9D tYud9qVGvj3I1k/CY0EREOKykGDKXzfZYz+oNBac5Lip5xTlD1NCuUWNXBgLk6CycpMn j5QiGm9ofyyamz+1RbNvb7Ce30KISM4yVMw1c7CGwX2iSG4J+XfVfbJUqT+bvW6pBu8d ZHGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779175210; x=1779780010; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=O1S35uCyDNCtXUX3buUrp0I7Z6/lE+g8Tviz/lzBaZw=; b=NFhSGbv2wK82NYNyLGnBuXkYuuHk29Iv0+YfJgA5BB+TwQJ5OW61S2I0OtmsRDIjod mltq0xlmOeRh4P0RBnJ6lITPkjNqfla0jsehZD7q5pk3hw/SgFIGcjz1cSLAwHv7dut/ n1JdRy0zbab6osiL+Cvfd4FC8QsHNn7T8/inXoeRlXw60p2P7pcvkp2v4yxoQUR/hMXp RZX9yDvTmqcgmG+cWK6lhBM4Pr810ZmVcSFIIa+NANW/s6BifrlXpj061tJvtPBWKgTQ NbIiP3llDbJc1WHi2AaAO7ejpdmyo/Xatq3eUH3bEpqBStXDV9mRZLNqAyiWEr8Vf+c2 dx4Q== X-Forwarded-Encrypted: i=1; AFNElJ+SN/E13FZ6ji9shr72D5OHc9EmCEJ9E7iFr4bOwGTswjdSbqxUP5V7rxI7akiGIAKgcD3SCWOhl25zrrk=@vger.kernel.org X-Gm-Message-State: AOJu0YyHQ+0CVsbIIJFFmZNk1IIL+LCi5tyXqSlVHpZRyZVInKdfkHjA oSVz+ns7vPUiA+xpFkmpVy/WSnO4vbaIxhfE65vcGjdtemUx5i+soSylq9cbK+OgoEC8VIN/ykS lgh3ijwNev7xnXFfj71eH8SPFQsDp4YOQ/2wz3aGsgJUBc4r5IeP2CT96quKtWut78x8OgbdT/f XkUQ== X-Gm-Gg: Acq92OFPSp1FuHsR0se+EHfdgeOjnWcud0ITGyvhAkNqzc8QCWofJN5Sp9zyd5rYqu/ 2e7R0+BeGafk44vtd4ZKQxbRRomUPyezjpwLgNFcYhD0GxTy4exF9ewUPm0l4EiyhUwLOErydFQ r3ANdpRBETH3UZbyqZgNzG27Zj6xERZ6oB/Nf+cizb54s87o8gYKjZeo5iufiqNjAnph9H97qpJ jb37F6PaQSDTqgbsoCdYCjjL3gUvrGT5L/xucGEc6m5gKjBdjqg7/stQJpnXZGrR+d7zOEYw1nZ JXze0BuLxbSP6Y2FAd6GTWlcZbYcyv/FlsdnMm5wrL1tXXxWVAzzos2eSvb0hwk4fveIa654R9e UQKQx3SQeUb/H1joxBW0hsrVTarXmhnbqfDk2O2EqA5C/Yz4HcwVnSeTe9JHCWnCtxDLtr+5f X-Received: by 2002:a05:7300:b2a5:b0:303:a1af:5042 with SMTP id 5a478bee46e88-303a1af60eamr5200987eec.0.1779175210292; Tue, 19 May 2026 00:20:10 -0700 (PDT) X-Received: by 2002:a05:7300:b2a5:b0:303:a1af:5042 with SMTP id 5a478bee46e88-303a1af60eamr5200970eec.0.1779175209709; Tue, 19 May 2026 00:20:09 -0700 (PDT) Received: from hu-jingyw-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-302973bcd0csm16438595eec.24.2026.05.19.00.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 00:20:09 -0700 (PDT) From: Jingyi Wang Date: Tue, 19 May 2026 00:20:03 -0700 Subject: [PATCH v2 2/3] remoteproc: core: Check subdev start status in rproc_stop() 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260519-rproc-attach-issue-v2-2-caa1eaf75081@oss.qualcomm.com> References: <20260519-rproc-attach-issue-v2-0-caa1eaf75081@oss.qualcomm.com> In-Reply-To: <20260519-rproc-attach-issue-v2-0-caa1eaf75081@oss.qualcomm.com> To: Bjorn Andersson , Mathieu Poirier Cc: aiqun.yu@oss.qualcomm.com, tingwei.zhang@oss.qualcomm.com, trilok.soni@oss.qualcomm.com, yijie.yang@oss.qualcomm.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Jingyi Wang X-Mailer: b4 0.15-dev-3d134 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779175207; l=3054; i=jingyi.wang@oss.qualcomm.com; s=20250911; h=from:subject:message-id; bh=bscwrSlVpz4MNHSHLLAXg90Xfda+9OYWIvmhkgv3eb4=; b=7a/JGryUVN0w5oetGmN7yC2k9A+joMOvHT2gMeXi/YqWlK0e5Hf35yZ2O4vXLQq1SvHX+5OA+ vCvF8R6Yt5/DhH+FRCVplqk93xQ3qu3orBx+EXxTprF+xn6i7+xvyM+ X-Developer-Key: i=jingyi.wang@oss.qualcomm.com; a=ed25519; pk=PSoHZ6KbUss3IW8FPRVMHMK0Jkkr/jV347mBYJO3iLo= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTE5MDA3MCBTYWx0ZWRfX+4WpT9f8x/pz 9SkpWWtqFzspmTUpLsr4Z3dJ/D4dl/pacGnp04Nu0ijml90wdFIPih9FPCNkJIIm/4Sjx6h9RLy PD670QFxVqQ7WCc4MTLi1EGyHrhQ5JpAbupttGZn0maknMEAeR9trTlrIuA7heEcmTrI8Pn7Y9r Sj8KVyeGFYcmKRyW9s/9ZGJxn0YJ9zqXJbPYApMcOVmSY+MEjSPN0GVN1Ou22jFy/i0MethHzGw 09U1Nx5Si5p/s3ekWtQScBPYCwQJ3iPk1aYVbvjuxAMjzJ3rnLxOA0qe0xiREMmQ2e/LTrJldtK p6iNCvyBC+oaiXUTvwGrHXNMVgjshP8gIe7ntQhj98yNaPI++ZCndVMeXpCD9kROMFiNrRhm0ER mX1z99Cww/sibXUsp4oZ456O5y0QuoMR7fZt7DeR/tINlCax4b60x+QK6Oz/rqFrP9ds2W0lzk6 IP9Jd9EepZu3heFeIVg== X-Proofpoint-GUID: L2D-0nHzwgKjeE746S-BxA1xHVuHbxlr X-Proofpoint-ORIG-GUID: L2D-0nHzwgKjeE746S-BxA1xHVuHbxlr X-Authority-Analysis: v=2.4 cv=WZM8rUhX c=1 sm=1 tr=0 ts=6a0c0f2b cx=c_pps a=wEP8DlPgTf/vqF+yE6f9lg==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=yx91gb_oNiZeI1HMLzn7:22 a=EUspDBNiAAAA:8 a=9H_D3iXqDRE50K2jjPsA:9 a=QEXdDO2ut3YA:10 a=bBxd6f-gb0O0v-kibOvt:22 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-19_02,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 priorityscore=1501 phishscore=0 spamscore=0 impostorscore=0 adultscore=0 bulkscore=0 clxscore=1015 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605190070 For rproc that doing attach, rproc_start_subdevices() is called only when attach successfully. If rproc_report_crash() is called in the attach function, rproc_boot_recovery()->rproc_stop()->rproc_stop_subdevices()-> glink_subdev_stop() could be called and cause NULL pointer dereference: Unable to handle kernel NULL pointer dereference at virtual address 000000= 0000000300 Mem abort info: ... pc : qcom_glink_smem_unregister+0x14/0x48 [qcom_glink_smem] lr : glink_subdev_stop+0x1c/0x30 [qcom_common] ... Call trace: qcom_glink_smem_unregister+0x14/0x48 [qcom_glink_smem] (P) glink_subdev_stop+0x1c/0x30 [qcom_common] rproc_stop+0x58/0x17c rproc_trigger_recovery+0xb0/0x150 rproc_crash_handler_work+0xa4/0xc4 process_scheduled_works+0x18c/0x2d8 worker_thread+0x144/0x280 kthread+0x124/0x138 ret_from_fork+0x10/0x20 Code: a9be7bfd 910003fd a90153f3 aa0003f3 (b9430000) ---[ end trace 0000000000000000 ]--- Introduce "subdevs_started" flag to indicate rproc_start_subdevices() has been called successfully. Ensure subdevices are only stopped if they have been started. Signed-off-by: Jingyi Wang --- drivers/remoteproc/remoteproc_core.c | 4 +++- include/linux/remoteproc.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remo= teproc_core.c index f02db1113fae..6e23cb11e515 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1308,6 +1308,7 @@ static int rproc_start(struct rproc *rproc, const str= uct firmware *fw) goto stop_rproc; } =20 + rproc->subdevs_started =3D true; rproc->state =3D RPROC_RUNNING; =20 dev_info(dev, "remote processor %s is now up\n", rproc->name); @@ -1712,7 +1713,8 @@ static int rproc_stop(struct rproc *rproc, bool crash= ed) return -EINVAL; =20 /* Stop any subdevices for the remote processor */ - rproc_stop_subdevices(rproc, crashed); + if (rproc->subdevs_started) + rproc_stop_subdevices(rproc, crashed); =20 /* the installed resource table is no longer accessible */ ret =3D rproc_reset_rsc_table_on_stop(rproc); diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 580d324a1e8f..bc6adbd23827 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -539,6 +539,7 @@ enum rproc_features { * @has_iommu: flag to indicate if remote processor is behind an MMU * @auto_boot: flag to indicate if remote processor should be auto-started * @sysfs_read_only: flag to make remoteproc sysfs files read only + * @subdevs_started: flag to indicate if subdevs have started * @dump_segments: list of segments in the firmware * @nb_vdev: number of vdev currently handled by rproc * @elf_class: firmware ELF class @@ -581,6 +582,7 @@ struct rproc { bool has_iommu; bool auto_boot; bool sysfs_read_only; + bool subdevs_started; struct list_head dump_segments; int nb_vdev; u8 elf_class; --=20 2.34.1 From nobody Mon May 25 03:33:27 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 99C823CF698 for ; Tue, 19 May 2026 07:20:13 +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=1779175214; cv=none; b=rCq7JF4RtPGSN/bG7DEcndSC43JuJ5LPCQj6UXirQexHeOo4bH4ImwrIg41lcbOmaDlMy8KoqaQQzFoUdzAv/spjxqOVXGhSHn0KOhnoAiDDs4qT1qiK6H9heY/a1GbDHLaVYKnGzUyMjtfIYgoWz5cqVcOaDjIWHL4hOhe1BbQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779175214; c=relaxed/simple; bh=15K5IP1vUFgQ5ahLz1o6QIvx9EGIvH4eeubXmdEOEjc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=YqRvXuY3h3EPQhlGi49FSq0VOCjqIxK2JiIkLUgu5W7jcYXOYBK1MGrJ+SVijAhIR/XRZLBIz/JpZWywE42qN2E2NrGHpKsr/pDPmhsHV5icZ+Xc7TNKUl8mdBObJxbRNY8SxzmrECWkN3FdR6dDSa3YlmV5kOTv3imPYVpb0Rw= 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=NDZTYHiw; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=aMXEPoGy; 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="NDZTYHiw"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="aMXEPoGy" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64J75srY352983 for ; Tue, 19 May 2026 07:20:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 181vtMHDizQN14Sm20ahawzl/5RDy+3nFLNw102hucc=; b=NDZTYHiwpj6J/gA0 WIIIBDpPK1iJujHaySfZEq3pTE4hy5D9QRTEadIS/Eqw15ZFB2WVRCeEChKJnsPh JIDe4pQ93Ny+mcLs0mTC3ERqUpJdML3/TGY+8jcIpdNkPkrIb+VfDbaeZSfNzR+B Z/tbHdWaEXcCaaFpF8T2eNcm5xKuihuhHrIU9obh9z5BznpwpLjCbd93JTQm6+VV 3MD/ankY4D3UyGKYN8bazCxcaGUbniHu/i8quiMstAw+A4R2Hi1vb+t3i/jYc/1M /k8nqQ73A2bktT8Noz/ZP6rVutRllh7lvszYkHyAbFU5YOQe2x30Kh+KqgDkK+We HQnFwQ== Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e7xjamw2t-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 19 May 2026 07:20:12 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-2bdd327d970so1609171eec.1 for ; Tue, 19 May 2026 00:20:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779175211; x=1779780011; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=181vtMHDizQN14Sm20ahawzl/5RDy+3nFLNw102hucc=; b=aMXEPoGy84sR92S02DnSJv5zuonYbKmOG6SPpn+rt6y8NHjHXc+xE8kZdkAn7eVsVe rmhlt4tFIyjFU4FgT93qA26//P1deWP7aPnpbK89ii5CEMPFEefDvEefiBvYcqHj0arF oDKxB6MFdlDVZ+YXy2JbiVjEWm630vvGI/49GvgAFYVIg6aM+Lru4r9v+LZ1HJujVVgj emSN5wYefYmdl6z2SgXL16ll3pRN/XOi5tiEdYfDa4dwwXbtSaZ7XxQP+ENNIQuv9aMQ i0gl21CEL31/KoQ6j+Vawt2xs3S44tZpFxrLa9g5Cp5UFP/iSviO3CCtLM5fGASCMAnQ mhvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779175211; x=1779780011; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=181vtMHDizQN14Sm20ahawzl/5RDy+3nFLNw102hucc=; b=nxTS29dVKuOl6EukemjklLfO0wLHd/886aRL70GrsKE7ukCl8YSJLAzuKC60bgFwal ushbksrBpSCVtCK/mrwgXfjYJ1PmbIYB6atNkOJBSE16xSClnLR/69qWEop7GBkrqRX/ 1GzJCktIZtXTBHQ2il5cdaolhYmHAJX0lkuR32M+1ATYnb/yYfPAGBob2oL12MCpST0u +AbqHuHLSkUCGeOm2JY2Ra3t5LLkYpEMJjvwJnaEsPbyhSOutNrRpy9F6omerDwGVbxy 5yERH0u8VLlGdM8ZSOgEMsQIq0wNcMavH4T0QUO+rRhdJXnGW7guUuuEs5TITiIeSPNu o+kA== X-Forwarded-Encrypted: i=1; AFNElJ/3fvIvyBEL0guYjB+fR1UdP9wEriIvPZ6z289pb85toVawI3fipV/wObQzN7ZSmXNaHGAJohcxy0ea79c=@vger.kernel.org X-Gm-Message-State: AOJu0YxJOHzp2JUk6gknXH7rx0hz4QFeYTyTcQW3OvA5VMGl+udv74k3 MkRO4YF8QQdqGTBxQ1ZnQI4R/vVLy+FEaIWMV8tB0mwBZ+BprBJpaLKTXsWAV/ELgftXOQHLxR+ P23CWHdfPlTXuLxB7J4gr13umLK/pC6BLDoOSgbESUNmvjgS3LDJWOaTIhKPkSGbF8VuVxLHuB4 jJlw== X-Gm-Gg: Acq92OFthizUFgwUueReByrO903OXwfENmY20I0GFAhTjfvtK8jQ9/MemVd4kjirAzz uAEURd4aZuGH5ja98j/6em3I3hrx975BsVis2zPnLRZ4pD2AhYXzXMko3kn0LE5/K8kfPUM6aKX 7lr+FpxPJ5TR0sFhz+XoeVb2QwIBtD4vX4ibM6oqKreHEwc/87d74H3F2Ddhrw13skIDeK3Ls0Z 51CGBptin4BUSQH0z0OuErKFE5bhbgOlsYn49rOjMCHVb6Nf1sQU6UdSIfpIXVvqfPQIco3Auuv A/RtVySuVGQGbo7q0sky0j58vEKkl1dUegpu9z7Kcpz6e8xyRxE1Qr61WizfcBdrqKCdmujy9fh vuS7O3a10m5RtQ9gxPZiiqpygBzH7xiSm/SJN6OeUK0zcELhgWsDUldcjZkNRjn5Z+klGepEn X-Received: by 2002:a05:7300:a897:b0:2ed:a58c:942 with SMTP id 5a478bee46e88-303978ad90cmr7498110eec.8.1779175211310; Tue, 19 May 2026 00:20:11 -0700 (PDT) X-Received: by 2002:a05:7300:a897:b0:2ed:a58c:942 with SMTP id 5a478bee46e88-303978ad90cmr7498094eec.8.1779175210849; Tue, 19 May 2026 00:20:10 -0700 (PDT) Received: from hu-jingyw-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-302973bcd0csm16438595eec.24.2026.05.19.00.20.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 May 2026 00:20:10 -0700 (PDT) From: Jingyi Wang Date: Tue, 19 May 2026 00:20:04 -0700 Subject: [PATCH v2 3/3] remoteproc: core: cancel crash_handler work in rproc_add() error path 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="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260519-rproc-attach-issue-v2-3-caa1eaf75081@oss.qualcomm.com> References: <20260519-rproc-attach-issue-v2-0-caa1eaf75081@oss.qualcomm.com> In-Reply-To: <20260519-rproc-attach-issue-v2-0-caa1eaf75081@oss.qualcomm.com> To: Bjorn Andersson , Mathieu Poirier Cc: aiqun.yu@oss.qualcomm.com, tingwei.zhang@oss.qualcomm.com, trilok.soni@oss.qualcomm.com, yijie.yang@oss.qualcomm.com, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Jingyi Wang X-Mailer: b4 0.15-dev-3d134 X-Developer-Signature: v=1; a=ed25519-sha256; t=1779175207; l=703; i=jingyi.wang@oss.qualcomm.com; s=20250911; h=from:subject:message-id; bh=15K5IP1vUFgQ5ahLz1o6QIvx9EGIvH4eeubXmdEOEjc=; b=ObV/HZB+ATu9c6aifjNcY1ruOoBKe4q84+p52UJnIpBtDD4PFIFlf2u4BMa36ELP9qPJuBLtC 58MMCH9vtEaAvtaXvZiyrHtoUWswvIQrkooHxx5ZLfyiC4n8v8vhpDE X-Developer-Key: i=jingyi.wang@oss.qualcomm.com; a=ed25519; pk=PSoHZ6KbUss3IW8FPRVMHMK0Jkkr/jV347mBYJO3iLo= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTE5MDA3MCBTYWx0ZWRfX+C2h+mf8M8e9 aBsje0miEwlQcwieG2LPhOXuus4U/nOQ7cgrdavz4dskdgVFzGYYG4rxfubTEzi5k6cLTvgXI8G xSrcoNIKEtxaeOmpeOGS0TdEPYoZnQMtl3gcBVpU1DFL2M8K1QMQGQdFV55j9JcKXpiahVggZ2U V3ajZuZLj9yZs+Qh3cgeNq0h6PRUZ2znJu6w3a2FjLs1G0OK/97bArFItqirjVxxVGqXbF1DTQ8 MbwzppSKn8xI3D46x75Lqvlymvem1IWYGM8B6pIztCgo+2x3oQNKRNgI+I+9EgNsmeTU+F9Ai4A v/E7DwTvy4n9+En67V01wFEAz6inAlcC/gmWnp/63ycaITJLjOQLW2b74UJzlfkFnO/PcJ6avqQ QP+msF/RR8pQp6qgDt/ieZK2sqOEH73s3ezsdcyQJMVOQg0IyUNnofnH4+x5gfKjaMb3eA0cQGa 9Qot0nnTxGjC4Qr6hxQ== X-Authority-Analysis: v=2.4 cv=BYHoFLt2 c=1 sm=1 tr=0 ts=6a0c0f2c cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=VRyQhUk9NtpfCekB4XAA:9 a=QEXdDO2ut3YA:10 a=zZCYzV9kfG8A:10 a=6Ab_bkdmUrQuMsNx7PHu:22 X-Proofpoint-ORIG-GUID: mhz0K2UN3CUc7wDP8GQTfIrQF-56-_UB X-Proofpoint-GUID: mhz0K2UN3CUc7wDP8GQTfIrQF-56-_UB 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-19_02,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 suspectscore=0 priorityscore=1501 bulkscore=0 spamscore=0 phishscore=0 clxscore=1015 impostorscore=0 malwarescore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605190070 Ensure crash_handler work is cancelled before tearing down rproc resources to avoid accessing freed memory. Signed-off-by: Jingyi Wang --- drivers/remoteproc/remoteproc_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remo= teproc_core.c index 6e23cb11e515..abaa3786731b 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -2327,6 +2327,7 @@ int rproc_add(struct rproc *rproc) return 0; =20 rproc_remove_dev: + cancel_work_sync(&rproc->crash_handler); rproc_delete_debug_dir(rproc); device_del(dev); rproc_remove_cdev: --=20 2.34.1