From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.54.127.151 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795385922; b=Ffr8HBynCnh4oGCRUG0ravaxWkeWRxODJtNcG03tn9M+J4QG4rk0+vKqq1BAb+BhIvDx HKTv2dSAtuCvadXJLSLZSPQ7kbnWrsT65glRzDOV2g4jjIvxNhGJhrQwYnCUxr+qJhBan PeFNIR97OjK62tH51dt8GBBTPJsGIA6GukbGvQdYRos9FoO27T7tq8sS1rjQpZGQoHKlS aQWHV6HviHhVJow23sPHj+CLlVTEqLVr1GF6nlSGdyOIFxcOiNUchYJjtrxv95Cz0sEim 2DTIk5zJlHoK6RheFZBTHEseNbFnTC3PBbjkHIzl1YAWaiAz/G3gra6Vrn+IaO50yWw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795385922; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding:X-Envelope-From; bh=k5LjoGaNZQ67mdl0htfbMa2Xp93tcUEF/ZOF14J2AHE=; b=23QgRSJr+zEyAtPYy6+Thu6F0rGkHsPEaToEx1veJXAVbnrN2E5Fd5uma7+R+Mzd9vA8 5LtILVUdAdEblyzRTvLU+KSYLqmCWkQlWYsL2e8vfj7ZBGCvmhKR1VdsCSJxRpkuou9C0 90r4pIkjtgRTAFG5MEL7FHbt9r5fCwgRaPk0mUugztxme2BzXYVjrx/TyQu+T4D0hWMSG 2WioIKOO3V0/hFd4kkhT/cRZei8/oLid6ceWyersFFOR4IFhT/pdB/xTA96MFRVsrmRJO J/JhWCRfgc7JdZIsQvvim2Fan9wSBsNWoRzush1Rlq7jMnvgZbjT/S/NaLloR8DWB6A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chrispinetinega.com; spf=pass smtp.mailfrom=chrispinetinega.com; dkim=pass header.d=chrispinetinega.com header.i=@chrispinetinega.com header.a=rsa-sha256 header.s=default header.b=kp8FJCxX; arc=none smtp.remote-ip=198.54.127.151 Received: from out-2z4y-a151.jellyfish.systems (out-2z4y-a151.jellyfish.systems [198.54.127.151]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D393606A31A for ; Sun, 22 Nov 2026 22:18:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 6D393606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chrispinetinega.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chrispinetinega.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=chrispinetinega.com header.i=@chrispinetinega.com header.a=rsa-sha256 header.s=default header.b=kp8FJCxX Received: from mail.privateemail.com (unknown [62.8.90.37]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 4jXk3v64ysz2x9G; Sun, 22 Nov 2026 22:18:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrispinetinega.com; s=default; t=1795385904; bh=k5LjoGaNZQ67mdl0htfbMa2Xp93tcUEF/ZOF14J2AHE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kp8FJCxXmz1yoFCDsNPizvZK9OvcBZfWo1xz7Ru4ipuRaPT8ErsHbXIrelfytJc/C akn5uCr9DHkF2IWJN8WZg132oslL8W88CwG+5bpDKNBg7/EVBUUh4HdHeUs4uVtbMe ub1ZZQqJ7bUtpSjOuE/mDWo/KdI8ohClIrz5dWp5G4e03L+J0hCCTqqBYaKB4bc1jf A+f75w4zbST0Dll3ZxQAsc6HLpdsZpSgAHSMBTaeus4k79rDdbIpG9oTkjEMMZ0va9 sfLTm7KRo8GxdG0tSR+xu6I2U4dC/Ne81ukDLO5UL8hMizF3UYPO/hpTWpV2luoYS1 tR5LY1rcaLnpg== From: Chrispine Tinega To: Bjorn Andersson , Mathieu Poirier Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, Francesco Valla , Chrispine Tinega Subject: [PATCH v3 1/2] remoteproc: k3: Report a remote crash to the remoteproc core Date: Mon, 23 Nov 2026 01:17:53 +0300 Message-ID: <20261122221755.88160-2-dev@chrispinetinega.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20261122221755.88160-1-dev@chrispinetinega.com> References: <20261122221755.88160-1-dev@chrispinetinega.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Envelope-From: dev@chrispinetinega.com A K3 remote core that faults can send RP_MBOX_CRASH over the mailbox, but k3_rproc_mbox_callback() only logs it. The remoteproc core never learns of the crash, so its recovery never runs, the crash is not counted, and the core stays halted with every rpmsg channel to it dead. Call rproc_report_crash(), which may be called from atomic context, when the core is RPROC_RUNNING, that is when Linux booted it. The core then moves to RPROC_CRASHED and the crash is counted. Where the driver leaves recovery enabled, recovery stops the core and boots it again. Where recovery is disabled, the core can still be stopped and started again through sysfs. In any other state, keep only logging the crash: - An IPC-only core, RPROC_DETACHED or RPROC_ATTACHED, was not booted by Linux. Once marked crashed, rproc_detach() refuses it, and the drivers' remove paths skip the detach and leak its resources. The R5F has no start or stop ops in this mode at all. - Each K3 driver requests its mailbox before devm_rproc_add(). A crash queued then would not be cancelled if probe failed, and the work would run on a freed rproc. The state is never RPROC_RUNNING there. Recovery on its own cannot yet restart an R5F: the reset the R5F needs before it starts again is applied in its unprepare() op, which sysfs stop calls and recovery does not. The R5F driver keeps recovery disabled, so this does not change what happens there. Signed-off-by: Chrispine Tinega --- Changes in v3: - Guard rproc_report_crash() with rproc->state == RPROC_RUNNING and keep the dev_err() print in other states, so IPC-only cores do not lose detach and a crash queued before devm_rproc_add() cannot run after a failed probe. (Sashiko review, pointed out by Francesco) Changes in v2: - Drop the dev_err(). rproc_report_crash() already logs the crash and names the core. (Francesco) - Say in the commit message that recovery cannot yet restart an R5F. (Francesco) drivers/remoteproc/ti_k3_common.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/ti_k3_common.c b/drivers/remoteproc/ti_k3_common.c index 4b6da3363..29ca51861 100644 --- a/drivers/remoteproc/ti_k3_common.c +++ b/drivers/remoteproc/ti_k3_common.c @@ -61,10 +61,16 @@ void k3_rproc_mbox_callback(struct mbox_client *client, void *data) switch (msg) { case RP_MBOX_CRASH: /* - * remoteproc detected an exception, but error recovery is not - * supported. So, just log this for now + * Report only a crash of a core that Linux booted. Once the + * remoteproc core marks an IPC-only core crashed, it can no + * longer detach from it. The state is never RPROC_RUNNING + * before devm_rproc_add(), so a failed probe cannot leave + * crash work queued. */ - dev_err(dev, "K3 rproc %s crashed\n", rproc->name); + if (rproc->state == RPROC_RUNNING) + rproc_report_crash(rproc, RPROC_FATAL_ERROR); + else + dev_err(dev, "K3 rproc %s crashed\n", rproc->name); break; case RP_MBOX_ECHO_REPLY: dev_info(dev, "received echo reply from %s\n", rproc->name); -- 2.53.0