Skip to contentSkip to conversation

media: hws: fix shared IRQ and video quiesce handling

PATCH In review Ben Hoff 2 participants 5 messages Sep 15 – Sep 22

Subsystems (2)
lore
Share & tools
lore

Ben Hoff

author maintainer
#0 lore raw

cover media: hws: fix shared IRQ and video quiesce handling

HWS quiescence currently disables a shared IRQ descriptor and calls vb2_streamoff() without the queue's state mutex. This can prevent other devices on the interrupt line from being serviced and race userspace capture operations during suspend or shutdown.

Remove diagnostic register accesses first, then restrict IRQ quiescence to the HWS function and serialize monitor and queue transitions. Runtime readiness checks report an unready core without resetting shared hardware while capture buffers may still be owned by another channel.

Based on media-next/next at b38d06ad1e13 ("media: ipu6: Fix up missing IWYU issue"). Apply the three patches in order.

AI assistance: OpenAI Codex using GPT-6 assisted with this submission. Each patch includes Assisted-by: Codex:GPT-6 to identify the agent and model.

Validation:
- Applied and built every patch boundary as an external module with W=1 against the prepared x86_64 kernel, with CONFIG_PM_SLEEP=y.
- Strict checkpatch and git diff --check pass.
- Hardware capture and system-sleep tests have not been run for this extracted series.

Ben Hoff (3):
media: hws: remove debug controls and lifecycle tracing
media: hws: quiesce interrupts without disabling shared IRQ
media: hws: serialize video quiesce with queue state

 drivers/media/pci/hws/hws.h            |   2 +
 drivers/media/pci/hws/hws_irq.c        |  84 +-----------
 drivers/media/pci/hws/hws_pci.c        | 181 ++++---------------------
 drivers/media/pci/hws/hws_v4l2_ioctl.c |  14 --
 drivers/media/pci/hws/hws_video.c      | 144 ++------------------
 5 files changed, 44 insertions(+), 381 deletions(-)

base-commit: b38d06ad1e13c32970d58039c154f009b81a3368

author maintainer
#1 lore raw

PATCH 1/3 media: hws: remove debug controls and lifecycle tracing

Remove the toggle_debug and dma_window_verify module parameters, register snapshots, and routine capture and lifecycle messages. These diagnostics add register reads to interrupt and format paths, including IRQ debug reads before the suspended-state check.

Keep error reporting and the posted-write flush needed before arming DMA. This also removes diagnostic MMIO accesses that would otherwise bypass the suspended-handler guard in the following shared-IRQ fix.

Assisted-by Codex:GPT-6
---
 drivers/media/pci/hws/hws_irq.c        |  74 -------------
 drivers/media/pci/hws/hws_pci.c        | 145 +------------------------
 drivers/media/pci/hws/hws_v4l2_ioctl.c |  14 ---
 drivers/media/pci/hws/hws_video.c      | 125 +--------------------
 4 files changed, 4 insertions(+), 354 deletions(-)
drivers/media/pci/hws/hws_irq.c +0 -74
index eebb4b8a5cd5..787c9e498799 100644
@@ -16,38 +16,23 @@
 
 #define MAX_INT_LOOPS 100
 
-static bool hws_toggle_debug;
-module_param_named(toggle_debug, hws_toggle_debug, bool, 0644);
-MODULE_PARM_DESC(toggle_debug,
-		 "Read toggle registers in IRQ handler for debug logging");
-
 static int hws_arm_next(struct hws_pcie_dev *hws, u32 ch)
 {
 	struct hws_video *v = &hws->video[ch];
 	unsigned long flags;
 	struct hwsvideo_buffer *buf;
 
-	dev_dbg(&hws->pdev->dev,
-		"arm_next(ch=%u): stop=%d cap=%d queued=%d\n",
-		ch, READ_ONCE(v->stop_requested), READ_ONCE(v->cap_active),
-		!list_empty(&v->capture_queue));
-
 	if (READ_ONCE(hws->suspended)) {
-		dev_dbg(&hws->pdev->dev, "arm_next(ch=%u): suspended\n", ch);
 		return -EBUSY;
 	}
 
 	if (READ_ONCE(v->stop_requested) || !READ_ONCE(v->cap_active)) {
-		dev_dbg(&hws->pdev->dev,
-			"arm_next(ch=%u): stop=%d cap=%d -> cancel\n", ch,
-			v->stop_requested, v->cap_active);
 		return -ECANCELED;
 	}
 
 	spin_lock_irqsave(&v->irq_lock, flags);
 	if (list_empty(&v->capture_queue)) {
 		spin_unlock_irqrestore(&v->irq_lock, flags);
-		dev_dbg(&hws->pdev->dev, "arm_next(ch=%u): queue empty\n", ch);
 		return -EAGAIN;
 	}
 
@@ -57,8 +42,6 @@ static int hws_arm_next(struct hws_pcie_dev *hws, u32 ch)
 		v->queued_count--;
 	v->active = buf;
 	spin_unlock_irqrestore(&v->irq_lock, flags);
-	dev_dbg(&hws->pdev->dev, "arm_next(ch=%u): picked buffer %p\n", ch,
-		buf);
 
 	/* Publish descriptor(s) before doorbell/MMIO kicks. */
 	wmb();
@@ -67,8 +50,6 @@ static int hws_arm_next(struct hws_pcie_dev *hws, u32 ch)
 	if (READ_ONCE(hws->suspended)) {
 		unsigned long f;
 
-		dev_dbg(&hws->pdev->dev,
-			"arm_next(ch=%u): suspended after pick\n", ch);
 		spin_lock_irqsave(&v->irq_lock, f);
 		if (v->active) {
 			list_add(&buf->list, &v->capture_queue);
@@ -88,8 +69,6 @@ static int hws_arm_next(struct hws_pcie_dev *hws, u32 ch)
 			  hws->bar0_base + HWS_REG_DMA_ADDR(ch));
 	}
 
-	dev_dbg(&hws->pdev->dev, "arm_next(ch=%u): programmed buffer %p\n", ch,
-		buf);
 	spin_lock_irqsave(&v->irq_lock, flags);
 	hws_prime_next_locked(v);
 	spin_unlock_irqrestore(&v->irq_lock, flags);
@@ -104,16 +83,8 @@ static void hws_video_handle_vdone(struct hws_video *v)
 	unsigned long flags;
 	bool promoted = false;
 
-	dev_dbg(&hws->pdev->dev,
-		"bh_video(ch=%u): stop=%d cap=%d active=%p\n",
-		ch, READ_ONCE(v->stop_requested), READ_ONCE(v->cap_active),
-		v->active);
-
 	int ret;
 
-	dev_dbg(&hws->pdev->dev,
-		"bh_video(ch=%u): entry stop=%d cap=%d\n", ch,
-		v->stop_requested, v->cap_active);
 	if (READ_ONCE(hws->suspended))
 		return;
 
@@ -149,10 +120,6 @@ static void hws_video_handle_vdone(struct hws_video *v)
 
 		vb2v->sequence = (u32)atomic_inc_return(&v->sequence_number);
 		vb2v->vb2_buf.timestamp = ktime_get_ns();
-		dev_dbg(&hws->pdev->dev,
-			"bh_video(ch=%u): DONE buf=%p seq=%u half_seen=%d toggle=%u\n",
-			ch, done, vb2v->sequence, v->half_seen,
-			v->last_buf_half_toggle);
 
 		if (!promoted)
 			v->active = NULL;	/* channel no longer owns this buffer */
@@ -163,9 +130,6 @@ static void hws_video_handle_vdone(struct hws_video *v)
 		return;
 
 	if (promoted) {
-		dev_dbg(&hws->pdev->dev,
-			"bh_video(ch=%u): promoted pre-armed buffer active=%p\n",
-			ch, v->active);
 		spin_lock_irqsave(&v->irq_lock, flags);
 		hws_prime_next_locked(v);
 		spin_unlock_irqrestore(&v->irq_lock, flags);
@@ -176,13 +140,8 @@ static void hws_video_handle_vdone(struct hws_video *v)
 	/* 2) Immediately arm the next queued buffer (if present) */
 	ret = hws_arm_next(hws, ch);
 	if (ret == -EAGAIN) {
-		dev_dbg(&hws->pdev->dev,
-			"bh_video(ch=%u): no queued buffer to arm\n", ch);
 		return;
 	}
-	dev_dbg(&hws->pdev->dev,
-		"bh_video(ch=%u): armed next buffer, active=%p\n", ch,
-		v->active);
 	/* On success the engine now points at v->active's DMA address */
 }
 
@@ -191,14 +150,6 @@ irqreturn_t hws_irq_handler(int irq, void *info)
 	struct hws_pcie_dev *pdx = info;
 	u32 int_state;
 
-	dev_dbg(&pdx->pdev->dev, "irq: entry\n");
-	if (pdx->bar0_base) {
-		dev_dbg(&pdx->pdev->dev,
-			"irq: INT_EN=0x%08x INT_STATUS=0x%08x\n",
-			readl(pdx->bar0_base + INT_EN_REG_BASE),
-			readl(pdx->bar0_base + HWS_REG_INT_STATUS));
-	}
-
 	/* Fast path: if suspended, quietly ack and exit */
 	if (READ_ONCE(pdx->suspended)) {
 		int_state = readl_relaxed(pdx->bar0_base + HWS_REG_INT_STATUS);
@@ -210,12 +161,8 @@ irqreturn_t hws_irq_handler(int irq, void *info)
 	}
 	int_state = readl_relaxed(pdx->bar0_base + HWS_REG_INT_STATUS);
 	if (!int_state || int_state == 0xFFFFFFFF) {
-		dev_dbg(&pdx->pdev->dev,
-			"irq: spurious or device-gone int_state=0x%08x\n",
-			int_state);
 		return IRQ_NONE;
 	}
-	dev_dbg(&pdx->pdev->dev, "irq: entry INT_STATUS=0x%08x\n", int_state);
 
 	/* Loop until all pending bits are serviced (max 100 iterations) */
 	for (u32 cnt = 0; int_state && cnt < MAX_INT_LOOPS; ++cnt) {
@@ -227,27 +174,9 @@ irqreturn_t hws_irq_handler(int irq, void *info)
 
 			if (READ_ONCE(pdx->video[ch].cap_active) &&
 			    !READ_ONCE(pdx->video[ch].stop_requested)) {
-				if (hws_toggle_debug) {
-					u32 toggle =
-					    readl_relaxed(pdx->bar0_base +
-						  HWS_REG_VBUF_TOGGLE(ch)) & 0x01;
-					WRITE_ONCE(pdx->video[ch].last_buf_half_toggle,
-						   toggle);
-				}
 				dma_rmb();
 				WRITE_ONCE(pdx->video[ch].half_seen, true);
-				dev_dbg(&pdx->pdev->dev,
-					"irq: VDONE ch=%u toggle=%u handling inline (cap=%d)\n",
-					ch,
-					READ_ONCE(pdx->video[ch].last_buf_half_toggle),
-					READ_ONCE(pdx->video[ch].cap_active));
 				hws_video_handle_vdone(&pdx->video[ch]);
-			} else {
-				dev_dbg(&pdx->pdev->dev,
-					"irq: VDONE ch=%u ignored (cap=%d stop=%d)\n",
-					ch,
-					READ_ONCE(pdx->video[ch].cap_active),
-					READ_ONCE(pdx->video[ch].stop_requested));
 			}
 
 			writel(vbit, pdx->bar0_base + HWS_REG_INT_STATUS);
@@ -256,9 +185,6 @@ irqreturn_t hws_irq_handler(int irq, void *info)
 
 		/* Re-read in case new interrupt bits popped while processing */
 		int_state = readl_relaxed(pdx->bar0_base + HWS_REG_INT_STATUS);
-		dev_dbg(&pdx->pdev->dev,
-			"irq: loop cnt=%u new INT_STATUS=0x%08x\n", cnt,
-			int_state);
 		if (cnt + 1 == MAX_INT_LOOPS)
 			dev_warn_ratelimited(&pdx->pdev->dev,
 					     "IRQ storm? status=0x%08x\n",
drivers/media/pci/hws/hws_pci.c +2 -143

345 lines not on this page · raw message

drivers/media/pci/hws/hws_v4l2_ioctl.c +0 -14
index ce396b7225d2..7169fd048e73 100644
@@ -794,10 +794,6 @@ int hws_vidioc_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *
 		if (!max_bpl_hw)
 			return -ERANGE;
 		if (bpl > max_bpl_hw) {
-			if (pdev)
-				dev_dbg(&pdev->pdev->dev,
-					"try_fmt: clamp bpl %u -> %zu due to hw buf cap %zu\n",
-					bpl, max_bpl_hw, max_frame);
 			bpl = (u32)max_bpl_hw;
 		}
 	}
@@ -811,11 +807,6 @@ int hws_vidioc_try_fmt_vid_cap(struct file *file, void *fh, struct v4l2_format *
 	pix->sizeimage    = (u32)size; /* logical size, not page-aligned */
 
 	hws_set_colorimetry_fmt(pix);
-	if (pdev)
-		dev_dbg(&pdev->pdev->dev,
-			"try_fmt: w=%u h=%u bpl=%u size=%u field=%u\n",
-			pix->width, pix->height, pix->bytesperline,
-			pix->sizeimage, pix->field);
 	return 0;
 }
 
@@ -862,11 +853,6 @@ int hws_vidioc_s_fmt_vid_cap(struct file *file, void *priv, struct v4l2_format *
 	 * hws_calc_sizeimage(vid, vid->pix.width, vid->pix.height, false);
 	 */
 
-	dev_dbg(&vid->parent->pdev->dev,
-		"s_fmt:   w=%u h=%u bpl=%u size=%u\n",
-		vid->pix.width, vid->pix.height, vid->pix.bytesperline,
-		vid->pix.sizeimage);
-
 	return 0;
 }
 
drivers/media/pci/hws/hws_video.c +2 -123

261 lines not on this page · raw message

author maintainer
#2 lore raw

PATCH 2/3 media: hws: quiesce interrupts without disabling shared IRQ

In reply to Ben Hoff

HWS requests its legacy interrupt with IRQF_SHARED, but suspend, shutdown, and removal call disable_irq() on the shared descriptor. This prevents other devices on the line from being serviced, and removal leaves the IRQ disable unbalanced.

Mask the HWS interrupt gate, flush the write, and synchronize the handler. Publish suspended state before draining so callbacks caused by a peer on the shared line return without accessing HWS registers after suspend.

Keep capture-core initialization from opening the interrupt gate. Resume restores the core and clears pending causes before publishing live state and unmasking the device-local gate.

Fixes ba07fd2f5742 ("media: pci: add AVMatrix HWS capture driver")
Assisted-by Codex:GPT-6
---
 drivers/media/pci/hws/hws_irq.c   | 12 +++---------
 drivers/media/pci/hws/hws_pci.c   | 27 +++++++++++++++++----------
 drivers/media/pci/hws/hws_video.c |  8 ++------
 3 files changed, 22 insertions(+), 25 deletions(-)
drivers/media/pci/hws/hws_irq.c +3 -9
index 787c9e498799..8d883663617b 100644
@@ -150,15 +150,9 @@ irqreturn_t hws_irq_handler(int irq, void *info)
 	struct hws_pcie_dev *pdx = info;
 	u32 int_state;
 
-	/* Fast path: if suspended, quietly ack and exit */
-	if (READ_ONCE(pdx->suspended)) {
-		int_state = readl_relaxed(pdx->bar0_base + HWS_REG_INT_STATUS);
-		if (int_state) {
-			writel(int_state, pdx->bar0_base + HWS_REG_INT_STATUS);
-			(void)readl_relaxed(pdx->bar0_base + HWS_REG_INT_STATUS);
-		}
-		return int_state ? IRQ_HANDLED : IRQ_NONE;
-	}
+	if (!pdx || READ_ONCE(pdx->suspended) || !pdx->bar0_base)
+		return IRQ_NONE;
+
 	int_state = readl_relaxed(pdx->bar0_base + HWS_REG_INT_STATUS);
 	if (!int_state || int_state == 0xFFFFFFFF) {
 		return IRQ_NONE;
drivers/media/pci/hws/hws_pci.c +17 -10
index 65b32fac6d1a..c9397b13392a 100644
@@ -325,14 +325,21 @@ static void hws_irq_clear_pending(struct hws_pcie_dev *hws)
 static void hws_block_hotpaths(struct hws_pcie_dev *hws)
 {
 	WRITE_ONCE(hws->suspended, true);
-	if (hws->irq >= 0)
-		disable_irq(hws->irq);
+	/* Publish the stop state before a racing handler can enter MMIO. */
+	smp_mb();
 
-	if (!hws->bar0_base)
-		return;
+	if (hws->bar0_base)
+		hws_irq_mask_gate(hws);
 
-	hws_irq_mask_gate(hws);
-	hws_irq_clear_pending(hws);
+	/*
+	 * Do not disable the shared descriptor. Wait for any invocation of this
+	 * handler that raced with the device-local gate instead.
+	 */
+	if (hws->irq >= 0)
+		synchronize_irq(hws->irq);
+
+	if (hws->bar0_base)
+		hws_irq_clear_pending(hws);
 }
 
 static int hws_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
@@ -661,11 +668,11 @@ static int hws_pm_resume(struct device *dev)
 	hws_init_video_sys(hws, true);
 	hws_irq_clear_pending(hws);
 
-	/* IRQs can be re-enabled now that MMIO is sane */
-	if (hws->irq >= 0)
-		enable_irq(hws->irq);
-
+	/* Make our handler live before reopening only this device's IRQ gate. */
 	WRITE_ONCE(hws->suspended, false);
+	/* Publish the live state before the device can raise another interrupt. */
+	smp_mb();
+	hws_irq_unmask_gate(hws);
 
 	/* vb2: nothing mandatory; userspace will STREAMON again when ready */
 	hws_video_pm_resume(hws);
drivers/media/pci/hws/hws_video.c +2 -6
index 624c48a63b3b..bdbce09ec3e6 100644
@@ -565,7 +565,7 @@ static void hws_ack_all_irqs(struct hws_pcie_dev *hws)
 	}
 }
 
-static void hws_open_irq_fabric(struct hws_pcie_dev *hws)
+static void hws_configure_irq_fabric(struct hws_pcie_dev *hws)
 {
 	/* Route all sources to vector 0. */
 	writel(0x00000000, hws->bar0_base + PCIE_INT_DEC_REG_BASE);
@@ -574,10 +574,6 @@ static void hws_open_irq_fabric(struct hws_pcie_dev *hws)
 	/* Enable the PCIe bridge. */
 	writel(0x00000001, hws->bar0_base + PCIEBR_EN_REG_BASE);
 	(void)readl(hws->bar0_base + PCIEBR_EN_REG_BASE);
-
-	/* Open the global/bridge gate (legacy 0x3FFFF) */
-	writel(HWS_INT_EN_MASK, hws->bar0_base + INT_EN_REG_BASE);
-	(void)readl(hws->bar0_base + INT_EN_REG_BASE);
 }
 
 void hws_init_video_sys(struct hws_pcie_dev *hws, bool enable)
@@ -604,7 +600,7 @@ void hws_init_video_sys(struct hws_pcie_dev *hws, bool enable)
 	writel(0x80FFFFFF, hws->bar0_base + HWS_REG_DEC_MODE);
 	writel(0x13, hws->bar0_base + HWS_REG_DEC_MODE);
 	hws_ack_all_irqs(hws);
-	hws_open_irq_fabric(hws);
+	hws_configure_irq_fabric(hws);
 	/* 6) record that we're now running */
 	hws->start_run = true;
 }
