From 2a739443aeb748037861a3b466b49c901b740eab Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 16 Sep 2026 08:13:56 +0000 Subject: [PATCH 1/3] Initial plan From 19232012456ab9ad8160c794af192559711ca53f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 16 Sep 2026 08:15:42 +0000 Subject: [PATCH 2/3] Force synchronous ISYS suspend on close Co-authored-by: deep0294 <154404789+deep0294@users.noreply.github.com> --- drivers/media/pci/intel/ipu7/ipu7-isys-video.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/media/pci/intel/ipu7/ipu7-isys-video.c b/drivers/media/pci/intel/ipu7/ipu7-isys-video.c index 94d6a3f..699e731 100644 --- a/drivers/media/pci/intel/ipu7/ipu7-isys-video.c +++ b/drivers/media/pci/intel/ipu7/ipu7-isys-video.c @@ -1004,7 +1004,12 @@ void ipu7_isys_fw_close(struct ipu7_isys *isys) ipu7_fw_isys_close(isys); mutex_unlock(&isys->mutex); - pm_runtime_put(&isys->adev->auxdev.dev); + /* + * Force an immediate synchronous power-cycle of the IS island on + * every close, ignoring autosuspend, so S2B/B2O return to POR state + * even if STREAM_FLUSH/STREAM_CLOSE did not complete cleanly. + */ + pm_runtime_put_sync_suspend(&isys->adev->auxdev.dev); } #endif From ee956e4a8dfdabc6894279677e70430b6ce363b3 Mon Sep 17 00:00:00 2001 From: "Amarnath Kumar, Deepak" Date: Thu, 17 Sep 2026 19:46:58 +0300 Subject: [PATCH 3/3] Stop sensor before FW flush/close on stream stop Reorder ipu7_isys_video_set_streaming()'s stop path so the sensor subdevice is disabled before stop_streaming_firmware()/ close_streaming_firmware() are called. This closes the window where new SOF/frame-capture commands from a still-streaming sensor race the firmware's flush/abort snapshot, which was observed to cause the FW stream-stop to time out. Also drop the early return on v4l2_subdev_disable_streams() failure so the FW stream is always flushed and closed even if the sensor disable fails. Co-authored-by: deep0294 <154404789+deep0294@users.noreply.github.com> --- drivers/media/pci/intel/ipu7/ipu7-isys-video.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/media/pci/intel/ipu7/ipu7-isys-video.c b/drivers/media/pci/intel/ipu7/ipu7-isys-video.c index 699e731..d1f39fd 100644 --- a/drivers/media/pci/intel/ipu7/ipu7-isys-video.c +++ b/drivers/media/pci/intel/ipu7/ipu7-isys-video.c @@ -857,19 +857,16 @@ int ipu7_isys_video_set_streaming(struct ipu7_isys_video *av, int state, sd = &stream->asd->sd; r_pad = media_pad_remote_pad_first(&av->pad); if (!state) { - stop_streaming_firmware(av); - - /* stop sub-device which connects with video */ + /* stop sensor first so no new frame cmds race the FW abort */ dev_dbg(dev, "disable streams %s pad:%d mask:0x%llx\n", sd->name, r_pad->index, BIT_ULL(r_stream)); ret = v4l2_subdev_disable_streams(sd, r_pad->index, BIT_ULL(r_stream)); - if (ret) { + if (ret) dev_err(dev, "disable streams %s failed with %d\n", sd->name, ret); - return ret; - } + stop_streaming_firmware(av); close_streaming_firmware(av); ipu7_cleanup_fw_msg_bufs_by_stream_id(av->isys, stream_id); } else {