From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFD4431079B for ; Wed, 11 Mar 2026 17:21:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773249669; cv=none; b=iUVqm4DlP7mDzRowc5jB9ZYr5StXUrgb/kQ5oi+aR8p35zSmhP9Yfw/PCw1vOrmipVuUnU75AYVbzdeDdqUidUh95i0tjW6h5oiM/0VpeC+eH0T/FzvGGjOIHePuV5Au7N4zpfh4o2IO+mRLdWUd73VT7O9jyLP0k7jwT1+Gkrc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773249669; c=relaxed/simple; bh=37ro0LdVssBpdr9YV7WFZmX7QJXkkG9R7lAPHfVPfVU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=NDBDJUUd3HKuani9m8TRLUyim1fODctlYSo3BMb2nBc4DDHhTxgCquAwgr5CgAWDqr2UgLITKvB9z3KKlOos01fYxUMffJAt8k0jVTItgk3BvR99tKXqk/uJzBNjK83/7o9A262yXis8FiPLMBkJ+z/bfSNe8X86CD64J3SHgWk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Ez3lv/wc; arc=none smtp.client-ip=209.85.215.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ez3lv/wc" Received: by mail-pg1-f171.google.com with SMTP id 41be03b00d2f7-c2af7d09533so48443a12.1 for ; Wed, 11 Mar 2026 10:21:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773249664; x=1773854464; 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=V7QuY2IvGCqSSBdyso8uzQGpjnvc5nll1p5/k4gdBJI=; b=Ez3lv/wct9vKwx8M1SpMyoNFGvsn93dsADnCs72oar8KCRqP2jMsuwhgkmu3CAwQth LQoHg4kLp7JelG4wNLGgB/r8jQaT5c0SDkjQo3ANNdMA/3LtWyduTegBtigKAMkdLeGm lTNYwheLwySHACpotT5GUoEfUiUUgvCSKc27s8sZEPQW1MJXaAlPQu1HpkkDKdG08BMF V+FaNM+M8+DHHwgzDvGhvns5D1vBnntNPc8SkAg1z0c8kc6eEqsxZO8cpWAU5MZGuHKN YFprhtRXbBQvCql7ehzcAeyRB7naWncoF0rmk+XV3R4KYbRTVBu22nHP2xuU5NZr+kKC 0jNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773249664; x=1773854464; 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=V7QuY2IvGCqSSBdyso8uzQGpjnvc5nll1p5/k4gdBJI=; b=i7JG4zv26pSfXPBNv4dAjeWzPgcn1SQSGhkCwYML1QgDMNPgVgl6phHhkf1ai96RzN M1U4EyAdqKUZUO+Dk2KXDVqsBoBuTarns8QM3hsSgwnVkRBqaZF90oa0DqT/lsbzKbpC TSprkLBROqFDub7+R0LuFz/wMglnrd4Xe9WE4fiIq2CmpW9btZXkHa5C7tz5gRswlZVt fPOZrTE59t6ICHpAnskDAn7ZCuxmx/aQNQdvPktkbJTCkPVTzU7Tp6D+a52ztUYpxOPc 5GQ9k3ykpmBIVMXz1zFEOBiFOOdpEbWvFPo+2xQg+t2zxQgWv/LFM59xSviN5rtFSV/b V1BA== X-Forwarded-Encrypted: i=1; AJvYcCWkAC++IP6bUR73Mho7XdqY6OQyTlHgjvpeODOPZyjVNbJnad+a+kOyF241pMuKuwA3xgbOHHviS8WzG8A=@vger.kernel.org X-Gm-Message-State: AOJu0YzUSZ2IOMWqbaZVCgLR2GBC9Lokxm16ew+t0DkFV9nONVsLtR5h S39RnwmaaZ7x8B6wwYJxeWgQ28RI5bQURUXC59m+4IKreANXy9TmYWmTp3AMDqPjizg= X-Gm-Gg: ATEYQzzHVu18oIidI5TOe/Pn2ItveyKwCc0ZCSA7C/5ElYTj/D335MT3a8J63TtnSga iXrGillkyhGSK2O9mF/Lnebzz6IN4SAveZBcnYoyVKgF1vqCE+3+aMX+GxXcdAsX5oxmcjTPtks KNp7HwckKj8OyMZr2USNSPm2le//Bu5f7as7/Ry+j8oEBM0A8JE/YBAYjhVGBBaDASrP3LL9eJB kHrKhfYq/+GncQW3K0wSVPv31lx0t9r4+4+3O3iHmzGD2RLj/QIxmk3sFuoAM0/5mkV0khfwZIn cpZzuCGLNlvenfs4UGJhlqeBG/0rHm7HuwhiAlWsflttxT8e5hHrtuhxpZ04TUXtYE6+B4uc4J7 ya7sDnEw3nXpQKbiUYV5Z4+ib7lbPpquVRinitOglAsy276HtK5Wyto/0Ri9ay0O2Wp0VO/6fpe 33D8yzI9b7GwOY7mr/wAp8gMih9gQ= X-Received: by 2002:a17:902:f70a:b0:2ab:230d:2da9 with SMTP id d9443c01a7336-2aeae8dce39mr34727925ad.48.1773249663876; Wed, 11 Mar 2026 10:21:03 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:80ec:cdb0:5d0e:6048]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2aeae378ca7sm28243875ad.91.2026.03.11.10.21.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Mar 2026 10:21:03 -0700 (PDT) Date: Wed, 11 Mar 2026 11:21:00 -0600 From: Mathieu Poirier To: Tanmay Shah Cc: andersson@kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 0/2] remoteproc: xlnx: remote crash recovery Message-ID: References: <20260303233533.2310513-1-tanmay.shah@amd.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: <20260303233533.2310513-1-tanmay.shah@amd.com> On Tue, Mar 03, 2026 at 03:35:31PM -0800, Tanmay Shah wrote: > Remote processor can crash or hang during normal execution. Linux > remoteproc framework supports different mechanisms to recover the > remote processor and re-establish the RPMsg communication in such case. > > Crash reporting on AMD-Xilinx platform: > > 1) Using debugfs node > > User can report the crash to the core framework via debugfs node using > following command: > > echo 1 > /sys/kernel/debug/remoteproc/remoteproc0/crash > > 2) Remoteproc notify to the host about crash state and crash reason > via the resource table > > This is a platform specific method where the remote firmware contains > vendor specific resource to update the crash state and the crash > reason. Then the remote notifies the crash to the host via mailbox > notification. The host then will check this resource on every mbox > notification and reports the crash to the core framework if needed. > > Crash recovery mechanism on AMD-Xilnx platform: > > There are two mechanisms available to recover the remote processor from > the crash. 1) boot recovery, 2) attach on recovery > > Remoteproc core framework will choose proper mechanism based on the > rproc features set by the platform driver. > > 1) Boot recovery > > This is the default mechanism to recover the remote processor. > In this method core framework will first stop the remote processor, > load the firmware again and then starts the remote processor. On > AMD-Xilinx platforms this method is supported. The default coredump > method is supported. > > 2) Attach on recovery > > If RPROC_ATTACH_ON_RECOVERY feature is enabled by the platform driver, > then the core framework will choose this method for recovery. > > On versal and later platforms following is the sequence of events expected > during remoteproc crash and attach on recovery: > > a) Remoteproc attach/detach flow is working, and RPMsg comm is established > b) Remote processor (RPU) crashed (crash not reported yet) > c) Platform management controller is instructed to stop and reload elf > on inactive remote processor before reboot (platform specific method) > d) Platform management controller reboots the remote processor > e) Remote processor boots again, and detects previous crash (platform > specific mechanism to detect the crash) > f) Remote processor Reports crash to the Linux (Host) and wait for > the recovery. > g) Linux performs full detach and reattach to remote processor. > h) Normal RPMsg communication is established. > > It is required to destroy all RPMsg related resources and recreate them > during recovery to establish successful RPMsg communication. To achieve > this complete rproc_detach followed by rproc_boot calls are needed. That > is what this patch-series is fixing along with adding rproc recovery > methods for AMD-Xilinx platforms. > > Change log: > > Changes in 3: > - both rproc_attach_recovery() and > rproc_boot_recovery() are called the same way. > - remove unrelated changes > - %s/kick/mailbox notification/ > - %s/core framework/rproc core framework/ > - fold simple function within zynqmp_r5_handle_rsc(). > - remove spurious change > - reset crash state after reporting the crash > - document set and reset of ATTACH_ON_RECOVERY flag > - set recovery_disabled flag to false > - check condition rproc->crash_reason != NULL > For V3 Bjorn made several comments in relation with QCOM use cases. As such I will let him continue with this patchset. Thanks, Mathieu > Changes in v2: > - use rproc_boot instead of rproc_attach > - move debug message early in the function > - clear attach recovery boot flag during detach and stop ops > Tanmay Shah (2): > remoteproc: core: full attach detach during recovery > remoteproc: xlnx: add crash detection mechanism > > drivers/remoteproc/remoteproc_core.c | 15 +++++- > drivers/remoteproc/xlnx_r5_remoteproc.c | 71 ++++++++++++++++++++++++- > 2 files changed, 84 insertions(+), 2 deletions(-) > > > base-commit: 098493c6dced7b02545e8bd0053ef4099a2b769e > -- > 2.34.1 >