author maintainer
#3 lore raw

PATCH 3/3 media: hws: serialize video quiesce with queue state

In reply to Ben Hoff

Suspend and shutdown call vb2_streamoff() without taking the state mutex used by the video device and its vb2 queue. This can race userspace queue operations and violates the locking requirement in hws_stop_streaming().

Hold the channel state mutex around the streaming check and streamoff. Serialize monitor passes with lifecycle quiescence, and recheck suspended state after acquiring the monitor mutex so a delayed pass cannot enter hardware access after teardown has drained it.

Reject readiness checks once suspension begins. If the core is not ready, return an error instead of resetting shared hardware while another channel may still own capture buffers.

Fixes ba07fd2f5742 ("media: pci: add AVMatrix HWS capture driver")
Assisted-by Codex:GPT-6
---
 drivers/media/pci/hws/hws.h       |  2 ++
 drivers/media/pci/hws/hws_pci.c   | 11 +++++++++--
 drivers/media/pci/hws/hws_video.c | 11 +++++++++--
 3 files changed, 20 insertions(+), 4 deletions(-)
drivers/media/pci/hws/hws.h +2 -0
index d87d52674b69..01a6b00dcca6 100644
@@ -8,6 +8,7 @@
 #include <linux/kthread.h>
 #include <linux/pci.h>
 #include <linux/list.h>
