mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
To: Neil Armstrong <neil.armstrong@linaro.org>,
	Vikash Garodia <quic_vgarodia@quicinc.com>,
	Dikshita Agarwal <quic_dikshita@quicinc.com>,
	Abhinav Kumar <abhinav.kumar@linux.dev>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: iris: fix module removal if firmware download failed
Date: Thu, 21 Aug 2025 09:00:30 +0100	[thread overview]
Message-ID: <2a6f2c48-1a05-460e-951b-417fb617e737@linaro.org> (raw)
In-Reply-To: <20250820-topic-sm8x50-iris-remove-fix-v1-1-07b23a0bd8fc@linaro.org>

On 20/08/2025 18:06, Neil Armstrong wrote:
> Fix remove if firmware failed to load:
> qcom-iris aa00000.video-codec: Direct firmware load for qcom/vpu/vpu33_p4.mbn failed with error -2
> qcom-iris aa00000.video-codec: firmware download failed
> qcom-iris aa00000.video-codec: core init failed
> 
> then:
> $ echo aa00000.video-codec > /sys/bus/platform/drivers/qcom-iris/unbind
> 
> Triggers:
> genpd genpd:1:aa00000.video-codec: Runtime PM usage count underflow!
> ------------[ cut here ]------------
> video_cc_mvs0_clk already disabled
> WARNING: drivers/clk/clk.c:1206 at clk_core_disable+0xa4/0xac, CPU#1: sh/542
> <snip>
> pc : clk_core_disable+0xa4/0xac
> lr : clk_core_disable+0xa4/0xac
> <snip>
> Call trace:
>   clk_core_disable+0xa4/0xac (P)
>   clk_disable+0x30/0x4c
>   iris_disable_unprepare_clock+0x20/0x48 [qcom_iris]
>   iris_vpu_power_off_hw+0x48/0x58 [qcom_iris]
>   iris_vpu33_power_off_hardware+0x44/0x230 [qcom_iris]
>   iris_vpu_power_off+0x34/0x84 [qcom_iris]
>   iris_core_deinit+0x44/0xc8 [qcom_iris]
>   iris_remove+0x20/0x48 [qcom_iris]
>   platform_remove+0x20/0x30
>   device_remove+0x4c/0x80
> <snip>
> ---[ end trace 0000000000000000 ]---
> ------------[ cut here ]------------
> video_cc_mvs0_clk already unprepared
> WARNING: drivers/clk/clk.c:1065 at clk_core_unprepare+0xf0/0x110, CPU#2: sh/542
> <snip>
> pc : clk_core_unprepare+0xf0/0x110
> lr : clk_core_unprepare+0xf0/0x110
> <snip>
> Call trace:
>   clk_core_unprepare+0xf0/0x110 (P)
>   clk_unprepare+0x2c/0x44
>   iris_disable_unprepare_clock+0x28/0x48 [qcom_iris]
>   iris_vpu_power_off_hw+0x48/0x58 [qcom_iris]
>   iris_vpu33_power_off_hardware+0x44/0x230 [qcom_iris]
>   iris_vpu_power_off+0x34/0x84 [qcom_iris]
>   iris_core_deinit+0x44/0xc8 [qcom_iris]
>   iris_remove+0x20/0x48 [qcom_iris]
>   platform_remove+0x20/0x30
>   device_remove+0x4c/0x80
> <snip>
> ---[ end trace 0000000000000000 ]---
> genpd genpd:0:aa00000.video-codec: Runtime PM usage count underflow!
> ------------[ cut here ]------------
> gcc_video_axi0_clk already disabled
> WARNING: drivers/clk/clk.c:1206 at clk_core_disable+0xa4/0xac, CPU#4: sh/542
> <snip>
> pc : clk_core_disable+0xa4/0xac
> lr : clk_core_disable+0xa4/0xac
> <snip>
> Call trace:
>   clk_core_disable+0xa4/0xac (P)
>   clk_disable+0x30/0x4c
>   iris_disable_unprepare_clock+0x20/0x48 [qcom_iris]
>   iris_vpu33_power_off_controller+0x17c/0x428 [qcom_iris]
>   iris_vpu_power_off+0x48/0x84 [qcom_iris]
>   iris_core_deinit+0x44/0xc8 [qcom_iris]
>   iris_remove+0x20/0x48 [qcom_iris]
>   platform_remove+0x20/0x30
>   device_remove+0x4c/0x80
> <snip>
> ------------[ cut here ]------------
> gcc_video_axi0_clk already unprepared
> WARNING: drivers/clk/clk.c:1065 at clk_core_unprepare+0xf0/0x110, CPU#4: sh/542
> <snip>
> pc : clk_core_unprepare+0xf0/0x110
> lr : clk_core_unprepare+0xf0/0x110
> <snip>
> Call trace:
>   clk_core_unprepare+0xf0/0x110 (P)
>   clk_unprepare+0x2c/0x44
>   iris_disable_unprepare_clock+0x28/0x48 [qcom_iris]
>   iris_vpu33_power_off_controller+0x17c/0x428 [qcom_iris]
>   iris_vpu_power_off+0x48/0x84 [qcom_iris]
>   iris_core_deinit+0x44/0xc8 [qcom_iris]
>   iris_remove+0x20/0x48 [qcom_iris]
>   platform_remove+0x20/0x30
>   device_remove+0x4c/0x80
> <snip>
> ---[ end trace 0000000000000000 ]---
> 
> Skip deinit if initialization never succeeded.
> 
> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
> ---
>   drivers/media/platform/qcom/iris/iris_core.c | 10 ++++++----
>   1 file changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/media/platform/qcom/iris/iris_core.c b/drivers/media/platform/qcom/iris/iris_core.c
> index 0fa0a3b549a23877af57c9950a5892e821b9473a..8406c48d635b6eba0879396ce9f9ae2292743f09 100644
> --- a/drivers/media/platform/qcom/iris/iris_core.c
> +++ b/drivers/media/platform/qcom/iris/iris_core.c
> @@ -15,10 +15,12 @@ void iris_core_deinit(struct iris_core *core)
>   	pm_runtime_resume_and_get(core->dev);
>   
>   	mutex_lock(&core->lock);
> -	iris_fw_unload(core);
> -	iris_vpu_power_off(core);
> -	iris_hfi_queues_deinit(core);
> -	core->state = IRIS_CORE_DEINIT;
> +	if (core->state != IRIS_CORE_DEINIT) {
> +		iris_fw_unload(core);
> +		iris_vpu_power_off(core);
> +		iris_hfi_queues_deinit(core);
> +		core->state = IRIS_CORE_DEINIT;
> +	}
>   	mutex_unlock(&core->lock);
>   
>   	pm_runtime_put_sync(core->dev);
> 
> ---
> base-commit: 5303936d609e09665deda94eaedf26a0e5c3a087
> change-id: 20250820-topic-sm8x50-iris-remove-fix-76f86621d6ac
> 
> Best regards,

missing a fixes tag, once included please add

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

  reply	other threads:[~2025-08-21  8:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-20 17:06 Neil Armstrong
2025-08-21  8:00 ` Bryan O'Donoghue [this message]
2025-08-21  9:42 ` Dikshita Agarwal
2025-08-21 12:27   ` Neil Armstrong
2025-08-22  5:29     ` Dikshita Agarwal

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=2a6f2c48-1a05-460e-951b-417fb617e737@linaro.org \
    --to=bryan.odonoghue@linaro.org \
    --cc=abhinav.kumar@linux.dev \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=quic_dikshita@quicinc.com \
    --cc=quic_vgarodia@quicinc.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®