Linux kernel -stable discussions
 help / color / mirror / Atom feed
* [PATCH 0/2] media: amd: isp4: fix stream start failure and deadlock
@ 2026-11-30 22:24 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-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
  0 siblings, 2 replies; 6+ messages in thread
From: Mateo Amado Ares via B4 Relay @ 2026-11-30 22:24 UTC (permalink / raw)
  To: Bin Du, Nirujogi Pratap, Mauro Carvalho Chehab
  Cc: Sakari Ailus, linux-media, stable, Mateo Amado Ares

On an HP ZBook Ultra G1a (Strix Halo) running 7.3.6, accepting a video
call in Chrome froze the camera until reboot. The hung VIDIOC_STREAMON left
unkillable tasks behind, shutdown could not finish, and the next boot
needed a forced power-off.

Two bugs combined:

- Patch 1: isp4sd_start_stream() calls isp4sd_stop_stream() on its error
  path while already holding ops_mutex, so any stream start failure
  self-deadlocks. Same pattern as the isp4sd_pwron_and_init() fix in
  ef46d80a7015.

- Patch 2: the subdev format is only set by S_FMT and is cleared when a
  stream stops, so a STREAMON without a preceding S_FMT (including a
  STREAMOFF/STREAMON cycle on the same fd) fails with "fail to get out
  prop". This is the failure that hit patch 1's deadlock here.
  The subdev has no device node, so the video node's format is the only
  one userspace can set; patch 2 propagates it on every stream start.
  The alternative, adding .init_state and no longer clearing the format
  in isp4sd_uninit_stream(), is fine with me if you prefer it.

Testing, on the hardware above with the driver rebuilt from v7.3.6
plus these patches:

- A small V4L2 test (S_FMT, REQBUFS, STREAMON, DQBUF, STREAMOFF, then
  STREAMON again without S_FMT) logged the same "fail to get out prop" /
  "fail to setup output" as the original hang. With patch 1 only, the
  second STREAMON returns -EINVAL and the device keeps working. With
  both patches, the second STREAMON streams frames.
- Both patches also build without warnings (W=1, sparse) against
  v7.4-rc4 headers.
- Not tested: an unpatched run of the test, because recovering from the
  hang needs a forced power-off. I can share the test program on request.

I used Claude (an AI assistant) to read the logs and driver source, find
both bugs, and draft the patches, the test and these messages. I
reviewed the changes and ran the tests above myself.

---
Mateo Amado Ares (2):
      media: amd: isp4: fix self-deadlock in isp4sd_start_stream() error path
      media: amd: isp4: propagate the capture format to the subdev on stream start

 drivers/media/platform/amd/isp4/isp4_subdev.c | 15 +++++++++++----
 drivers/media/platform/amd/isp4/isp4_video.c  | 10 ++++++++++
 2 files changed, 21 insertions(+), 4 deletions(-)
---
base-commit: fe6ff8d5d675c01793b9f051d16055dd4aa75244
change-id: 20261130-isp4-start-stream-deadlock-08e421deb181

Best regards,
--  
Mateo Amado Ares <mateoamadoares@gmail.com>



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-12-01  3:47 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox