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 DF8B33FE2D; Mon, 1 Apr 2024 15:50:30 +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=1711986631; cv=none; b=fojBMd4jWmY+I+zBliTpnxZ2tjwbhQrmIuf7jZFhnhZGZ38uhqar2zq0b1By10GuMIJDgQPN8NYSc5F2xpNEfllEYowAOen84/tlKfYWnrPs5SuNR8QLH5tGsM8wvp2Y/qlhSa96+UQVWt5/kNHmODywOGR1eE6TiDvJcRRJNkI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711986631; c=relaxed/simple; bh=vTnsSjD2HvGxa0tvDjUe9kDpRzdn/SVz2NiJj7qatc8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Is2nS6t2Hvlqkx2858oh82zy8s1wxb30RQsRzvpfAU7nPzw8cvBJoDaUiibhF7VMtyo2A5Yx6R6ReHKcRprLeroJvrVAQIyzmvybAAZrPv3D7BM6H4IGbm2713fd+a9YqpOoZTfqRcHijCRQdLLlIX364kSldpSv+/Im9u7kT3I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2k/TvtMu; 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="2k/TvtMu" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4D0EAC433F1; Mon, 1 Apr 2024 15:50:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1711986630; bh=vTnsSjD2HvGxa0tvDjUe9kDpRzdn/SVz2NiJj7qatc8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2k/TvtMu+Ics0Mjy+YNzXZdTuBIq+44eZaHQDr6dcW2A1W85egUlsVY/Lotknj2J3 mCJZvEr4YBR+g3pys8YUiLp5MWLXxN9f2RqQKYwZpo9bkMNktSYdv01Ig5KZp3BPWp neBML4BCXeqoSIE93tvyAvx83XGq7Nbd1Sbu8u6I= 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.8 006/399] remoteproc: virtio: Fix wdg cannot recovery remote processor Date: Mon, 1 Apr 2024 17:39:32 +0200 Message-ID: <20240401152549.329425593@linuxfoundation.org> X-Mailer: git-send-email 2.44.0 In-Reply-To: <20240401152549.131030308@linuxfoundation.org> References: <20240401152549.131030308@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.8-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