mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 00/11] media: intel/ipu6: bounds, leak, and error handling fixes
@ 2026-11-03 21:10 Valerii Sokolov
  2026-11-03 21:10 ` [PATCH v2 01/11] media: intel/ipu6: move busy check to ipu6_isys_vidioc_s_fmt_vid_cap() Valerii Sokolov
                   ` (10 more replies)
  0 siblings, 11 replies; 14+ messages in thread
From: Valerii Sokolov @ 2026-11-03 21:10 UTC (permalink / raw)
  To: Sakari Ailus
  Cc: Bingbu Cao, Tianshu Qiu, Stanislaw Gruszka, Antti Laakso,
	Sarang Sapre, Divyamani Tripathi, Manik Bajpai,
	Mauro Carvalho Chehab, linux-media, linux-kernel,
	Valerii Sokolov

This series fixes bugs in the Intel IPU6 input system (ISYS), Buttress,
DMA/MMU and firmware interface code:

 1    Move the vb2_is_busy() check from VIDIOC_TRY_FMT to VIDIOC_S_FMT, so
      TRY_FMT never returns -EBUSY and S_FMT can no longer overwrite
      av->pix_fmt with an unvalidated format while buffers are allocated.
 2    Return firmware message buffers to the free pool when sending a
      stream start or capture command fails.
 3    Bound the number of input and output pins in
      ipu6_isys_fw_pin_cfg().
 4    Clamp the crop top offset in ipu6_isys_csi2_set_sel().
 5    Only call auxiliary device ISRs for interrupts that belong to them.
 6    Release the firmware context when ipu6_fw_com_open() fails.
 7-10 DMA/MMU fixes: an IOVA leak and a silently ignored mapping failure
      in the scatterlist mapping helpers, a missing DMA unmap of the dummy
      L2 page table, and a dev_err(NULL, ...).
11    Log the correct frame sequence number on EOF (debug only).

Patches 1, 3, 4 and 8 are tagged for stable. The other fixes address
bounded leaks or cosmetic issues.

The IPU7 code recently added to this driver appears to have the same
issues as patches 3 and 11 (ipu7_isys_fw_pin_cfg() and
ipu7_isys_isr_one()). I have left those alone as I have no IPU7 hardware
to test on.

Testing: each patch was build-tested with W=1 on top of
media-committers/next, and the series was runtime-tested on a Raptor
Lake laptop (Lenovo ThinkPad X1 Carbon Gen 11, OV2740 sensor).

Changes in v2:
- Patch 8: Return the negative error code from ipu6_dma_map_sg() instead
  of checking for 0 in ipu6_dma_map_sgtable() (Sakari Ailus). Omitted
  Antti's Reviewed-by on this patch as the implementation changed.
- Collected Reviewed-by from Antti Laakso on patches 1-7 and 9-11.
- Link to v1:
  https://lore.kernel.org/r/20261023195446.22578-1-valerii.sokolov@pm.me

Signed-off-by: Valerii Sokolov <valerii.sokolov@pm.me>

Valerii Sokolov (11):
  media: intel/ipu6: move busy check to ipu6_isys_vidioc_s_fmt_vid_cap()
  media: intel/ipu6: fix firmware message buffer leak on send failure
  media: intel/ipu6: check pin bounds in ipu6_isys_fw_pin_cfg()
  media: intel/ipu6: clamp crop top offset in ipu6_isys_csi2_set_sel()
  media: intel/ipu6: check irq_status mask before calling subdevice ISR
  media: intel/ipu6: clean up fwctx on ipu6_fw_com_open() failure
  media: intel/ipu6: fix IOVA leak on first entry failure in
    ipu6_dma_map_sg()
  media: intel/ipu6: return an error from ipu6_dma_map_sg() on failure
  media: intel/ipu6: unmap the dummy L2 page table in ipu6_mmu_destroy()
  media: intel/ipu6: pass the device to dev_err() in ipu6_mmu_unmap()
  media: intel/ipu6: fix EOF sequence logging in ipu6_isys_isr_one()

 drivers/media/pci/intel/ipu6/ipu6-buttress.c   |  3 ++-
 drivers/media/pci/intel/ipu6/ipu6-dma.c        | 10 ++++++----
 drivers/media/pci/intel/ipu6/ipu6-fw-isys.c    | 10 ++++++++--
 drivers/media/pci/intel/ipu6/ipu6-isys-csi2.c  |  2 ++
 drivers/media/pci/intel/ipu6/ipu6-isys-queue.c |  4 +++-
 drivers/media/pci/intel/ipu6/ipu6-isys-video.c |  7 ++++---
 drivers/media/pci/intel/ipu6/ipu6-mmu.c        |  5 +++--
 7 files changed, 28 insertions(+), 13 deletions(-)


base-commit: d7e7bca7169873b46e857c025c10f3336c1258d8
-- 
2.56.0



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

end of thread, other threads:[~2026-11-04 13:35 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 21:10 [PATCH v2 00/11] media: intel/ipu6: bounds, leak, and error handling fixes Valerii Sokolov
2026-11-03 21:10 ` [PATCH v2 01/11] media: intel/ipu6: move busy check to ipu6_isys_vidioc_s_fmt_vid_cap() Valerii Sokolov
2026-11-03 21:10 ` [PATCH v2 02/11] media: intel/ipu6: fix firmware message buffer leak on send failure Valerii Sokolov
2026-11-03 21:10 ` [PATCH v2 03/11] media: intel/ipu6: check pin bounds in ipu6_isys_fw_pin_cfg() Valerii Sokolov
2026-11-03 21:10 ` [PATCH v2 04/11] media: intel/ipu6: clamp crop top offset in ipu6_isys_csi2_set_sel() Valerii Sokolov
2026-11-03 21:10 ` [PATCH v2 05/11] media: intel/ipu6: check irq_status mask before calling subdevice ISR Valerii Sokolov
2026-11-03 21:10 ` [PATCH v2 06/11] media: intel/ipu6: clean up fwctx on ipu6_fw_com_open() failure Valerii Sokolov
2026-11-03 21:11 ` [PATCH v2 07/11] media: intel/ipu6: fix IOVA leak on first entry failure in ipu6_dma_map_sg() Valerii Sokolov
2026-11-04 13:02   ` Sakari Ailus
2026-11-03 21:11 ` [PATCH v2 08/11] media: intel/ipu6: return an error from ipu6_dma_map_sg() on failure Valerii Sokolov
2026-11-03 21:11 ` [PATCH v2 09/11] media: intel/ipu6: unmap the dummy L2 page table in ipu6_mmu_destroy() Valerii Sokolov
2026-11-03 21:11 ` [PATCH v2 10/11] media: intel/ipu6: pass the device to dev_err() in ipu6_mmu_unmap() Valerii Sokolov
2026-11-03 21:11 ` [PATCH v2 11/11] media: intel/ipu6: fix EOF sequence logging in ipu6_isys_isr_one() Valerii Sokolov
2026-11-04 13:35   ` Sakari Ailus

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®