+#include <linux/mutex.h>
 #include <linux/spinlock.h>
 #include <linux/sizes.h>
 #include <linux/atomic.h>
@@ -161,6 +162,7 @@ struct hws_pcie_dev {
 
 	/* Kernel thread */
 	struct task_struct *main_task;
+	struct mutex monitor_lock; /* serializes monitor and lifecycle changes */
 	struct hws_scratch_dma scratch_vid[MAX_VID_CHANNELS];
 
 	bool suspended;
drivers/media/pci/hws/hws_pci.c +9 -2
index c9397b13392a..7fdb1087d247 100644
@@ -177,8 +177,10 @@ static int main_ks_thread_handle(void *data)
 			continue;
 		}
 
-		/* avoid MMIO when suspended (guarded above) */
-		check_video_format(pdx);
+		mutex_lock(&pdx->monitor_lock);
+		if (!READ_ONCE(pdx->suspended))
+			check_video_format(pdx);
+		mutex_unlock(&pdx->monitor_lock);
 
 		try_to_freeze(); /* cooperate with freezer each loop */
 
@@ -338,6 +340,10 @@ static void hws_block_hotpaths(struct hws_pcie_dev *hws)
 	if (hws->irq >= 0)
 		synchronize_irq(hws->irq);
 
+	/* Wait for a monitor pass that started before suspended was set. */
+	mutex_lock(&hws->monitor_lock);
+	mutex_unlock(&hws->monitor_lock);
+
 	if (hws->bar0_base)
 		hws_irq_clear_pending(hws);
 }
