mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Brandon Brnich <b-brnich@ti.com>
To: Jackson.lee <jackson.lee@chipsnmedia.com>, <mchehab@kernel.org>,
	<hverkuil-cisco@xs4all.nl>, <nicolas.dufresne@collabora.com>,
	<bob.beckett@collabora.com>
Cc: <linux-media@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<lafley.kim@chipsnmedia.com>, <hverkuil@xs4all.nl>,
	<nas.chung@chipsnmedia.com>
Subject: Re: [PATCH v5 1/4] media: chips-media: wave5: Fix SError of kernel panic when closed
Date: Wed, 5 Nov 2025 15:38:11 -0600	[thread overview]
Message-ID: <0a3dba2c-e3d1-4499-9db3-55ba26013877@ti.com> (raw)
In-Reply-To: <20250922055255.116-2-jackson.lee@chipsnmedia.com>

Hi Jackson,

On 9/22/2025 12:52 AM, Jackson.lee wrote:
> From: Jackson Lee <jackson.lee@chipsnmedia.com>
> 
> SError of kernel panic rarely happened while testing fluster.
> The root cause was to enter suspend mode because timeout of autosuspend
> delay happened.
> 
> [   48.834439] SError Interrupt on CPU0, code 0x00000000bf000000 -- SError
> [   48.834455] CPU: 0 UID: 0 PID: 1067 Comm: v4l2h265dec0:sr Not tainted 6.12.9-gc9e21a1ebd75-dirty #7
> [   48.834461] Hardware name: ti Texas Instruments J721S2 EVM/Texas Instruments J721S2 EVM, BIOS 2025.01-00345-gbaf3aaa8ecfa 01/01/2025
> [   48.834464] pstate: 20000005 (nzCv daif -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
> [   48.834468] pc : wave5_dec_clr_disp_flag+0x40/0x80 [wave5]
> [   48.834488] lr : wave5_dec_clr_disp_flag+0x40/0x80 [wave5]
> [   48.834495] sp : ffff8000856e3a30
> [   48.834497] x29: ffff8000856e3a30 x28: ffff0008093f6010 x27: ffff000809158130
> [   48.834504] x26: 0000000000000000 x25: ffff00080b625000 x24: ffff000804a9ba80
> [   48.834509] x23: ffff000802343028 x22: ffff000809158150 x21: ffff000802218000
> [   48.834513] x20: ffff0008093f6000 x19: ffff0008093f6000 x18: 0000000000000000
> [   48.834518] x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffff74009618
> [   48.834523] x14: 000000010000000c x13: 0000000000000000 x12: 0000000000000000
> [   48.834527] x11: ffffffffffffffff x10: ffffffffffffffff x9 : ffff000802343028
> [   48.834532] x8 : ffff00080b6252a0 x7 : 0000000000000038 x6 : 0000000000000000
> [   48.834536] x5 : ffff00080b625060 x4 : 0000000000000000 x3 : 0000000000000000
> [   48.834541] x2 : 0000000000000000 x1 : ffff800084bf0118 x0 : ffff800084bf0000
> [   48.834547] Kernel panic - not syncing: Asynchronous SError Interrupt
> [   48.834549] CPU: 0 UID: 0 PID: 1067 Comm: v4l2h265dec0:sr Not tainted 6.12.9-gc9e21a1ebd75-dirty #7
> [   48.834554] Hardware name: ti Texas Instruments J721S2 EVM/Texas Instruments J721S2 EVM, BIOS 2025.01-00345-gbaf3aaa8ecfa 01/01/2025
> [   48.834556] Call trace:
> [   48.834559]  dump_backtrace+0x94/0xec
> [   48.834574]  show_stack+0x18/0x24
> [   48.834579]  dump_stack_lvl+0x38/0x90
> [   48.834585]  dump_stack+0x18/0x24
> [   48.834588]  panic+0x35c/0x3e0
> [   48.834592]  nmi_panic+0x40/0x8c
> [   48.834595]  arm64_serror_panic+0x64/0x70
> [   48.834598]  do_serror+0x3c/0x78
> [   48.834601]  el1h_64_error_handler+0x34/0x4c
> [   48.834605]  el1h_64_error+0x64/0x68
> [   48.834608]  wave5_dec_clr_disp_flag+0x40/0x80 [wave5]
> [   48.834615]  wave5_vpu_dec_clr_disp_flag+0x54/0x80 [wave5]
> [   48.834622]  wave5_vpu_dec_buf_queue+0x19c/0x1a0 [wave5]
> [   48.834628]  __enqueue_in_driver+0x3c/0x74 [videobuf2_common]
> [   48.834639]  vb2_core_qbuf+0x508/0x61c [videobuf2_common]
> [   48.834646]  vb2_qbuf+0xa4/0x168 [videobuf2_v4l2]
> [   48.834656]  v4l2_m2m_qbuf+0x80/0x238 [v4l2_mem2mem]
> [   48.834666]  v4l2_m2m_ioctl_qbuf+0x18/0x24 [v4l2_mem2mem]
> [   48.834673]  v4l_qbuf+0x48/0x5c [videodev]
> [   48.834704]  __video_do_ioctl+0x180/0x3f0 [videodev]
> [   48.834725]  video_usercopy+0x2ec/0x68c [videodev]
> [   48.834745]  video_ioctl2+0x18/0x24 [videodev]
> [   48.834766]  v4l2_ioctl+0x40/0x60 [videodev]
> [   48.834786]  __arm64_sys_ioctl+0xa8/0xec
> [   48.834793]  invoke_syscall+0x44/0x100
> [   48.834800]  el0_svc_common.constprop.0+0xc0/0xe0
> [   48.834804]  do_el0_svc+0x1c/0x28
> [   48.834809]  el0_svc+0x30/0xd0
> [   48.834813]  el0t_64_sync_handler+0xc0/0xc4
> [   48.834816]  el0t_64_sync+0x190/0x194
> [   48.834820] SMP: stopping secondary CPUs
> [   48.834831] Kernel Offset: disabled
> [   48.834833] CPU features: 0x08,00002002,80200000,4200421b
> [   48.834837] Memory Limit: none
> [   49.161404] ---[ end Kernel panic - not syncing: Asynchronous SError Interrupt ]---
> 

I am still seeing a variation of this crash log during execution as we 
have discussed. If there is a lot of logging turned on using gstreamers 
debugging mechanism, a delay could occur between frames leading the 
device to be shut off and a kernel panic occurring when next part of 
bitstream is loaded.

Best,
Brandon

> Fixes: 2092b3833487 ("media: chips-media: wave5: Support runtime suspend/resume")
> Signed-off-by: Jackson Lee <jackson.lee@chipsnmedia.com>
> Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
> ---
>   .../platform/chips-media/wave5/wave5-vpu-dec.c    |  3 ---
>   .../platform/chips-media/wave5/wave5-vpu-enc.c    |  3 ---
>   .../media/platform/chips-media/wave5/wave5-vpu.c  |  2 +-
>   .../platform/chips-media/wave5/wave5-vpuapi.c     | 15 ---------------
>   4 files changed, 1 insertion(+), 22 deletions(-)
> 
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
> index 72af0faa3ef2..1df78e427c6a 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
> @@ -1829,9 +1829,6 @@ static int wave5_vpu_open_dec(struct file *filp)
>   	if (ret)
>   		goto cleanup_inst;
>   
> -	if (list_empty(&dev->instances))
> -		pm_runtime_use_autosuspend(inst->dev->dev);
> -
>   	list_add_tail(&inst->list, &dev->instances);
>   
>   	mutex_unlock(&dev->dev_lock);
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c b/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c
> index 506d6c6166a6..d2b047706626 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-enc.c
> @@ -1773,9 +1773,6 @@ static int wave5_vpu_open_enc(struct file *filp)
>   	if (ret)
>   		goto cleanup_inst;
>   
> -	if (list_empty(&dev->instances))
> -		pm_runtime_use_autosuspend(inst->dev->dev);
> -
>   	list_add_tail(&inst->list, &dev->instances);
>   
>   	mutex_unlock(&dev->dev_lock);
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu.c b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> index e1715d3f43b0..b3c633dd3df1 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vpu.c
> @@ -322,7 +322,7 @@ static int wave5_vpu_probe(struct platform_device *pdev)
>   	dev_info(&pdev->dev, "Product Code:      0x%x\n", dev->product_code);
>   	dev_info(&pdev->dev, "Firmware Revision: %u\n", fw_revision);
>   
> -	pm_runtime_set_autosuspend_delay(&pdev->dev, 100);
> +	pm_runtime_set_autosuspend_delay(&pdev->dev, 500);
>   	pm_runtime_use_autosuspend(&pdev->dev);
>   	pm_runtime_enable(&pdev->dev);
>   	wave5_vpu_sleep_wake(&pdev->dev, true, NULL, 0);
> diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
> index e5e879a13e8b..e94d6ebc9f81 100644
> --- a/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
> +++ b/drivers/media/platform/chips-media/wave5/wave5-vpuapi.c
> @@ -207,8 +207,6 @@ int wave5_vpu_dec_close(struct vpu_instance *inst, u32 *fail_res)
>   	int retry = 0;
>   	struct vpu_device *vpu_dev = inst->dev;
>   	int i;
> -	int inst_count = 0;
> -	struct vpu_instance *inst_elm;
>   
>   	*fail_res = 0;
>   	if (!inst->codec_info)
> @@ -250,11 +248,6 @@ int wave5_vpu_dec_close(struct vpu_instance *inst, u32 *fail_res)
>   
>   	wave5_vdi_free_dma_memory(vpu_dev, &p_dec_info->vb_task);
>   
> -	list_for_each_entry(inst_elm, &vpu_dev->instances, list)
> -		inst_count++;
> -	if (inst_count == 1)
> -		pm_runtime_dont_use_autosuspend(vpu_dev->dev);
> -
>   unlock_and_return:
>   	mutex_unlock(&vpu_dev->hw_lock);
>   	pm_runtime_put_sync(inst->dev->dev);
> @@ -720,8 +713,6 @@ int wave5_vpu_enc_close(struct vpu_instance *inst, u32 *fail_res)
>   	int ret;
>   	int retry = 0;
>   	struct vpu_device *vpu_dev = inst->dev;
> -	int inst_count = 0;
> -	struct vpu_instance *inst_elm;
>   
>   	*fail_res = 0;
>   	if (!inst->codec_info)
> @@ -764,12 +755,6 @@ int wave5_vpu_enc_close(struct vpu_instance *inst, u32 *fail_res)
>   	}
>   
>   	wave5_vdi_free_dma_memory(vpu_dev, &p_enc_info->vb_task);
> -
> -	list_for_each_entry(inst_elm, &vpu_dev->instances, list)
> -		inst_count++;
> -	if (inst_count == 1)
> -		pm_runtime_dont_use_autosuspend(vpu_dev->dev);
> -
>   	mutex_unlock(&vpu_dev->hw_lock);
>   	pm_runtime_put_sync(inst->dev->dev);
>   


  reply	other threads:[~2025-11-05 21:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-22  5:52 [PATCH v5 0/4] Performance improvement of decoder Jackson.lee
2025-09-22  5:52 ` [PATCH v5 1/4] media: chips-media: wave5: Fix SError of kernel panic when closed Jackson.lee
2025-11-05 21:38   ` Brandon Brnich [this message]
2025-09-22  5:52 ` [PATCH v5 2/4] media: chips-media: wave5: Fix Null reference while testing fluster Jackson.lee
2025-09-22  5:52 ` [PATCH v5 3/4] media: chips-media: wave5: Add WARN_ON to check if dec_output_info is NULL Jackson.lee
2025-09-22  5:52 ` [PATCH v5 4/4] media: chips-media: wave5: Improve performance of decoder Jackson.lee
2025-09-22 17:32   ` Brandon Brnich
2025-09-22 18:00     ` Nicolas Dufresne
2025-09-24  1:14       ` jackson.lee
2025-09-24 13:20         ` Nicolas Dufresne
2025-09-24 15:06           ` Brandon Brnich
2025-09-23  0:57     ` jackson.lee
2025-10-27  5:38 ` [PATCH v5 0/4] Performance improvement " jackson.lee

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=0a3dba2c-e3d1-4499-9db3-55ba26013877@ti.com \
    --to=b-brnich@ti.com \
    --cc=bob.beckett@collabora.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=hverkuil@xs4all.nl \
    --cc=jackson.lee@chipsnmedia.com \
    --cc=lafley.kim@chipsnmedia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nas.chung@chipsnmedia.com \
    --cc=nicolas.dufresne@collabora.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®