From: Bin Du <Bin.Du@amd.com>
To: mateoamadoares@gmail.com,
Nirujogi Pratap <pratap.nirujogi@amd.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
linux-media@vger.kernel.org, stable@vger.kernel.org, "Li,
King" <King.Li@amd.com>,
"Chan, Benjamin (Koon Pan)" <Benjamin.Chan@amd.com>,
"Limonciello, Mario" <Mario.Limonciello@amd.com>,
"sultan@kerneltoast.com" <sultan@kerneltoast.com>
Subject: Re: [PATCH 2/2] media: amd: isp4: propagate the capture format to the subdev on stream start
Date: Tue, 1 Dec 2026 11:47:27 +0800 [thread overview]
Message-ID: <7343f33e-6958-423c-8d29-6c2e4411c405@amd.com> (raw)
In-Reply-To: <20261130-isp4-start-stream-deadlock-v1-2-9bf5a6647ef9@gmail.com>
Hi Mateo,
Thanks for the fix.
On 12/1/2026 6:24 AM, Mateo Amado Ares via B4 Relay wrote:
>
> From: Mateo Amado Ares <mateoamadoares@gmail.com>
>
> The subdev pad format is only set from VIDIOC_S_FMT on the video node,
> there is no init_state, and isp4sd_uninit_stream() clears it whenever a
> stream stops. Any STREAMON not directly preceded by S_FMT, either the
> first one with the default format or a STREAMOFF/STREAMON cycle on the
> same file handle, therefore reaches isp4sd_setup_output() with a 0x0
> format and fails:
>
> amd_isp_capture amd_isp_capture: fail to get out prop
> amd_isp_capture amd_isp_capture: fail to setup output
>
> Both sequences are valid V4L2 usage. This failure is what triggered the
> isp4sd_start_stream() error path deadlock during a browser video call.
>
> Set the video node's current format on the subdev in
> isp4vid_qops_start_streaming() before powering up, so the subdev always
> streams with the format the video node reports.
>
> Fixes: 2ccf48af2270 ("media: platform: amd: isp4 video node and buffers handling added")
> Cc: stable@vger.kernel.org
> Assisted-by: Claude:claude-opus-5-5
> Signed-off-by: Mateo Amado Ares <mateoamadoares@gmail.com>
> ---
> drivers/media/platform/amd/isp4/isp4_video.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/drivers/media/platform/amd/isp4/isp4_video.c b/drivers/media/platform/amd/isp4/isp4_video.c
> index 856a2a0..85ee9d5 100644
> --- a/drivers/media/platform/amd/isp4/isp4_video.c
> +++ b/drivers/media/platform/amd/isp4/isp4_video.c
> @@ -540,6 +540,16 @@ static int isp4vid_qops_start_streaming(struct vb2_queue *vq,
>
> isp_vdev->sequence = 0;
>
> + /*
> + * The subdev format is only set by VIDIOC_S_FMT and is cleared when a
> + * stream stops, so propagate the current format on every start.
> + */
> + ret = isp4vid_set_fmt_2_isp(isp_vdev->isp_sdev, &isp_vdev->format);
> + if (ret) {
> + dev_err(isp_vdev->dev, "fail to set isp format %d\n", ret);
> + goto release_buffers;
> + }
> +
Would you consider preserving the format in
isp4sd_uninit_stream() instead of restoring it on every stream start?
The default format is already initialized in isp4vid_dev_init(),
and S_FMT updates it. Preserving it across stream stop would avoid
the additional format-setting call on each start.
Sultan previously suggested this approach, noting that “the subdev
format shouldn't be cleared when streaming stops”:
https://lore.kernel.org/all/auJEaXevXj6hNTsK@sultan-box/
> ret = isp4sd_pwron_and_init(isp_vdev->isp_sdev);
> if (ret) {
> dev_err(isp_vdev->dev, "power up isp fail %d\n", ret);
>
> --
> 2.56.1
Regards,
Bin
prev parent reply other threads:[~2026-12-01 3:47 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 22:24 [PATCH 0/2] media: amd: isp4: fix stream start failure and deadlock Mateo Amado Ares via B4 Relay
2026-11-30 22:24 ` [PATCH 1/2] media: amd: isp4: fix self-deadlock in isp4sd_start_stream() error path Mateo Amado Ares via B4 Relay
2026-12-01 3:06 ` Bin Du
2026-12-01 3:34 ` Mario Limonciello
2026-11-30 22:24 ` [PATCH 2/2] media: amd: isp4: propagate the capture format to the subdev on stream start Mateo Amado Ares via B4 Relay
2026-12-01 3:47 ` Bin Du [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=7343f33e-6958-423c-8d29-6c2e4411c405@amd.com \
--to=bin.du@amd.com \
--cc=Benjamin.Chan@amd.com \
--cc=King.Li@amd.com \
--cc=Mario.Limonciello@amd.com \
--cc=linux-media@vger.kernel.org \
--cc=mateoamadoares@gmail.com \
--cc=mchehab@kernel.org \
--cc=pratap.nirujogi@amd.com \
--cc=sakari.ailus@linux.intel.com \
--cc=stable@vger.kernel.org \
--cc=sultan@kerneltoast.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