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 3268835E53B; Fri, 9 Jan 2026 12:48:26 +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=1767962906; cv=none; b=q+tWeFXzMzfqQm4rrM/x8tagInLppqjHtEdc8tkZafaqcS7ERsmXzSefenyUauKCiqa/kqLGtO1d4mkaO6ewUCO1h1+SUyYtHbnd4LOT/o+/J7Pf848NyG7MlkDEaaMus4JeM7vWMlRMWyRub/+bsEPg5td5IzBvzdaqRwftH/o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767962906; c=relaxed/simple; bh=/VUiyfWTGp2fStGoma7xVHhFrOfX9YXd8Ly3kZBqr/8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=olnlCIOmWNLSJFlIrBzq3eUR8NE9iYqZGj5uXfy/Gmg2DZR2PyChitS5a/DTp0pR3Qg8Kb6tq8ivLQXa1FowODJCZ1davxDMurp7DfzA/i+IC8U+T3D5F8b4ixU2GXNnvYn11OKBuTvN5cObCKs4PkplmGh3k/Vb1wRVEUKp6n4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=owwpdWUq; 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="owwpdWUq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B1EF2C4CEF1; Fri, 9 Jan 2026 12:48:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1767962906; bh=/VUiyfWTGp2fStGoma7xVHhFrOfX9YXd8Ly3kZBqr/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=owwpdWUq7D1Kewcnf+/ImcoCGXu6QMBTBoeXEnS0AizfPJZiYiRdl76LRtTE5GSnV w9ERwVVGAc+OnGQWusfZr6wKTDCroTZPeisx45msP9FcKeWQWDpXI56CMt+CeSjpc3 q2TNXE/3yzWEO9nCD4BjXJ5Yx7FB6vu1DwkBGm08= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ming Qian , Nicolas Dufresne , Hans Verkuil Subject: [PATCH 6.1 487/634] media: amphion: Cancel message work before releasing the VPU core Date: Fri, 9 Jan 2026 12:42:45 +0100 Message-ID: <20260109112135.871449314@linuxfoundation.org> X-Mailer: git-send-email 2.52.0 In-Reply-To: <20260109112117.407257400@linuxfoundation.org> References: <20260109112117.407257400@linuxfoundation.org> User-Agent: quilt/0.69 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.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ming Qian commit ae246b0032146e352c4c06a7bf03cd3d5bcb2ecd upstream. To avoid accessing the VPU register after release of the VPU core, cancel the message work and destroy the workqueue that handles the VPU message before release of the VPU core. Fixes: 3cd084519c6f ("media: amphion: add vpu v4l2 m2m support") Cc: stable@vger.kernel.org Signed-off-by: Ming Qian Signed-off-by: Nicolas Dufresne Signed-off-by: Hans Verkuil Signed-off-by: Greg Kroah-Hartman --- drivers/media/platform/amphion/vpu_v4l2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/media/platform/amphion/vpu_v4l2.c +++ b/drivers/media/platform/amphion/vpu_v4l2.c @@ -597,15 +597,15 @@ static int vpu_v4l2_release(struct vpu_i { vpu_trace(inst->vpu->dev, "%p\n", inst); - vpu_release_core(inst->core); - put_device(inst->dev); - if (inst->workqueue) { cancel_work_sync(&inst->msg_work); destroy_workqueue(inst->workqueue); inst->workqueue = NULL; } + vpu_release_core(inst->core); + put_device(inst->dev); + v4l2_ctrl_handler_free(&inst->ctrl_handler); mutex_destroy(&inst->lock);