@@ -357,6 +363,7 @@ static int hws_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id)
 	hws->pdev = pdev;
 	hws->irq = -1;
 	hws->suspended = false;
+	mutex_init(&hws->monitor_lock);
 	pci_set_drvdata(pdev, hws);
 
 	/* 1) Enable device + bus mastering (managed) */
drivers/media/pci/hws/hws_video.c +9 -2
index bdbce09ec3e6..8e029b71b5b5 100644
@@ -611,6 +611,8 @@ int hws_check_card_status(struct hws_pcie_dev *hws)
 
 	if (!hws || !hws->bar0_base)
 		return -ENODEV;
+	if (READ_ONCE(hws->suspended))
+		return -EBUSY;
 
 	status = readl(hws->bar0_base + HWS_REG_SYS_STATUS);
 
@@ -621,9 +623,12 @@ int hws_check_card_status(struct hws_pcie_dev *hws)
 		return -ENODEV;
 	}
 
-	/* If RUN/READY bit (bit0) is not set, reinitialize the video core. */
+	/* Runtime reset would invalidate every active channel's DMA ownership. */
 	if (!(status & BIT(0))) {
-		hws_init_video_sys(hws, true);
+		dev_warn_ratelimited(&hws->pdev->dev,
+				     "SYS_STATUS not ready (0x%08x); runtime core reset refused\n",
+				     status);
+		return -EIO;
 	}
 
 	return 0;
