mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Seifelden Abdelmonem <saif.elden.hatim@gmail.com>
To: Nirujogi Pratap <pratap.nirujogi@amd.com>
Cc: Bin Du <bin.du@amd.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Sultan Alsawaf <sultan@kerneltoast.com>,
	Benjamin Chan <benjamin.chan@amd.com>, King Li <King.Li@amd.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Seifelden Abdelmonem <saif.elden.hatim@gmail.com>
Subject: Re: [PATCH 1/2] media: amd: isp4: hold buf_list_lock while sending buffers at stream start
Date: Tue,  3 Nov 2026 18:02:44 +0300	[thread overview]
Message-ID: <20261103150312.52812-1-saif.elden.hatim@gmail.com> (raw)
In-Reply-To: <bef07925-6a2e-48a1-a72a-127b390705d5@amd.com>

Hello Pratap,

On Mon, Nov 2, 2026, Nirujogi, Pratap wrote:
> I’m curious about the sequence you are using to reproduce this issue.
> Would you mind sharing the details of the sequence and steps involved?

Thanks for the review. Nothing special on the userspace side, just a
plain capture; the exact command from that run was:

  timeout 8s v4l2-ctl -d /dev/video0 \
      --set-fmt-video=width=1920,height=1080,pixelformat=NV12 \
      --stream-mmap=4 --stream-count=30 --stream-to=out.nv12 \
      --stream-poll

The oops happened inside VIDIOC_STREAMON, before the first frame
reached v4l2-ctl.

What made it hit was an out-of-tree change on my side: the sensor was
started from inside isp4sd_ioc_send_img_buf(), right after
START_STREAM was queued with the fourth buffer, and that path had about
a second of debug sleeps in it. By the time the call returned, the
firmware had already completed that buffer and
isp4vid_handle_frame_done() had removed it from buf_list, so the walk
followed the poisoned next pointer. With the stock driver the window
is tiny, which fits it never showing up in your tests.

To make it reproducible without the debug sleeps, I put an msleep(500)
after each isp4sd_ioc_send_img_buf() call in the start_streaming loop:

	list_for_each_entry(isp4vid_buf, &isp_vdev->buf_list, list) {
		isp4sd_ioc_send_img_buf(isp_vdev->isp_sdev,
					&isp4vid_buf->img_buf);
		msleep(500);
	}

and ran the same command again (my out-of-tree sensor start was still
there, the debug sleeps were not):

- unpatched loop: the same oops (GPF in
  isp4if_alloc_buffer_node+0x37, RBX/RSI dead0000000000b8), 500 ms
  after the call that queued START_STREAM;
- with this patch: the capture completes (30 frames), no oops.

I'd expect the same msleep() to reproduce it on the HP ZBook.

Regards,

Seifelden

  reply	other threads:[~2026-11-03 15:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-26 18:24 [PATCH 0/2] media: amd: isp4: two fixes found on the ROG Flow Z13 Seifelden Abdelmonem
2026-10-26 18:24 ` [PATCH 1/2] media: amd: isp4: hold buf_list_lock while sending buffers at stream start Seifelden Abdelmonem
2026-10-27  8:51   ` Bin Du
2026-11-02 19:16   ` Nirujogi, Pratap
2026-11-03 15:02     ` Seifelden Abdelmonem [this message]
2026-11-03 19:05       ` Nirujogi, Pratap
2026-10-26 18:24 ` [PATCH 2/2] media: amd: isp4: return capture buffers with V4L2_FIELD_NONE Seifelden Abdelmonem
2026-10-27  8:51   ` Bin Du
2026-11-02 19:17   ` Nirujogi, Pratap

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=20261103150312.52812-1-saif.elden.hatim@gmail.com \
    --to=saif.elden.hatim@gmail.com \
    --cc=King.Li@amd.com \
    --cc=benjamin.chan@amd.com \
    --cc=bin.du@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=pratap.nirujogi@amd.com \
    --cc=sakari.ailus@linux.intel.com \
    --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

all inboxes | Powered by JetHome®