From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 08F9B4776F; Mon, 1 Apr 2024 16:11:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711987869; cv=none; b=HKnF0wS6FAjYzd8MIYAT00vC1z/Ob3YAwHCAgcOMnrANjUlNj9v/lLaIPAQrHjNY5Kl3WtEo2sN7Qz4N7sUljB5baB1MXccFbfAMW/igobeOyjj/RoiFDbKyV4tFfFGR8MU1qv/wL3hNZltFm/RttzzIzs5iZpcA5We9QRwPjUQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711987869; c=relaxed/simple; bh=DN7PWJ53RnazUYVNJN4q5Npzx1QxkzNgrcbVCMC0LJ8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W/MJHddCBqgtJsSTspg9A1aMGJ3hQ47rNiEImnbz7WxWLcQ/POktRsCx4OwKL9mMGyQZ2CIJi+Fjgo5gAptx0bMxlwg3bGORK39XCWE0v340eiTnvOnUQFI++QH2XghrUbtVUkaPS7fLEqzMAAbu2D/TS9YY5vkp+vw+BnlJ1b0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=s4YmSuob; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="s4YmSuob" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BBA4C433C7; Mon, 1 Apr 2024 16:11:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711987868; bh=DN7PWJ53RnazUYVNJN4q5Npzx1QxkzNgrcbVCMC0LJ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s4YmSuobppYzw2CWXQLH97WF5CiAU6HeLCkl8mzEC0ooLLsOX2QnKMe14RRtrAKO9 zX8IVgemblAjC+RSeDYXe4ZN/gPBzS8JV4WI9VGbLXfR4EDa9b5Gxdcl+OuEJAJtJk 1xiZeIt9cfY0nXQVRSpCwiO8mFVxlLmCi9f26n8k= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Joakim Zhang , Arnaud Pouliquen , Mathieu Poirier , Sasha Levin Subject: [PATCH 6.7 008/432] remoteproc: virtio: Fix wdg cannot recovery remote processor Date: Mon, 1 Apr 2024 17:39:55 +0200 Message-ID: <20240401152553.378775493@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240401152553.125349965@linuxfoundation.org> References: <20240401152553.125349965@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.7-stable review patch. If anyone has any objections, please let me know. ------------------ From: Joakim Zhang [ Upstream commit b327c72753d6a78de37aed6c35756f2ef62897ee ] Recovery remote processor failed when wdg irq received: [ 0.842574] remoteproc remoteproc0: crash detected in cix-dsp-rproc: type watchdog [ 0.842750] remoteproc remoteproc0: handling crash #1 in cix-dsp-rproc [ 0.842824] remoteproc remoteproc0: recovering cix-dsp-rproc [ 0.843342] remoteproc remoteproc0: stopped remote processor cix-dsp-rproc [ 0.847901] rproc-virtio rproc-virtio.0.auto: Failed to associate buffer [ 0.847979] remoteproc remoteproc0: failed to probe subdevices for cix-dsp-rproc: -16 The reason is that dma coherent mem would not be released when recovering the remote processor, due to rproc_virtio_remove() would not be called, where the mem released. It will fail when it try to allocate and associate buffer again. Releasing reserved memory from rproc_virtio_dev_release(), instead of rproc_virtio_remove(). Fixes: 1d7b61c06dc3 ("remoteproc: virtio: Create platform device for the remoteproc_virtio") Signed-off-by: Joakim Zhang Acked-by: Arnaud Pouliquen Cc: stable@vger.kernel.org Link: https://lore.kernel.org/r/20231217053659.3245745-1-joakim.zhang@cixtech.com Signed-off-by: Mathieu Poirier Signed-off-by: Sasha Levin --- drivers/remoteproc/remoteproc_virtio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/remoteproc/remoteproc_virtio.c b/drivers/remoteproc/remoteproc_virtio.c index 83d76915a6ad6..25b66b113b695 100644 --- a/drivers/remoteproc/remoteproc_virtio.c +++ b/drivers/remoteproc/remoteproc_virtio.c @@ -351,6 +351,9 @@ static void rproc_virtio_dev_release(struct device *dev) kfree(vdev); + of_reserved_mem_device_release(&rvdev->pdev->dev); + dma_release_coherent_memory(&rvdev->pdev->dev); + put_device(&rvdev->pdev->dev); } @@ -584,9 +587,6 @@ static void rproc_virtio_remove(struct platform_device *pdev) rproc_remove_subdev(rproc, &rvdev->subdev); rproc_remove_rvdev(rvdev); - of_reserved_mem_device_release(&pdev->dev); - dma_release_coherent_memory(&pdev->dev); - put_device(&rproc->dev); } -- 2.43.0