@@ -1349,6 +1354,7 @@ int hws_video_quiesce(struct hws_pcie_dev *hws, const char *reason)
 			continue;
 		}
 
+		mutex_lock(&vid->state_lock);
 		streaming = vb2_is_streaming(q);
 		if (streaming) {
 			/* Stop via vb2, which runs .stop_streaming. */
@@ -1357,6 +1363,7 @@ int hws_video_quiesce(struct hws_pcie_dev *hws, const char *reason)
 			if (r && !ret)
 				ret = r;
 		}
+		mutex_unlock(&vid->state_lock);
 	}
 	return ret;
 }
#4 lore raw
In reply to Ben Hoff

Hi Ben,

Quoted 10 lines · Ben Hoff

HWS quiescence currently disables a shared IRQ descriptor and calls vb2_streamoff() without the queue's state mutex. This can prevent other devices on the interrupt line from being serviced and race userspace capture operations during suspend or shutdown.

Remove diagnostic register accesses first, then restrict IRQ quiescence to the HWS function and serialize monitor and queue transitions. Runtime readiness checks report an unready core without resetting shared hardware while capture buffers may still be owned by another channel.

Quoted 5 lines

Based on media-next/next at b38d06ad1e13 ("media: ipu6: Fix up missing IWYU issue"). Apply the three patches in order.

