mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: bod@kernel.org
To: Myeonghun Pak <mhun512@gmail.com>
Cc: Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
	 Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
	 Bryan O'Donoghue <bod@kernel.org>,
	 Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org,  linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org,  Sashiko <sashiko-bot@kernel.org>,
	stable@vger.kernel.org,  Ijae Kim <ae878000@gmail.com>
Subject: Re: [PATCH v5 2/2] media: venus: disable recovery work before HFI teardown
Date: Tue, 17 Nov 2026 11:20:55 +0000	[thread overview]
Message-ID: <179491445504.2846709.15401208553880995023.b4-reply@b4> (raw)
In-Reply-To: <20261023223635.3c895c4752c4-3-mhun512@gmail.com>

On 2026-10-23 22:40 -0400, Myeonghun Pak wrote:
> venus_remove() cancels core->work while the IRQ can still schedule it.
> A later IRQ can requeue recovery work, which may access HFI state after
> it has been freed.
> 
> Use disable_delayed_work_sync() at the start of remove to drain recovery
> and prevent further IRQ or worker requeues. Drain the work before
> disabling the IRQ so recovery can finish completion waits that depend
> on IRQs.
> 
> Fixes: af2c3834c8ca ("[media] media: venus: adding core part and helper functions")

Fixes: c5a85ed88e04 ("media: venus: fix use after free bug in venus_remove due to race condition")

Don't resend I'll fix the tag for you.

> Reported-by: Sashiko <sashiko-bot@kernel.org>
> Link: https://lore.kernel.org/all/20260730153912.BAC5E1F00A3D@smtp.kernel.org/
> Cc: stable@vger.kernel.org
> Assisted-by: LLM
> Co-developed-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
> ---
>  drivers/media/platform/qcom/venus/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/media/platform/qcom/venus/core.c b/drivers/media/platform/qcom/venus/core.c
> index 7087af32060f1ed4190bf9f5d4a58cf88dad537d..6e495bc046913b46c926a498c062a6b55c6f7b64 100644
> --- a/drivers/media/platform/qcom/venus/core.c
> +++ b/drivers/media/platform/qcom/venus/core.c
> @@ -596,7 +596,7 @@ static void venus_remove(struct platform_device *pdev)
>  	struct device *dev = core->dev;
>  	int ret;
>  
> -	cancel_delayed_work_sync(&core->work);
> +	disable_delayed_work_sync(&core->work);
>  	ret = pm_runtime_get_sync(dev);
>  	WARN_ON(ret < 0);
>  
> -- 
> 2.53.0
> 
> 
> 

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
bod


      reply	other threads:[~2026-11-17 11:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-24  2:40 [PATCH v5 0/2] media: venus: fix HFI teardown races Myeonghun Pak
2026-10-24  2:40 ` [PATCH v5 1/2] media: venus: hfi: disable IRQ before freeing HFI device Myeonghun Pak
2026-11-17 11:22   ` bod
2026-12-01  8:55   ` Vishnu Reddy
2026-10-24  2:40 ` [PATCH v5 2/2] media: venus: disable recovery work before HFI teardown Myeonghun Pak
2026-11-17 11:20   ` bod [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179491445504.2846709.15401208553880995023.b4-reply@b4 \
    --to=bod@kernel.org \
    --cc=ae878000@gmail.com \
    --cc=dikshita.agarwal@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mhun512@gmail.com \
    --cc=sashiko-bot@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=vikash.garodia@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®