From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f43.google.com (mail-pj1-f43.google.com [209.85.216.43]) (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 3052B1A682B for ; Tue, 16 Jun 2026 15:29:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781623757; cv=none; b=YcnaVX69dS3l1yMp0jOuMq1QC/h9LuxGFAOIAXoSO6kEHnxsz+bolyAdCcJ3fx4gqa5daomOp+0O2Wl1p+Z6VQSD5anm7hjasyIuwlOJED/i+CbWy6rgqiJEKR1HmLEd/ccO4kyZQs1wMMJGyGkToNsWqa5UeWI18UBcU6XcaL0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781623757; c=relaxed/simple; bh=Z4wO3pxTs0luD9NhJFzofL2aCzjd+n1rNShWhdQjvyw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=sz1a7toLa1QE+j7OZ5hM72XQjeVgbvNlly2/KVJ3OHlaV3fA1123eZeCZrj28pyxn2s7ajx1MroVCKZOaQFlsHatmKKj3SIj3pX9W6WiTH6780RQm0BkWSuXBlVE9hkAAqQVP8WK/atcy17MUg/avaVtT6Sw9x7RC3MZcJ3Ul3Y= 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=CRtgevLi; arc=none smtp.client-ip=209.85.216.43 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="CRtgevLi" Received: by mail-pj1-f43.google.com with SMTP id 98e67ed59e1d1-36da151a152so3407119a91.1 for ; Tue, 16 Jun 2026 08:29:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1781623753; x=1782228553; 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=HmTxXF5cZkGYxc1VSn87KOQRothuoF2vpV5jTzMsxKI=; b=CRtgevLigfu4eIb9MDO+OEKreT7z9/BbC5b3NvWTmOY+uM4XvvDi9j7P5DcJFGT3Ya SmuLPi/+yzqRjJSweNtMpm2HkzAY+9JJcb7UqXMmRaxyemO3U7XXiiWbwr8fE5Ffbvwb k/3AzSR4+CxVBDNy8kyrmNV44F/uYzRTgB5pbuXzw3ZG2dIWw3Bbn3GSxP0w8usLGuHR kquKDLhZVNa/VLqSEs1z9vnmPxTY2LJj69ZyM0FCfQumx0FdhhIf/PMBTSfKck+pih8w z/UOUViHF6XZEnXxL+cR4ggIsn2VBDzd2ZQPSQOW5GYgcs71czBdE0yfVAfpoMWjtJIM EvGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781623753; x=1782228553; 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=HmTxXF5cZkGYxc1VSn87KOQRothuoF2vpV5jTzMsxKI=; b=JqcrcqSqh+o2lBBzVrBNTLLHyPbluTzJ3qxSQzOvXmcTdNdz37lrpHl2ZAP6/oVmoX nsezfyK8gHo42G1PSJu3AtjAhgaFb/hnW8TmAmP2mPrLSc7t5hGKclizOhElpa6Unwb6 9SqA/+xSuWXrOXZzuYMg6BeRjGrbmnMRTiCCoqZIR9qfOeqDIBkpXDxupTltH4kgnda6 0oSYFFv8DMwKXk/SzWwrynmflHWmu7qGCZOVjGGbUzWKUN/Zeb40V+7GbGXScEH36147 ahT9oVKFM980umDaz5l+lQpRfPLlG8iwl0nNevo0QyxAwZYlfAgxLKihqPtTG24AWeB4 IYsg== X-Forwarded-Encrypted: i=1; AFNElJ8x0XvglJPy5sDZBjt+oGXIDECZoFMTHus5SwR5mvOtbGiO8m7cqQM1nH0fKfcEaBrCOJ9IKWTit0q0+kk=@vger.kernel.org X-Gm-Message-State: AOJu0YxtZtS6dUmpmcTT4g6ee6blOEjun9aHuMfCpTd/7WEX+kmmNumI JeKWagY/rsyUPJw+JS3zeOXMKM+gLFCD8JJ+woKtKu4Da3gpzdcnF6096z3cdMnoT1Q= X-Gm-Gg: Acq92OGSFX8B9Ssjth8hot/aiLGzKHgCSp4cKQrkMnzS742D8iIkCo46Ga5j8kJPjcn zt7+/WaAbfMKrzC3G0QJBkEdw5ItvCBKlciMPfVjHEG9IbRpMbAMmvqD5EPCMPR49leCiQqFuxB xc1AcB6YE1P0c2N8+hXBvgyFIhTWuneWHfvhFtWzeW61Pg6gJtmoL0yXscSolhgA39wJlUavhEV Gk+pLz3X7ik4ZEdYrMULO8UPLgm1UXuIGD1gEQZptVCOMCmudH9p8SOgnGPPLvr+ZC3uc2iiYVZ j+tcxtZbsx0/JRf51fYc8xFtGILqKwGSJusz3T4Sb7l7DhXAsYtP7HUiFgVa3xLYdJearPTnoWY DFTmsaRWZsaK2/5UQZBlKyJxcLOPSVT0ujzpozL8ePdIKQz1KFBJOooQI7urRsHqqSoVwzOyrXj KOQ3wDWzjR7WYgJPzKK3RKNrzrCoyWxRbBlYPYxA== X-Received: by 2002:a17:90b:1cc5:b0:37c:18e0:90ea with SMTP id 98e67ed59e1d1-37c2bd29455mr16579323a91.18.1781623753052; Tue, 16 Jun 2026 08:29:13 -0700 (PDT) Received: from p14s ([2604:3d09:148c:c800:1850:280c:40de:53f0]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-37c5228eb5bsm3239749a91.12.2026.06.16.08.29.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2026 08:29:12 -0700 (PDT) Date: Tue, 16 Jun 2026 09:29:10 -0600 From: Mathieu Poirier To: Tanmay Shah Cc: andersson@kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v5 1/2] remoteproc: core: full attach detach during recovery Message-ID: References: <20260610182711.1758544-1-tanmay.shah@amd.com> <20260610182711.1758544-2-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: <20260610182711.1758544-2-tanmay.shah@amd.com> Hi Tanmay, On Wed, Jun 10, 2026 at 11:27:10AM -0700, Tanmay Shah wrote: > Current attach on recovery mechanism loads the clean resource table > during recovery, but doesn't re-allocate the resources. RPMsg > communication will fail after recovery due to this. Fix this > incorrect behavior by doing the full detach and attach of remote > processor during the recovery. This will load the clean resource table > and re-allocate all the resources, which will set up correct vring > information in the resource table. > > Signed-off-by: Tanmay Shah > --- > drivers/remoteproc/remoteproc_core.c | 15 ++++++++++++++- > 1 file changed, 14 insertions(+), 1 deletion(-) > > diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c > index f003be006b1b..8393468fa1ee 100644 > --- a/drivers/remoteproc/remoteproc_core.c > +++ b/drivers/remoteproc/remoteproc_core.c > @@ -1776,7 +1776,20 @@ static int rproc_attach_recovery(struct rproc *rproc) > if (ret) > return ret; > > - return __rproc_attach(rproc); > + /* clean up all acquired resources */ > + rproc_resource_cleanup(rproc); > + > + /* release HW resources if needed */ > + rproc_unprepare_device(rproc); > + > + rproc_disable_iommu(rproc); > + > + /* Free the copy of the resource table */ > + kfree(rproc->cached_table); > + rproc->cached_table = NULL; > + rproc->table_ptr = NULL; > + > + return rproc_attach(rproc); That part works. > } > > static int rproc_boot_recovery(struct rproc *rproc) > -- > 2.34.1 >