AI assistance: OpenAI Codex using GPT-6 assisted with this submission. Each patch includes Assisted-by: Codex:GPT-6 to identify the agent and model.

So I'm marking this series as Changes Requested.

It is not so much the code, but the awful AI generated commit messages. For example. patch 1/3 makes lots of changes, but the commit message doesn't even say why this is needed. It tells you it keeps code, but obviously you can't see what that code is in the patch because it is, well, kept :-)

To me this patch just looks like a big cleanup patch, ditching old debug code that is no longer needed. Which sounds like a perfectly find commit log message.

I suggest deleting the commit messages and rewriting them yourself in words that a human would use ('serialize video quiesce with queue state':
really? What the heck does that even mean?)

Remember that AI can be very useful, but in the end it is a human (i.e. me) that has to review it.

Regards,

Hans

Quoted 23 lines

Validation:
- Applied and built every patch boundary as an external module with W=1 against the prepared x86_64 kernel, with CONFIG_PM_SLEEP=y.
- Strict checkpatch and git diff --check pass.
- Hardware capture and system-sleep tests have not been run for this extracted series.

Ben Hoff (3):
media: hws: remove debug controls and lifecycle tracing
media: hws: quiesce interrupts without disabling shared IRQ
media: hws: serialize video quiesce with queue state

 drivers/media/pci/hws/hws.h            |   2 +
 drivers/media/pci/hws/hws_irq.c        |  84 +-----------
 drivers/media/pci/hws/hws_pci.c        | 181 ++++---------------------
 drivers/media/pci/hws/hws_v4l2_ioctl.c |  14 --
 drivers/media/pci/hws/hws_video.c      | 144 ++------------------
 5 files changed, 44 insertions(+), 381 deletions(-)

base-commit: b38d06ad1e13c32970d58039c154f009b81a3368